feat: Add persistant verbose flag - #657
Conversation
NautiluX
commented
Aug 7, 2026
- hide verbose tar output if not --verbose
* hide verbose tar output if not --verbose
| @@ -179,7 +179,7 @@ func (ci *CodesphereInstaller) warnIfVaultDirDiffersFromSecretsDir(config files. | |||
| } | |||
|
|
|||
| func (ci *CodesphereInstaller) ExtractAndValidatePackage(pm PackageManager) error { | |||
There was a problem hiding this comment.
false is hardcoded 3 times, can't we add a bool Verbose to CodesphereInstaller? Otherwise the new --verbose flag ist just ignored here and always false
|
|
||
| log.Printf("Extracting installer bundle %s → %s", bundlePath, destDir) | ||
| if err := util.ExtractTarGz(b.fw, bundlePath, destDir); err != nil { | ||
| if err := util.ExtractTarGz(b.fw, bundlePath, destDir, false); err != nil { |
There was a problem hiding this comment.
same here, hardcoded false instead of adding a Verbose bool to LocalBootstrapper. Flag is ignored
| log.Printf("Opening archive: %s", filename) | ||
| file, err := fileIo.Open(filename) | ||
| if err != nil { | ||
| return nil, fmt.Errorf("failed to open archive: %w", err) | ||
| } | ||
| bufferedFile := bufio.NewReader(file) | ||
|
|
||
| tr := tar.NewReader(bufferedFile) | ||
| return tr, nil | ||
| } | ||
|
|
||
| // openTarGz opens a .tar.gz file and returns a tar.Reader to read its contents. | ||
| func openTarGz(filename string, fileIo FileIO) (*tar.Reader, error) { | ||
| log.Printf("Opening archive: %s", filename) |
There was a problem hiding this comment.
prints that are not handled with csio.Verbosef
| @@ -183,7 +183,7 @@ func (p *Package) GetBaseimagePath(baseimage string, force bool) (string, error) | |||
| } | |||
|
|
|||
| baseImageTarPath := path.Join(baseimagePath, baseimage) | |||
| err := p.ExtractDependency(baseImageTarPath, force) | |||
| err := p.ExtractDependency(baseImageTarPath, force, false) | |||
There was a problem hiding this comment.
hardcoded false instead of using the --verbose flag
| @@ -1 +1 @@ | |||
| // Copyright (c) Codesphere Inc. | |||
There was a problem hiding this comment.
no unit tests for the verbose gating
| }, | ||
| } | ||
|
|
||
| rootCmd.PersistentFlags().BoolVarP(&opts.Verbose, "verbose", "", false, "Enable verbose output") |
There was a problem hiding this comment.
now there is a global verbose flag, but some commands have a --quiet flag. I think we can remove those flags now that we have a global flag.
But maybe something for a follow up pr?