feat: add new field RolloutStrategy control automatic rollout#202
feat: add new field RolloutStrategy control automatic rollout#202
Conversation
| description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' | ||
| type: object | ||
| type: object | ||
| rolloutStrategy: |
There was a problem hiding this comment.
This is generated from the source code comments: authproxyworkload_types.go
| description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' | ||
| type: object | ||
| type: object | ||
| rolloutStrategy: |
There was a problem hiding this comment.
This is generated from the source code comments: authproxyworkload_types.go
enocom
left a comment
There was a problem hiding this comment.
There's no e2e test here because the cluster is defaulting to "Workload" and so we can't test None?
| func (r *AuthProxyWorkload) Default() { | ||
| authproxyworkloadlog.Info("default", "name", r.Name) | ||
| // TODO(user): fill in your defaulting logic. | ||
| if r.Spec.AuthProxyContainer != nil { |
| } | ||
|
|
||
| // The user has set "None" as the rollout strategy. Ignore it. | ||
| if resource.Spec.AuthProxyContainer != nil && |
There was a problem hiding this comment.
This check is pretty simple, but since we're repeating it and it's a pretty important check, should we pull it out into a re-used function?
| t.Fatal(err) | ||
| } | ||
|
|
||
| // Fetch the deployment and make sure the annotations show the |
There was a problem hiding this comment.
This means the annotations are gone, but we haven't rolled it out, yeah?
There was a problem hiding this comment.
This demonstrates the intended behavior. When RolloutStrategy== "None", then Reconcile() will not modify the Deployment's annotations.
|
Regarding E2E tests: In my judgement, an E2E test case doesn't add a lot of additional quality assurance above the unit test, and it introduces another source of flakey test errors. I'm inclined to skip the e2e test. For me, the unit test that shows that the Reconcile() will not modify a deployment when RolloutStrategy == "None" is enough. |
| Labels: map[string]string{labelK: labelV}, | ||
| }, | ||
| Spec: appsv1.DeploymentSpec{Template: corev1.PodTemplateSpec{ | ||
| ObjectMeta: metav1.ObjectMeta{Annotations: map[string]string{}}, |
There was a problem hiding this comment.
Can we add some annotations here to just show that they're still there down below?
Features - Add new field RolloutStrategy control automatic rollout (#202) (090b88d) - Add new terraform project for e2e test resources (#181) (0140592) - Add script to run terraform with input validation. (#182) (857444a) - Add support for Unix sockets. (#205) (8177a35), closes #47 - Add telemetry settings to configure health check port (#210) (3ede42d) - Add the e2e test job for Cloud Build (#184) (dc2990c) - Automatic changes to workloads when an AuthProxyWorload is deleted (#200) (e11caed) - Automatically trigger pod rollout for appsv1 resources when AuthProxyWorkload changes. (#197) (3b0359b) - Separate terraform for project setup and permissions (#179) (8f43657) - Validate AuthProxyWorkload spec.selector field (#209) (98c460b) - Validate AuthProxyWorkload updates to prevent changes to the workload selector. (#211) (4304283) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Release PR Generate Bot action release-please[bot] <release-please[bot]@users.noreply.github.com>
Adds a new field
RolloutStrategyto the AuthProxyWorkload that will allow users to control howthe operator will roll out changes when an AuthProxyWorkload is updated.
RolloutStrategyhas two possible values:Workloadin which the operator will automatically follow the behavior of the Strategy set on the workload.Nonein which the operator will not attempt to roll out changes