Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ObservedGeneration to solrcloud status #722

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions api/v1beta1/solrcloud_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1160,6 +1160,9 @@ type SolrCloudStatus struct {
// BackupRepositoriesAvailable lists the backupRepositories specified in the SolrCloud and whether they are available across all Pods.
// +optional
BackupRepositoriesAvailable map[string]bool `json:"backupRepositoriesAvailable,omitempty"`

// ObservedGeneration represents the most recent generation observed for this SolrCloud.
ObservedGeneration int64 `json:"observedGeneration"`
}

// SolrNodeStatus is the status of a solrNode in the cloud, with readiness status
Expand Down
6 changes: 6 additions & 0 deletions config/crd/bases/solr.apache.org_solrclouds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15873,6 +15873,11 @@ spec:
description: InternalCommonAddress is the internal common http address
for all solr nodes
type: string
observedGeneration:
description: ObservedGeneration represents the most recent generation
observed for this SolrCloud.
format: int64
type: integer
podSelector:
description: PodSelector for SolrCloud pods, required by the HPA
type: string
Expand Down Expand Up @@ -16017,6 +16022,7 @@ spec:
type: object
required:
- internalCommonAddress
- observedGeneration
- podSelector
- readyReplicas
- replicas
Expand Down
3 changes: 3 additions & 0 deletions controllers/solrcloud_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ func (r *SolrCloudReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
return reconcile.Result{}, err
}

reconcileGeneration := instance.ObjectMeta.Generation

changed := instance.WithDefaults(logger)
if changed {
logger.Info("Setting default settings for SolrCloud")
Expand Down Expand Up @@ -639,6 +641,7 @@ func (r *SolrCloudReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
}

if !reflect.DeepEqual(instance.Status, newStatus) {
newStatus.ObservedGeneration = reconcileGeneration
logger.Info("Updating SolrCloud Status", "status", newStatus)
oldInstance := instance.DeepCopy()
instance.Status = newStatus
Expand Down
6 changes: 6 additions & 0 deletions helm/solr-operator/crds/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16134,6 +16134,11 @@ spec:
description: InternalCommonAddress is the internal common http address
for all solr nodes
type: string
observedGeneration:
description: ObservedGeneration represents the most recent generation
observed for this SolrCloud.
format: int64
type: integer
podSelector:
description: PodSelector for SolrCloud pods, required by the HPA
type: string
Expand Down Expand Up @@ -16278,6 +16283,7 @@ spec:
type: object
required:
- internalCommonAddress
- observedGeneration
- podSelector
- readyReplicas
- replicas
Expand Down