Skip to content

Commit

Permalink
Add Status.ObservedGeneration to Nova CR
Browse files Browse the repository at this point in the history
Jira: OSPRH-5919
  • Loading branch information
dprince authored and openshift-merge-bot[bot] committed Apr 2, 2024
1 parent 6274ce7 commit 1559023
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api/bases/nova.openstack.org_nova.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1727,6 +1727,12 @@ spec:
from nova-metadata service
format: int32
type: integer
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.
format: int64
type: integer
registeredCells:
additionalProperties:
type: string
Expand Down
3 changes: 3 additions & 0 deletions api/v1beta1/nova_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ type NovaStatus struct {
// DiscoveredCells is a map keyed by cell names that have discovered all kubernetes managed
// computes in cell value is a hash of config from all kubernetes managed computes in cell
DiscoveredCells map[string]string `json:"discoveredCells,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.
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}

//+kubebuilder:object:root=true
Expand Down
6 changes: 6 additions & 0 deletions config/crd/bases/nova.openstack.org_nova.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1727,6 +1727,12 @@ spec:
from nova-metadata service
format: int32
type: integer
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.
format: int64
type: integer
registeredCells:
additionalProperties:
type: string
Expand Down
1 change: 1 addition & 0 deletions controllers/nova_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@ func (r *NovaReconciler) Reconcile(ctx context.Context, req ctrl.Request) (resul
}

Log.Info("Successfully reconciled")
instance.Status.ObservedGeneration = instance.Generation
return ctrl.Result{}, nil
}

Expand Down

0 comments on commit 1559023

Please sign in to comment.