8000 fix: do not drop existing POD annotations from CHK STS #1469 by jirislav · Pull Request #1470 · Altinity/clickhouse-operator · GitHub
[go: up one dir, main page]

Skip to content
Merged
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
6 changes: 5 additions & 1 deletion pkg/controller/chk/worker-pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,9 @@ import (

func markPodRestartedNow(sts *apps.StatefulSet) {
v, _ := time.Now().UTC().MarshalText()
sts.Spec.Template.Annotations = map[string]string{"kubectl.kubernetes.io/restartedAt": string(v)}
// Instantiate new annotations if they don't exist yet, otherwise append the new annotation
if sts.Spec.Template.Annotations == nil {
sts.Spec.Template.Annotations = make(map[string]string)
}
sts.Spec.Template.Annotations["kubectl.kubernetes.io/restartedAt"] = string(v)
}
0