Skip to content

Commit

Permalink
Put it behind a feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlokshin-czi committed Oct 24, 2023
1 parent 1f37a43 commit 7959221
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions cli/cmd/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions cli/pkg/artifact_builder/artifact_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
9 changes: 5 additions & 4 deletions shared/config/happy_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 7959221

Please sign in to comment.