feat: add observedgeneration to all crds#1041
Draft
sandert-k8s wants to merge 2 commits into
Draft
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR adds status.observedGeneration tracking for GlobalProxySettings and ProxySetting, including controllers to keep the field updated and new/updated e2e tests to validate the behavior.
Changes:
- Add status types + kubebuilder status subresource markers for both CRDs.
- Introduce two lightweight reconcilers that update
status.observedGeneration. - Add e2e coverage verifying
observedGenerationis set and updated after spec changes.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| main.go | Registers new observedGeneration controllers with the manager. |
| internal/modules/priorityclass/utils.go | Removes a //nolint:staticcheck directive near regex compilation. |
| internal/controllers/proxy_setting.go | New controller to update ProxySetting.status.observedGeneration. |
| internal/controllers/global_proxy_settings.go | New controller to update GlobalProxySettings.status.observedGeneration. |
| e2e/observed_generation_test.go | New e2e suite covering observedGeneration behavior for both resources. |
| e2e/global_settings_test.go | Extends existing e2e test to assert observedGeneration is set. |
| charts/capsule-proxy/crds/capsule.clastix.io_proxysettings.yaml | Adds status schema + enables /status subresource. |
| charts/capsule-proxy/crds/capsule.clastix.io_globalproxysettings.yaml | Adds status schema (but currently missing /status subresource). |
| api/v1beta1/proxysettings_types.go | Adds ProxySettingStatus + status field and status subresource marker. |
| api/v1beta1/globalproxysettings_types.go | Adds GlobalProxySettingsStatus + status field. |
Files not reviewed (1)
- api/v1beta1/zz_generated.deepcopy.go: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1eed092 to
f4f75c5
Compare
Signed-off-by: sandert-k8s <sandert98@gmail.com>
f4f75c5 to
f1c3308
Compare
Signed-off-by: sandert-k8s <sandert98@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pre work for projectcapsule/capsule#1924
Add observedGeneration to the status of all objects. ArgoCD best practices is to check observedGeneration vs Generation in a spec. If that differs, the application will report "Progressing".
Also added controllers for (global)ProxySettings, since they didn't have them yet.