mirror of
https://github.com/projectcapsule/capsule.git
synced 2026-08-25 16:07:24 +00:00
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:
@@ -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"`
|
||||
}
|
||||
|
||||
@@ -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"`
|
||||
|
||||
@@ -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"`
|
||||
|
||||
@@ -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"`
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"`
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user