Skip to content

feat: add observedgeneration to all crds#1041

Draft
sandert-k8s wants to merge 2 commits into
projectcapsule:mainfrom
sandert-k8s:add-observedgeneration
Draft

feat: add observedgeneration to all crds#1041
sandert-k8s wants to merge 2 commits into
projectcapsule:mainfrom
sandert-k8s:add-observedgeneration

Conversation

@sandert-k8s
Copy link
Copy Markdown
Contributor

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.

Copilot AI review requested due to automatic review settings May 29, 2026 12:08
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 observedGeneration is 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.

Comment thread internal/controllers/proxy_setting.go Outdated
Comment thread internal/controllers/global_proxy_settings.go Outdated
Comment thread e2e/global_settings_test.go Outdated
@sandert-k8s sandert-k8s force-pushed the add-observedgeneration branch from 1eed092 to f4f75c5 Compare May 29, 2026 12:12
Signed-off-by: sandert-k8s <sandert98@gmail.com>
@sandert-k8s sandert-k8s force-pushed the add-observedgeneration branch from f4f75c5 to f1c3308 Compare May 29, 2026 12:24
Signed-off-by: sandert-k8s <sandert98@gmail.com>
@sandert-k8s sandert-k8s marked this pull request as draft May 29, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants