diff --git a/cli/cmd/update.go b/cli/cmd/update.go index fa9c9b0cc0..1256fc3868 100644 --- a/cli/cmd/update.go +++ b/cli/cmd/update.go @@ -127,6 +127,9 @@ func validateStackExists(ctx context.Context, stackName string, happyClient *Hap func updateStack(ctx context.Context, cmd *cobra.Command, stack *stackservice.Stack, forceFlag bool, happyClient *HappyClient) error { stackInfo, err := stack.GetStackInfo(ctx) + if err != nil { + return errors.Wrap(err, "unable to get stack info") + } // 1.) update the workspace's meta variables stackMeta, err := updateStackMeta(ctx, stack.Name, happyClient) diff --git a/cli/pkg/artifact_builder/artifact_builder.go b/cli/pkg/artifact_builder/artifact_builder.go index dc9de23f6d..7363ecda12 100644 --- a/cli/pkg/artifact_builder/artifact_builder.go +++ b/cli/pkg/artifact_builder/artifact_builder.go @@ -381,6 +381,9 @@ func (ab ArtifactBuilder) push(ctx context.Context, tags []string, servicesImage } func (ab ArtifactBuilder) DeleteImages(ctx context.Context, tag string) error { + if !ab.happyConfig.GetData().FeatureFlags.EnableUnusedImageDeletion { + return nil + } defer diagnostics.AddProfilerRuntime(ctx, time.Now(), "DeleteImages") err := ab.validate() if err != nil { diff --git a/shared/config/happy_config.go b/shared/config/happy_config.go index f5c9060656..8445c5882d 100644 --- a/shared/config/happy_config.go +++ b/shared/config/happy_config.go @@ -44,10 +44,11 @@ type EnvironmentContext struct { } type Features struct { - EnableDynamoLocking bool `yaml:"enable_dynamo_locking" json:"enable_dynamo_locking,omitempty"` - EnableHappyApiUsage bool `yaml:"enable_happy_api_usage" json:"enable_happy_api_usage,omitempty"` - EnableECRAutoCreation bool `yaml:"enable_ecr_auto_creation" json:"enable_ecr_auto_creation,omitempty"` - EnableUnifiedConfig bool `yaml:"enable_unified_config" json:"enable_unified_config,omitempty"` + EnableDynamoLocking bool `yaml:"enable_dynamo_locking" json:"enable_dynamo_locking,omitempty"` + EnableHappyApiUsage bool `yaml:"enable_happy_api_usage" json:"enable_happy_api_usage,omitempty"` + EnableECRAutoCreation bool `yaml:"enable_ecr_auto_creation" json:"enable_ecr_auto_creation,omitempty"` + EnableUnifiedConfig bool `yaml:"enable_unified_config" json:"enable_unified_config,omitempty"` + EnableUnusedImageDeletion bool `yaml:"enable_unused_image_deletion" json:"enable_unused_image_deletion,omitempty"` } type HappyApiConfig struct {