diff --git a/pkg/app/piped/executor/kubernetes/rollback.go b/pkg/app/piped/executor/kubernetes/rollback.go index f2c41db48c..778de67ed6 100644 --- a/pkg/app/piped/executor/kubernetes/rollback.go +++ b/pkg/app/piped/executor/kubernetes/rollback.go @@ -42,7 +42,7 @@ func (e *Executor) ensureRollback(ctx context.Context) model.StageStatus { // When addVariantLabelToSelector is true, ensure that all workloads // have the variant label in their selector. - if e.config.Sync.AddVariantLabelToSelector { + if e.config.QuickSync.AddVariantLabelToSelector { workloads := findWorkloadManifests(manifests, e.config.Workloads) for _, m := range workloads { if err := ensureVariantSelectorInWorkload(m, primaryVariant); err != nil { diff --git a/pkg/app/piped/executor/kubernetes/sync.go b/pkg/app/piped/executor/kubernetes/sync.go index c26f6bd849..7bda82e7dd 100644 --- a/pkg/app/piped/executor/kubernetes/sync.go +++ b/pkg/app/piped/executor/kubernetes/sync.go @@ -35,7 +35,7 @@ func (e *Executor) ensureSync(ctx context.Context) model.StageStatus { e.LogPersister.Successf("Successfully loaded %d manifests", len(manifests)) // Check the variant selector in the workloads. - if e.config.Pipeline != nil && !e.config.Sync.AddVariantLabelToSelector { + if e.config.Pipeline != nil && !e.config.QuickSync.AddVariantLabelToSelector { workloads := findWorkloadManifests(manifests, e.config.Workloads) var invalid bool for _, m := range workloads { @@ -55,7 +55,7 @@ func (e *Executor) ensureSync(ctx context.Context) model.StageStatus { // When addVariantLabelToSelector is true, ensure that all workloads // have the variant label in their selector. - if e.config.Sync.AddVariantLabelToSelector { + if e.config.QuickSync.AddVariantLabelToSelector { workloads := findWorkloadManifests(manifests, e.config.Workloads) for _, m := range workloads { if err := ensureVariantSelectorInWorkload(m, primaryVariant); err != nil { @@ -73,7 +73,7 @@ func (e *Executor) ensureSync(ctx context.Context) model.StageStatus { return model.StageStatus_STAGE_FAILURE } - if !e.config.Sync.Prune { + if !e.config.QuickSync.Prune { e.LogPersister.Info("Resource GC was skipped because sync.prune was not configured") return model.StageStatus_STAGE_SUCCESS } diff --git a/pkg/app/piped/planner/kubernetes/kubernetes.go b/pkg/app/piped/planner/kubernetes/kubernetes.go index e6469d501e..ba6186b4eb 100644 --- a/pkg/app/piped/planner/kubernetes/kubernetes.go +++ b/pkg/app/piped/planner/kubernetes/kubernetes.go @@ -85,7 +85,7 @@ func (p *Planner) Plan(ctx context.Context, in planner.Input) (out planner.Outpu // we have only one choise to do is applying all manifestt. if cfg.Pipeline == nil || len(cfg.Pipeline.Stages) == 0 { out.Stages = buildPipeline(cfg.Input.AutoRollback, time.Now()) - out.Summary = "Sync by applying all manifests because no progressive pipeline was configured" + out.Summary = "Quick sync by applying all manifests because no progressive pipeline was configured" return } @@ -104,7 +104,7 @@ func (p *Planner) Plan(ctx context.Context, in planner.Input) (out planner.Outpu } // This deployment is triggered by a commit with the intent to synchronize. - if s := cfg.CommitMatcher.Sync; s != "" { + if s := cfg.CommitMatcher.QuickSync; s != "" { syncRegex, err := in.RegexPool.Get(s) if err != nil { err = fmt.Errorf("failed to compile commitMatcher.sync(%s): %w", s, err) @@ -112,7 +112,7 @@ func (p *Planner) Plan(ctx context.Context, in planner.Input) (out planner.Outpu } if syncRegex.MatchString(in.Deployment.Trigger.Commit.Message) { out.Stages = buildPipeline(cfg.Input.AutoRollback, time.Now()) - out.Summary = fmt.Sprintf("Sync by applying all manifests because the commit message was matching %q", s) + out.Summary = fmt.Sprintf("Quick sync by applying all manifests because the commit message was matching %q", s) return out, err } } @@ -122,7 +122,7 @@ func (p *Planner) Plan(ctx context.Context, in planner.Input) (out planner.Outpu // We just apply all manifests. if in.MostRecentSuccessfulCommitHash == "" { out.Stages = buildPipeline(cfg.Input.AutoRollback, time.Now()) - out.Summary = "Sync by applying all manifests because it seems this is the first deployment" + out.Summary = "Quick sync by applying all manifests because it seems this is the first deployment" return } @@ -163,12 +163,12 @@ func (p *Planner) Plan(ctx context.Context, in planner.Input) (out planner.Outpu func decideStrategy(olds, news []provider.Manifest) (progressive bool, desc string) { oldWorkload, ok := findWorkload(olds) if !ok { - desc = "Sync by applying all manifests because it was unable to find the currently running workloads" + desc = "Quick sync by applying all manifests because it was unable to find the currently running workloads" return } newWorkload, ok := findWorkload(news) if !ok { - desc = "Sync by applying all manifests because it was unable to find workloads in the new manifests" + desc = "Quick sync by applying all manifests because it was unable to find workloads in the new manifests" return } @@ -221,7 +221,7 @@ func decideStrategy(olds, news []provider.Manifest) (progressive bool, desc stri return } - desc = "Sync by applying all manifests" + desc = "Quick sync by applying all manifests" return } diff --git a/pkg/config/deployment.go b/pkg/config/deployment.go index 833dd49687..453199abc2 100644 --- a/pkg/config/deployment.go +++ b/pkg/config/deployment.go @@ -28,7 +28,7 @@ type Pipelineable interface { // DeploymentCommitMatcher provides a way to decide how to deploy. type DeploymentCommitMatcher struct { // It makes sure to perform syncing if the commit message matches this regular expression. - Sync string `json:"sync"` + QuickSync string `json:"quickSync"` // It makes sure to perform pipeline if the commit message matches this regular expression. Pipeline string `json:"pipeline"` } diff --git a/pkg/config/deployment_kubernetes.go b/pkg/config/deployment_kubernetes.go index 3dddd0e999..17048b68d1 100644 --- a/pkg/config/deployment_kubernetes.go +++ b/pkg/config/deployment_kubernetes.go @@ -18,7 +18,7 @@ package config type KubernetesDeploymentSpec struct { Input KubernetesDeploymentInput `json:"input"` CommitMatcher DeploymentCommitMatcher `json:"commitMatcher"` - Sync K8sSyncStageOptions `json:"sync"` + QuickSync K8sSyncStageOptions `json:"quickSync"` Pipeline *DeploymentPipeline `json:"pipeline"` // Which resource should be considered as the Service of application.