Skip to content

feat: Add persistant verbose flag - #657

Open
NautiluX wants to merge 1 commit into
mainfrom
verbose-tar-output
Open

feat: Add persistant verbose flag#657
NautiluX wants to merge 1 commit into
mainfrom
verbose-tar-output

Conversation

@NautiluX

@NautiluX NautiluX commented Aug 7, 2026

Copy link
Copy Markdown
Member
  • 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 {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, hardcoded false instead of adding a Verbose bool to LocalBootstrapper. Flag is ignored

Comment thread internal/util/tar.go
Comment on lines 41 to 54
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)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prints that are not handled with csio.Verbosef

Comment on lines 138 to +186
@@ -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)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hardcoded false instead of using the --verbose flag

Comment thread internal/util/tar.go
@@ -1 +1 @@
// Copyright (c) Codesphere Inc.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no unit tests for the verbose gating

Comment thread cli/cmd/root.go
},
}

rootCmd.PersistentFlags().BoolVarP(&opts.Verbose, "verbose", "", false, "Enable verbose output")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants