feat: add observedgeneration to status object of all crds (#1930)

* feat: add observedgeneration to status object of all crds

Signed-off-by: sandert-k8s <sandert98@gmail.com>

* chore(api): rename rulestatusspec to rulestatusstatus

Signed-off-by: sandert-k8s <sandert98@gmail.com>

---------

Signed-off-by: sandert-k8s <sandert98@gmail.com>
This commit is contained in:
Sander Tervoert
2026-06-01 06:51:46 +02:00
committed by GitHub
parent eaee31765a
commit d255c33f5d
30 changed files with 350 additions and 7 deletions
@@ -9,6 +9,9 @@ import (
// CapsuleConfigurationStatus defines the Capsule configuration status.
type CapsuleConfigurationStatus struct {
// ObservedGeneration is the most recent generation the controller has observed.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// Users which are considered Capsule Users and are bound to the Capsule Tenant construct.
Users rbac.UserListSpec `json:"users,omitempty"`
}
+3
View File
@@ -14,6 +14,9 @@ import (
// CustomQuotaStatus defines the observed state of GlobalResourceQuota.
type CustomQuotaStatus struct {
// ObservedGeneration is the most recent generation the controller has observed.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// Usage measurements
// +optional
Usage CustomQuotaStatusUsage `json:"usage,omitempty"`
+3
View File
@@ -13,6 +13,9 @@ import (
// GlobalResourceQuotaStatus defines the observed state of GlobalResourceQuota.
type ResourcePoolStatus struct {
// ObservedGeneration is the most recent generation the controller has observed.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// How many namespaces are considered
// +kubebuilder:default=0
NamespaceSize uint `json:"namespaceCount,omitempty"`
+3
View File
@@ -21,6 +21,9 @@ type ResourcePoolClaimSpec struct {
// ResourceQuotaClaimStatus defines the observed state of ResourceQuotaClaim.
type ResourcePoolClaimStatus struct {
// ObservedGeneration is the most recent generation the controller has observed.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// Reference to the GlobalQuota being claimed from
// +optional
Pool meta.LocalRFC1123ObjectReferenceWithUID `json:"pool,omitzero"`
+5 -2
View File
@@ -12,7 +12,10 @@ import (
// RuleStatus contains the accumulated rules applying to namespace it's deployed in.
// +kubebuilder:object:generate=true
type RuleStatusSpec struct {
type RuleStatusStatus struct {
// ObservedGeneration is the most recent generation the controller has observed.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// Managed Enforcement properties per Namespace (aggregated from rules)
//+optional
Rule api.NamespaceRuleBodyNamespace `json:"rule,omitzero"`
@@ -34,7 +37,7 @@ type RuleStatus struct {
Spec []*api.NamespaceRuleBodyNamespace `json:"spec,omitzero"`
// +optional
Status RuleStatusSpec `json:"status,omitzero"`
Status RuleStatusStatus `json:"status,omitzero"`
}
// +kubebuilder:object:root=true
+4
View File
@@ -25,6 +25,10 @@ type TenantStatus struct {
// Allowed Cluster Objects within Tenant
TenantAvailableStatus `json:",inline"`
// ObservedGeneration is the most recent generation the controller has observed.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// Collected owners for this tenant
Owners rbac.OwnerStatusListSpec `json:"owners,omitempty"`
// Promoted ServiceAccounts across the Tenant
+5 -1
View File
@@ -22,7 +22,11 @@ type TenantOwnerSpec struct {
}
// TenantOwnerStatus defines the observed state of TenantOwner.
type TenantOwnerStatus struct{}
type TenantOwnerStatus struct {
// ObservedGeneration is the most recent generation the controller has observed.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
+3
View File
@@ -13,6 +13,9 @@ import (
)
type TenantResourceCommonStatus struct {
// ObservedGeneration is the most recent generation the controller has observed.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// Condition of the GlobalTenantResource.
Conditions meta.ConditionList `json:"conditions,omitempty"`
+4 -4
View File
@@ -1626,7 +1626,7 @@ func (in *RuleStatusList) DeepCopyObject() runtime.Object {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RuleStatusSpec) DeepCopyInto(out *RuleStatusSpec) {
func (in *RuleStatusStatus) DeepCopyInto(out *RuleStatusStatus) {
*out = *in
in.Rule.DeepCopyInto(&out.Rule)
if in.Conditions != nil {
@@ -1638,12 +1638,12 @@ func (in *RuleStatusSpec) DeepCopyInto(out *RuleStatusSpec) {
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuleStatusSpec.
func (in *RuleStatusSpec) DeepCopy() *RuleStatusSpec {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuleStatusStatus.
func (in *RuleStatusStatus) DeepCopy() *RuleStatusStatus {
if in == nil {
return nil
}
out := new(RuleStatusSpec)
out := new(RuleStatusStatus)
in.DeepCopyInto(out)
return out
}