Skip to content

Commit

Permalink
Add ObservedGeneration to the sub Resources
Browse files Browse the repository at this point in the history
This patch does a few things:
1. it adds observedGeneration to the sub custom resources
2. it proposes to bump the observedGeneration at the beginning of the
   reconciliation loop (knative/serving#4937)
3. it checks, at the top level, if the ObservedGeneration matches with
   the metadata.generation assigned to the subCR(s)
4. before marking the DeploymentReadyCondition as True, the
   ObservedGeneration is compared with the Generation of the Deployment

Signed-off-by: Francesco Pantano <[email protected]>
  • Loading branch information
fmount committed Apr 16, 2024
1 parent 29d27af commit 844d97a
Show file tree
Hide file tree
Showing 29 changed files with 684 additions and 240 deletions.
8 changes: 8 additions & 0 deletions api/bases/designate.openstack.org_designateapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,14 @@ spec:
type: array
description: NetworkAttachments status of the deployment pods
type: object
observedGeneration:
description: ObservedGeneration - the most recent generation observed
for this service. If the observed generation is less than the spec
generation, then the controller has not processed the latest changes
injected by the opentack-operator in the top-level CR (e.g. the
ContainerImage)
format: int64
type: integer
readyCount:
description: ReadyCount of designate API instances
format: int32
Expand Down
8 changes: 8 additions & 0 deletions api/bases/designate.openstack.org_designatebackendbind9s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,14 @@ spec:
type: array
description: NetworkAttachments status of the deployment pods
type: object
observedGeneration:
description: ObservedGeneration - the most recent generation observed
for this service. If the observed generation is less than the spec
generation, then the controller has not processed the latest changes
injected by the opentack-operator in the top-level CR (e.g. the
ContainerImage)
format: int64
type: integer
readyCount:
description: ReadyCount of designate backendbind9 instances
format: int32
Expand Down
8 changes: 8 additions & 0 deletions api/bases/designate.openstack.org_designatecentrals.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,14 @@ spec:
type: array
description: NetworkAttachments status of the deployment pods
type: object
observedGeneration:
description: ObservedGeneration - the most recent generation observed
for this service. If the observed generation is less than the spec
generation, then the controller has not processed the latest changes
injected by the opentack-operator in the top-level CR (e.g. the
ContainerImage)
format: int64
type: integer
readyCount:
description: ReadyCount of designate central instances
format: int32
Expand Down
8 changes: 8 additions & 0 deletions api/bases/designate.openstack.org_designatemdnses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,14 @@ spec:
type: array
description: NetworkAttachments status of the deployment pods
type: object
observedGeneration:
description: ObservedGeneration - the most recent generation observed
for this service. If the observed generation is less than the spec
generation, then the controller has not processed the latest changes
injected by the opentack-operator in the top-level CR (e.g. the
ContainerImage)
format: int64
type: integer
readyCount:
description: ReadyCount of designate MDNS instances
format: int32
Expand Down
8 changes: 8 additions & 0 deletions api/bases/designate.openstack.org_designateproducers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,14 @@ spec:
type: array
description: NetworkAttachments status of the deployment pods
type: object
observedGeneration:
description: ObservedGeneration - the most recent generation observed
for this service. If the observed generation is less than the spec
generation, then the controller has not processed the latest changes
injected by the opentack-operator in the top-level CR (e.g. the
ContainerImage)
format: int64
type: integer
readyCount:
description: ReadyCount of designate Producer instances
format: int32
Expand Down
8 changes: 8 additions & 0 deletions api/bases/designate.openstack.org_designateunbounds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,14 @@ spec:
type: array
description: NetworkAttachments status of the deployment pods
type: object
observedGeneration:
description: ObservedGeneration - the most recent generation observed
for this service. If the observed generation is less than the spec
generation, then the controller has not processed the latest changes
injected by the opentack-operator in the top-level CR (e.g. the
ContainerImage)
format: int64
type: integer
readyCount:
description: ReadyCount of designate central instances
format: int32
Expand Down
8 changes: 8 additions & 0 deletions api/bases/designate.openstack.org_designateworkers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,14 @@ spec:
type: array
description: NetworkAttachments status of the deployment pods
type: object
observedGeneration:
description: ObservedGeneration - the most recent generation observed
for this service. If the observed generation is less than the spec
generation, then the controller has not processed the latest changes
injected by the opentack-operator in the top-level CR (e.g. the
ContainerImage)
format: int64
type: integer
readyCount:
description: ReadyCount of designate central instances
format: int32
Expand Down
6 changes: 6 additions & 0 deletions api/v1beta1/designateapi_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ type DesignateAPIStatus struct {

// NetworkAttachments status of the deployment pods
NetworkAttachments map[string][]string `json:"networkAttachments,omitempty"`

// ObservedGeneration - the most recent generation observed for this
// service. If the observed generation is less than the spec generation,
// then the controller has not processed the latest changes injected by
// the opentack-operator in the top-level CR (e.g. the ContainerImage)
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down
6 changes: 6 additions & 0 deletions api/v1beta1/designatebackendbind9_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ type DesignateBackendbind9Status struct {

// NetworkAttachments status of the deployment pods
NetworkAttachments map[string][]string `json:"networkAttachments,omitempty"`

// ObservedGeneration - the most recent generation observed for this
// service. If the observed generation is less than the spec generation,
// then the controller has not processed the latest changes injected by
// the opentack-operator in the top-level CR (e.g. the ContainerImage)
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}

//+kubebuilder:object:root=true
Expand Down
6 changes: 6 additions & 0 deletions api/v1beta1/designatecentral_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ type DesignateCentralStatus struct {

// NetworkAttachments status of the deployment pods
NetworkAttachments map[string][]string `json:"networkAttachments,omitempty"`

// ObservedGeneration - the most recent generation observed for this
// service. If the observed generation is less than the spec generation,
// then the controller has not processed the latest changes injected by
// the opentack-operator in the top-level CR (e.g. the ContainerImage)
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}

//+kubebuilder:object:root=true
Expand Down
6 changes: 6 additions & 0 deletions api/v1beta1/designatemdns_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ type DesignateMdnsStatus struct {

// NetworkAttachments status of the deployment pods
NetworkAttachments map[string][]string `json:"networkAttachments,omitempty"`

// ObservedGeneration - the most recent generation observed for this
// service. If the observed generation is less than the spec generation,
// then the controller has not processed the latest changes injected by
// the opentack-operator in the top-level CR (e.g. the ContainerImage)
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}

//+kubebuilder:object:root=true
Expand Down
6 changes: 6 additions & 0 deletions api/v1beta1/designateproducer_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ type DesignateProducerStatus struct {

// NetworkAttachments status of the deployment pods
NetworkAttachments map[string][]string `json:"networkAttachments,omitempty"`

// ObservedGeneration - the most recent generation observed for this
// service. If the observed generation is less than the spec generation,
// then the controller has not processed the latest changes injected by
// the opentack-operator in the top-level CR (e.g. the ContainerImage)
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down
6 changes: 6 additions & 0 deletions api/v1beta1/designateunbound_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ type DesignateUnboundStatus struct {

// NetworkAttachments status of the deployment pods
NetworkAttachments map[string][]string `json:"networkAttachments,omitempty"`

// ObservedGeneration - the most recent generation observed for this
// service. If the observed generation is less than the spec generation,
// then the controller has not processed the latest changes injected by
// the opentack-operator in the top-level CR (e.g. the ContainerImage)
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down
6 changes: 6 additions & 0 deletions api/v1beta1/designateworker_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ type DesignateWorkerStatus struct {

// NetworkAttachments status of the deployment pods
NetworkAttachments map[string][]string `json:"networkAttachments,omitempty"`

// ObservedGeneration - the most recent generation observed for this
// service. If the observed generation is less than the spec generation,
// then the controller has not processed the latest changes injected by
// the opentack-operator in the top-level CR (e.g. the ContainerImage)
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down
8 changes: 8 additions & 0 deletions config/crd/bases/designate.openstack.org_designateapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,14 @@ spec:
type: array
description: NetworkAttachments status of the deployment pods
type: object
observedGeneration:
description: ObservedGeneration - the most recent generation observed
for this service. If the observed generation is less than the spec
generation, then the controller has not processed the latest changes
injected by the opentack-operator in the top-level CR (e.g. the
ContainerImage)
format: int64
type: integer
readyCount:
description: ReadyCount of designate API instances
format: int32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,14 @@ spec:
type: array
description: NetworkAttachments status of the deployment pods
type: object
observedGeneration:
description: ObservedGeneration - the most recent generation observed
for this service. If the observed generation is less than the spec
generation, then the controller has not processed the latest changes
injected by the opentack-operator in the top-level CR (e.g. the
ContainerImage)
format: int64
type: integer
readyCount:
description: ReadyCount of designate backendbind9 instances
format: int32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,14 @@ spec:
type: array
description: NetworkAttachments status of the deployment pods
type: object
observedGeneration:
description: ObservedGeneration - the most recent generation observed
for this service. If the observed generation is less than the spec
generation, then the controller has not processed the latest changes
injected by the opentack-operator in the top-level CR (e.g. the
ContainerImage)
format: int64
type: integer
readyCount:
description: ReadyCount of designate central instances
format: int32
Expand Down
8 changes: 8 additions & 0 deletions config/crd/bases/designate.openstack.org_designatemdnses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,14 @@ spec:
type: array
description: NetworkAttachments status of the deployment pods
type: object
observedGeneration:
description: ObservedGeneration - the most recent generation observed
for this service. If the observed generation is less than the spec
generation, then the controller has not processed the latest changes
injected by the opentack-operator in the top-level CR (e.g. the
ContainerImage)
format: int64
type: integer
readyCount:
description: ReadyCount of designate MDNS instances
format: int32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,14 @@ spec:
type: array
description: NetworkAttachments status of the deployment pods
type: object
observedGeneration:
description: ObservedGeneration - the most recent generation observed
for this service. If the observed generation is less than the spec
generation, then the controller has not processed the latest changes
injected by the opentack-operator in the top-level CR (e.g. the
ContainerImage)
format: int64
type: integer
readyCount:
description: ReadyCount of designate Producer instances
format: int32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,14 @@ spec:
type: array
description: NetworkAttachments status of the deployment pods
type: object
observedGeneration:
description: ObservedGeneration - the most recent generation observed
for this service. If the observed generation is less than the spec
generation, then the controller has not processed the latest changes
injected by the opentack-operator in the top-level CR (e.g. the
ContainerImage)
format: int64
type: integer
readyCount:
description: ReadyCount of designate central instances
format: int32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,14 @@ spec:
type: array
description: NetworkAttachments status of the deployment pods
type: object
observedGeneration:
description: ObservedGeneration - the most recent generation observed
for this service. If the observed generation is less than the spec
generation, then the controller has not processed the latest changes
injected by the opentack-operator in the top-level CR (e.g. the
ContainerImage)
format: int64
type: integer
readyCount:
description: ReadyCount of designate central instances
format: int32
Expand Down
Loading

0 comments on commit 844d97a

Please sign in to comment.