Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions api/v1alpha1/blueprint_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ type Kustomization struct {

// PostBuild is a post-build step to run after the kustomization is applied.
PostBuild *PostBuild `yaml:"postBuild,omitempty"`

// Destroy determines if the kustomization should be destroyed during down operations.
// Defaults to true if not specified.
Destroy *bool `yaml:"destroy,omitempty"`
}

// PostBuild is a post-build step to run after the kustomization is applied.
Expand Down Expand Up @@ -414,5 +418,6 @@ func (k *Kustomization) DeepCopy() *Kustomization {
Components: slices.Clone(k.Components),
Cleanup: slices.Clone(k.Cleanup),
PostBuild: postBuildCopy,
Destroy: k.Destroy,
}
}
5 changes: 5 additions & 0 deletions cmd/down.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ var (
cleanFlag bool
skipK8sFlag bool
skipTerraformFlag bool
skipDockerFlag bool
)

var downCmd = &cobra.Command{
Expand Down Expand Up @@ -63,6 +64,9 @@ var downCmd = &cobra.Command{
if skipTerraformFlag {
ctx = context.WithValue(ctx, "skipTerraform", true)
}
if skipDockerFlag {
ctx = context.WithValue(ctx, "skipDocker", true)
}

// Execute the down pipeline
if err := downPipeline.Execute(ctx); err != nil {
Expand All @@ -77,5 +81,6 @@ func init() {
downCmd.Flags().BoolVar(&cleanFlag, "clean", false, "Clean up context specific artifacts")
downCmd.Flags().BoolVar(&skipK8sFlag, "skip-k8s", false, "Skip Kubernetes cleanup (blueprint cleanup)")
downCmd.Flags().BoolVar(&skipTerraformFlag, "skip-tf", false, "Skip Terraform cleanup")
downCmd.Flags().BoolVar(&skipDockerFlag, "skip-docker", false, "Skip Docker container cleanup")
rootCmd.AddCommand(downCmd)
}
Loading
Loading