diff --git a/pipelines/types/istio.go b/pipelines/types/istio.go index dae91f0..b04a884 100644 --- a/pipelines/types/istio.go +++ b/pipelines/types/istio.go @@ -22,10 +22,18 @@ type IstioUpgradeStep struct { StepMeta `json:",inline"` AKSCluster string `json:"aksCluster"` DryRun bool `json:"dryRun,omitempty"` + // "install" installs the new control plane alongside the existing one + // and stops before workload migration. "upgrade" migrates workloads and + // completes the canary. Empty runs the full lifecycle in one step. + Phase string `json:"phase,omitempty"` } func (s *IstioUpgradeStep) Description() string { - return fmt.Sprintf("Step %s\n Kind: %s\n AKSCluster: %s\n DryRun: %v\n", s.Name, s.Action, s.AKSCluster, s.DryRun) + phase := s.Phase + if phase == "" { + phase = "full" + } + return fmt.Sprintf("Step %s\n Kind: %s\n AKSCluster: %s\n DryRun: %v\n Phase: %s\n", s.Name, s.Action, s.AKSCluster, s.DryRun, phase) } func (s *IstioUpgradeStep) RequiredInputs() []StepDependency { diff --git a/pipelines/types/pipeline.schema.v1.json b/pipelines/types/pipeline.schema.v1.json index 9ba2ae0..f2ff4cf 100644 --- a/pipelines/types/pipeline.schema.v1.json +++ b/pipelines/types/pipeline.schema.v1.json @@ -820,6 +820,37 @@ } ] }, + "istioUpgradeStep": { + "unevaluatedProperties": false, + "allOf": [ + { + "$ref": "#/definitions/stepMeta" + }, + { + "properties": { + "action": { + "const": "IstioUpgrade" + }, + "aksCluster": { + "type": "string" + }, + "dryRun": { + "type": "boolean" + }, + "phase": { + "type": "string", + "enum": [ + "install", + "upgrade" + ] + } + }, + "required": [ + "aksCluster" + ] + } + ] + }, "helmStep": { "unevaluatedProperties": false, "allOf": [ @@ -2073,6 +2104,22 @@ "then": { "$ref": "#/definitions/grafanaDatasourcesStep" } + }, + { + "if": { + "type": "object", + "properties": { + "action": { + "const": "IstioUpgrade" + } + }, + "required": [ + "action" + ] + }, + "then": { + "$ref": "#/definitions/istioUpgradeStep" + } } ], "required": [