-
Notifications
You must be signed in to change notification settings - Fork 173
WIP: feat(must-gather): Refactor to golang to remove oc dependency. LOG-9008: #3315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jcantrill
wants to merge
22
commits into
openshift:master
Choose a base branch
from
jcantrill:log9008
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
7e3b3d1
feat(must-gather): refactor impl to golang to remove oc dependency
jcantrill 0e52d57
remove EFK resource collection
jcantrill bbc3f6f
remove cluster-logging for duplicated artifacts
jcantrill 876d8cc
parallize artifact collection
jcantrill 5f85f74
initial reorg
jcantrill 6f3a7c7
more reorg
jcantrill 3e2d389
more reorg
jcantrill a19974e
mv logs to core/pods
jcantrill b4cf30c
remove obsolete types gather
jcantrill 1d32c67
fix lfme gather
jcantrill 59800ea
refactor begin/end logging
jcantrill 906cfca
make logger.Warn
jcantrill e3df57b
add logger.Info
jcantrill a9c073c
wip
jcantrill c1532e6
refactor path operations to type
jcantrill 00bec6c
wip
jcantrill 79c1f43
update Dockerfile and Makefile
jcantrill 25e1956
remove scripts
jcantrill 6c3b905
restore openssl package
jcantrill 8fa1310
fix codereview
jcantrill 4db50b6
fix lint
jcantrill a329c5c
redact secret values
jcantrill File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| package main | ||
|
|
||
| import ( | ||
| "context" | ||
| "flag" | ||
| "fmt" | ||
| "io" | ||
| "os" | ||
| "path/filepath" | ||
|
|
||
| "github.com/openshift/cluster-logging-operator/must-gather" | ||
| ) | ||
|
|
||
| func main() { | ||
| var ( | ||
| destDir string | ||
| loggingNamespace string | ||
| logFileName string | ||
| ) | ||
|
|
||
| flag.StringVar(&destDir, "dest-dir", "/must-gather", "Destination directory for collecting must-gather data") | ||
| flag.StringVar(&loggingNamespace, "logging-namespace", "openshift-logging", "Namespace where cluster logging operator is deployed") | ||
| flag.StringVar(&logFileName, "log-file", "gather-debug.log", "Name of the debug log file") | ||
| flag.Parse() | ||
|
|
||
| // Ensure destination directory exists | ||
| if err := os.MkdirAll(destDir, 0755); err != nil { | ||
| fmt.Fprintf(os.Stderr, "Failed to create destination directory: %v\n", err) | ||
| os.Exit(1) | ||
| } | ||
|
|
||
| // Set up logging | ||
| logFilePath := filepath.Join(destDir, logFileName) | ||
| logFile, err := os.Create(logFilePath) | ||
| if err != nil { | ||
| fmt.Fprintf(os.Stderr, "Failed to create log file: %v\n", err) | ||
| os.Exit(1) | ||
| } | ||
| defer func() { | ||
| if err := logFile.Close(); err != nil { | ||
| fmt.Fprintf(os.Stderr, "Failed to close log file: %v\n", err) | ||
| } | ||
| }() | ||
|
|
||
| // Use multi-writer to write to both file and stdout | ||
| multiWriter := io.MultiWriter(os.Stdout, logFile) | ||
|
|
||
| // Create and run the gather | ||
| gather, err := mustgather.NewGather(destDir, loggingNamespace, logFileName, multiWriter) | ||
| if err != nil { | ||
| fmt.Fprintf(os.Stderr, "Failed to create gather: %v\n", err) | ||
| os.Exit(1) | ||
| } | ||
|
|
||
| ctx := context.Background() | ||
| if err := gather.Run(ctx); err != nil { | ||
| fmt.Fprintf(os.Stderr, "Must-gather failed: %v\n", err) | ||
| os.Exit(1) | ||
| } | ||
|
|
||
| fmt.Println("Must-gather completed successfully") | ||
| } | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
40 changes: 0 additions & 40 deletions
40
must-gather/collection-scripts/gather_cluster_logging_operator_resources
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.