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 28, 2024
1 parent dddabd4 commit 0f56192
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ func (c *BootstrapClient) applyManifests(
return err
}
}
var dryrun []string
if options.DryRun {
dryrun = []string{metav1.DryRunAll}
}

if err = retry.RetryOnConflict(retry.DefaultRetry, func() error {
_, err = c.client.Resource(mapping.Resource).Namespace(obj.GetNamespace()).
Expand All @@ -239,7 +243,7 @@ func (c *BootstrapClient) applyManifests(
metav1.ApplyOptions{
Force: true,
FieldManager: "glasskube",
DryRun: []string{metav1.DryRunAll},
DryRun: dryrun,
})
return err
}); err != nil {
Expand Down

0 comments on commit 0f56192

Please sign in to comment.