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
2 changes: 1 addition & 1 deletion pkg/app/piped/executor/kubernetes/rollback.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions pkg/app/piped/executor/kubernetes/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand All @@ -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
}
Expand Down
14 changes: 7 additions & 7 deletions pkg/app/piped/planner/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -104,15 +104,15 @@ 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)
return out, err
}
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
}
}
Expand All @@ -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
}

Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/config/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/deployment_kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down