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); if it's the latest
   version, the condition is mirrored
4. before marking the DeploymentReadyCondition as True in the subCRs,
   the ObservedGeneration is compared with the Generation of the
   Deployment/ Statefulset
5. it updates the functional tests and bumps both lib-common test and
   common modules

Signed-off-by: Francesco Pantano <[email protected]>
  • Loading branch information
fmount committed Apr 25, 2024
1 parent 0bcd2a8 commit 753e929
Show file tree
Hide file tree
Showing 22 changed files with 397 additions and 118 deletions.
8 changes: 8 additions & 0 deletions api/bases/ironic.openstack.org_ironicapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,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 openstack-operator in the top-level CR (e.g. the
ContainerImage)
format: int64
type: integer
readyCount:
description: ReadyCount of ironic API instances
format: int32
Expand Down
8 changes: 8 additions & 0 deletions api/bases/ironic.openstack.org_ironicconductors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,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 openstack-operator in the top-level CR (e.g. the
ContainerImage)
format: int64
type: integer
readyCount:
description: ReadyCount of ironic Conductor instances
format: int32
Expand Down
8 changes: 8 additions & 0 deletions api/bases/ironic.openstack.org_ironicinspectors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,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 openstack-operator in the top-level CR (e.g. the
ContainerImage)
format: int64
type: integer
readyCount:
description: ReadyCount of Ironic Inspector instances
format: int32
Expand Down
8 changes: 8 additions & 0 deletions api/bases/ironic.openstack.org_ironicneutronagents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,14 @@ spec:
type: string
description: Map of hashes to track e.g. job status
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 openstack-operator in the top-level CR (e.g. the
ContainerImage)
format: int64
type: integer
readyCount:
description: ReadyCount of ironic Conductor instances
format: int32
Expand Down
2 changes: 1 addition & 1 deletion api/bases/ironic.openstack.org_ironics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,7 @@ spec:
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
injected by the openstack-operator in the top-level CR (e.g. the
ContainerImage)
format: int64
type: integer
Expand Down
2 changes: 1 addition & 1 deletion api/v1beta1/ironic_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ type IronicStatus struct {
// 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)
// the openstack-operator in the top-level CR (e.g. the ContainerImage)
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}

Expand Down
6 changes: 6 additions & 0 deletions api/v1beta1/ironicapi_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ type IronicAPIStatus 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 openstack-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/ironicconductor_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ type IronicConductorStatus 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 openstack-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/ironicinspector_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,12 @@ type IronicInspectorStatus 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 openstack-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/ironicneutronagent_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ type IronicNeutronAgentStatus struct {

// TransportURLSecret - Secret containing RabbitMQ transportURL
TransportURLSecret string `json:"transportURLSecret,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 openstack-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/ironic.openstack.org_ironicapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,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 openstack-operator in the top-level CR (e.g. the
ContainerImage)
format: int64
type: integer
readyCount:
description: ReadyCount of ironic API instances
format: int32
Expand Down
8 changes: 8 additions & 0 deletions config/crd/bases/ironic.openstack.org_ironicconductors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,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 openstack-operator in the top-level CR (e.g. the
ContainerImage)
format: int64
type: integer
readyCount:
description: ReadyCount of ironic Conductor instances
format: int32
Expand Down
8 changes: 8 additions & 0 deletions config/crd/bases/ironic.openstack.org_ironicinspectors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,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 openstack-operator in the top-level CR (e.g. the
ContainerImage)
format: int64
type: integer
readyCount:
description: ReadyCount of Ironic Inspector instances
format: int32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,14 @@ spec:
type: string
description: Map of hashes to track e.g. job status
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 openstack-operator in the top-level CR (e.g. the
ContainerImage)
format: int64
type: integer
readyCount:
description: ReadyCount of ironic Conductor instances
format: int32
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/ironic.openstack.org_ironics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,7 @@ spec:
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
injected by the openstack-operator in the top-level CR (e.g. the
ContainerImage)
format: int64
type: integer
Expand Down
Loading

0 comments on commit 753e929

Please sign in to comment.