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 21, 2024
1 parent ba95369 commit a1edbbf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
3 changes: 1 addition & 2 deletions cmd/glasskube/cmd/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ var bootstrapCmd = &cobra.Command{
cliutils.ExitWithError()
}
if bootstrapCmdOptions.dryrun {
fmt.Println("Dry run completed successfully.")
if err := printBootsrap(
manifests,
bootstrapCmdOptions.Output,
Expand Down Expand Up @@ -211,7 +210,7 @@ func init() {
bootstrapCmdOptions.createDefaultRepository,
"Toggle creation of the default glasskube package repository")
bootstrapCmd.PersistentFlags().BoolVar(&bootstrapCmdOptions.dryrun, "dry-run", false,
"simulate the installation of package without actually installing it")
"simulate the bootstrapping of Glasskube without actually bootstrapping it")
bootstrapCmd.Flags().BoolVar(&bootstrapCmdOptions.yes, "yes", false, "Skip confirmation prompt")
bootstrapCmd.MarkFlagsMutuallyExclusive("url", "type")
bootstrapCmd.MarkFlagsMutuallyExclusive("url", "latest")
Expand Down
5 changes: 1 addition & 4 deletions pkg/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,7 @@ func (c *BootstrapClient) Bootstrap(
}

if options.DryRun {
statusMessage("Dry-run mode enabled. The following resources would be applied:", true)
for _, manifest := range manifests {
fmt.Printf("%s\n", manifest.GetName())
}
statusMessage("Dry-run mode enabled. Glasskube Manifests will not be applied.", true)
return manifests, nil
}

Expand Down

0 comments on commit a1edbbf

Please sign in to comment.