Skip to content

Commit

Permalink
Use metav1.SetMetadataAnnotation instead of secret.Annotations[] to s…
Browse files Browse the repository at this point in the history
…et a value to prevent nil reference
  • Loading branch information
burmanm committed Sep 17, 2024
1 parent 7e644ae commit 346a06e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Changelog for Cass Operator, new PRs should update the `main / unreleased` secti
## unreleased

* [FEATURE] [#651](https://github.com/k8ssandra/cass-operator/issues/651) Add tsreload task for DSE deployments and ability to check if sync operation is available on the mgmt-api side
* [BUGFIX] [#705](https://github.com/k8ssandra/cass-operator/issues/705) Ensure ConfigSecret has annotations map before trying to set a value

## v1.22.2

Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciliation/reconcile_configsecret.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (rc *ReconciliationContext) checkDatacenterNameAnnotation(secret *corev1.Se
}

patch := client.MergeFrom(secret.DeepCopy())
secret.Annotations[api.DatacenterAnnotation] = rc.Datacenter.Name
metav1.SetMetaDataAnnotation(&secret.ObjectMeta, api.DatacenterAnnotation, rc.Datacenter.Name)
return rc.Client.Patch(rc.Ctx, secret, patch)
}

Expand Down

0 comments on commit 346a06e

Please sign in to comment.