Skip to content

Commit

Permalink
Merge pull request #259 from fmount/observed_generation
Browse files Browse the repository at this point in the history
Add Status.ObservedGeneration to Manila CR
  • Loading branch information
openshift-merge-bot[bot] authored Mar 27, 2024
2 parents ad5d5fa + 256b9c4 commit 1b212e9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/bases/manila.openstack.org_manilas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,9 @@ spec:
format: int32
type: integer
type: object
observedGeneration:
format: int64
type: integer
transportURLSecret:
type: string
type: object
Expand Down
6 changes: 6 additions & 0 deletions api/v1beta1/manila_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ type ManilaStatus struct {

// ReadyCounts of Manila Share instances
ManilaSharesReadyCounts map[string]int32 `json:"manilaSharesReadyCounts,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
3 changes: 3 additions & 0 deletions config/crd/bases/manila.openstack.org_manilas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,9 @@ spec:
format: int32
type: integer
type: object
observedGeneration:
format: int64
type: integer
transportURLSecret:
type: string
type: object
Expand Down
1 change: 1 addition & 0 deletions controllers/manila_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,7 @@ func (r *ManilaReconciler) reconcileNormal(ctx context.Context, instance *manila

r.Log.Info(fmt.Sprintf("Reconciled Service '%s' successfully", instance.Name))
// update the overall status condition if service is ready
instance.Status.ObservedGeneration = instance.Generation
if instance.IsReady() {
instance.Status.Conditions.MarkTrue(condition.ReadyCondition, condition.ReadyMessage)
}
Expand Down

0 comments on commit 1b212e9

Please sign in to comment.