Skip to content

Commit

Permalink
feat(cli): add --dry-run to bootstrap command
Browse files Browse the repository at this point in the history
  • Loading branch information
hanshal101 authored and hanshal101 committed Jun 26, 2024
1 parent d959524 commit 45dbb4e
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions cmd/glasskube/cmd/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,23 +85,14 @@ var bootstrapCmd = &cobra.Command{
cliutils.ExitWithError()
}
if bootstrapCmdOptions.dryrun {
if err := printBootsrap(
manifests,
bootstrapCmdOptions.Output,
); err != nil {
fmt.Fprintf(os.Stderr, "\nAn error occurred in printing : %v\n", err)
cliutils.ExitWithError()
}
} else {
if err := printBootsrap(
if err := printBootstrap(
manifests,
bootstrapCmdOptions.Output,
); err != nil {
fmt.Fprintf(os.Stderr, "\nAn error occurred in printing : %v\n", err)
cliutils.ExitWithError()
}
}

},
}

Expand All @@ -117,7 +108,7 @@ func (o bootstrapOptions) asBootstrapOptions() bootstrap.BootstrapOptions {
}
}

func printBootsrap(manifests []unstructured.Unstructured, output OutputFormat) error {
func printBootstrap(manifests []unstructured.Unstructured, output OutputFormat) error {
if output != "" {
if err := convertAndPrintManifests(manifests, output); err != nil {
return err
Expand Down

0 comments on commit 45dbb4e

Please sign in to comment.