Skip to content

Commit 3647300

Browse files
committed
Remove outdated code
This piece of code is meant to preserve cert hash annotation in the pod template. We currently do not use cert hash annotation on the pod: we only use sts level annotations.
1 parent b90c986 commit 3647300

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

pkg/statefulset/statefulset_util.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import (
1919
apiEquality "k8s.io/apimachinery/pkg/api/equality"
2020
apiErrors "k8s.io/apimachinery/pkg/api/errors"
2121

22-
"github.com/mongodb/mongodb-kubernetes/controllers/operator/certs"
2322
"github.com/mongodb/mongodb-kubernetes/controllers/operator/inspect"
2423
"github.com/mongodb/mongodb-kubernetes/controllers/operator/workflow"
2524
kubernetesClient "github.com/mongodb/mongodb-kubernetes/mongodb-community-operator/pkg/kube/client"
@@ -121,14 +120,6 @@ func CreateOrUpdateStatefulset(ctx context.Context, getUpdateCreator kubernetesC
121120
log.Debug("Created StatefulSet")
122121
return statefulSetToCreate, nil
123122
}
124-
// preserve existing certificate hash if new one is not statefulSetToCreate
125-
existingCertHash, okExisting := existingStatefulSet.Spec.Template.Annotations[certs.CertHashAnnotationKey]
126-
if newCertHash, okNew := statefulSetToCreate.Spec.Template.Annotations[certs.CertHashAnnotationKey]; existingCertHash != "" && newCertHash == "" && okExisting && okNew {
127-
if statefulSetToCreate.Spec.Template.Annotations == nil {
128-
statefulSetToCreate.Spec.Template.Annotations = map[string]string{}
129-
}
130-
statefulSetToCreate.Spec.Template.Annotations[certs.CertHashAnnotationKey] = existingCertHash
131-
}
132123

133124
// there already exists a pvc size annotation, that means we did resize at least once
134125
// we need to make sure to keep the annotation.

0 commit comments

Comments
 (0)