Skip to content

Commit

Permalink
Remove BlueGreen Steps
Browse files Browse the repository at this point in the history
  • Loading branch information
dthomson25 committed Mar 25, 2019
1 parent 3d40c3f commit f425d7a
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 329 deletions.
20 changes: 0 additions & 20 deletions manifests/crds/rollout-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,26 +65,6 @@ spec:
description: Name of the service that the rollout modifies as
the preview service.
type: string
steps:
description: Steps define the order of steps to execute the
bluegreen deployment
items:
description: BlueGreenStep defines a step of a bluegreen deployment.
properties:
pause:
properties:
duration:
description: Duration the amount of time to wait before
moving to the next step.
format: int32
type: integer
setPreview:
description: SetPreview empty struct to indicate the SetPreview
step
switchActive:
description: SwitchActive empty struct to indicate the
SetActive step
type: array
canary:
description: ReplicaBasedCanaryStrategy defines parameters for a
Replica Based Canary
Expand Down
20 changes: 0 additions & 20 deletions manifests/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,26 +66,6 @@ spec:
description: Name of the service that the rollout modifies as
the preview service.
type: string
steps:
description: Steps define the order of steps to execute the
bluegreen deployment
items:
description: BlueGreenStep defines a step of a bluegreen deployment.
properties:
pause:
properties:
duration:
description: Duration the amount of time to wait before
moving to the next step.
format: int32
type: integer
setPreview:
description: SetPreview empty struct to indicate the SetPreview
step
switchActive:
description: SwitchActive empty struct to indicate the
SetActive step
type: array
canary:
description: ReplicaBasedCanaryStrategy defines parameters for a
Replica Based Canary
Expand Down
20 changes: 0 additions & 20 deletions manifests/namespace-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,26 +66,6 @@ spec:
description: Name of the service that the rollout modifies as
the preview service.
type: string
steps:
description: Steps define the order of steps to execute the
bluegreen deployment
items:
description: BlueGreenStep defines a step of a bluegreen deployment.
properties:
pause:
properties:
duration:
description: Duration the amount of time to wait before
moving to the next step.
format: int32
type: integer
setPreview:
description: SetPreview empty struct to indicate the SetPreview
step
switchActive:
description: SwitchActive empty struct to indicate the
SetActive step
type: array
canary:
description: ReplicaBasedCanaryStrategy defines parameters for a
Replica Based Canary
Expand Down
49 changes: 1 addition & 48 deletions pkg/apis/rollouts/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 0 additions & 14 deletions pkg/apis/rollouts/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ type BlueGreenStrategy struct {
PreviewService string `json:"previewService,omitempty"`
// Steps define the order of steps to execute the bluegreen deployment
// +optional
Steps []BlueGreenStep `json:"steps,omitempty"`
}

// ReplicaBasedCanaryStrategy defines parameters for a Replica Based Canary
Expand Down Expand Up @@ -116,19 +115,6 @@ type CanaryStep struct {
Pause *RolloutPause `json:"pause,omitempty"`
}

// BlueGreenStep defines a step of a bluegreen deployment.
type BlueGreenStep struct {
// SwitchActive switches the new replicaset to the active service
// +optional
SwitchActive *SwitchActive `json:"switchActive,omitempty"`
// SetPreview sets the new replicaset to the preview service
// +optional
SetPreview *SetPreview `json:"setPreview,omitempty"`
// Pause freezes the rollout. If an empty struct is provided, it will freeze until a user sets the spec.Pause to false
// +optional
Pause *RolloutPause `json:"pause,omitempty"`
}

// SetPreview empty struct to indicate the SetPreview step
type SetPreview struct{}

Expand Down
40 changes: 1 addition & 39 deletions pkg/apis/rollouts/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion utils/conditions/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func RolloutComplete(rollout *v1alpha1.Rollout, newStatus *v1alpha1.RolloutStatu
func ComputeStepHash(rollout *v1alpha1.Rollout) string {
rolloutStepHasher := fnv.New32a()
if rollout.Spec.Strategy.BlueGreenStrategy != nil {
hashutil.DeepHashObject(rolloutStepHasher, rollout.Spec.Strategy.BlueGreenStrategy.Steps)
return ""
}
if rollout.Spec.Strategy.CanaryStrategy != nil {
hashutil.DeepHashObject(rolloutStepHasher, rollout.Spec.Strategy.CanaryStrategy.Steps)
Expand Down
22 changes: 2 additions & 20 deletions utils/conditions/conditions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -537,30 +537,12 @@ func TestComputeStepHash(t *testing.T) {
roNoStepsHash := ComputeStepHash(roNoSteps)

roBlueGreen := ro.DeepCopy()
roBlueGreen.Spec.Strategy.BlueGreenStrategy = &v1alpha1.BlueGreenStrategy{
Steps: []v1alpha1.BlueGreenStep{
{
SetPreview: &v1alpha1.SetPreview{},
},
},
}
roBlueGreen.Spec.Strategy.CanaryStrategy = nil
roBlueGreen.Spec.Strategy.BlueGreenStrategy = &v1alpha1.BlueGreenStrategy{}
roBlueGreenHash := ComputeStepHash(roBlueGreen)

roBlueGreen2 := ro.DeepCopy()
roBlueGreen2.Spec.Strategy.BlueGreenStrategy = &v1alpha1.BlueGreenStrategy{
Steps: []v1alpha1.BlueGreenStep{
{
SwitchActive: &v1alpha1.SwitchActive{},
},
},
}
roBlueGreen2.Spec.Strategy.CanaryStrategy = nil
roBlueGreenHash2 := ComputeStepHash(roBlueGreen2)

assert.NotEqual(t, baseline, roWithDiffStepsHash)
assert.Equal(t, baseline, roWithSameStepsHash)
assert.NotEqual(t, baseline, roNoStepsHash)
assert.NotEqual(t, roBlueGreenHash, roNoStepsHash)
assert.NotEqual(t, roBlueGreenHash, roBlueGreenHash2)
assert.Equal(t, "", roBlueGreenHash)
}
47 changes: 0 additions & 47 deletions utils/replicaset/bluegreen.go

This file was deleted.

Loading

0 comments on commit f425d7a

Please sign in to comment.