From 23428d768f4491b7a473f23e0b7a52937bd91d7c Mon Sep 17 00:00:00 2001 From: Rob Skillington Date: Fri, 14 Feb 2020 15:45:06 -0500 Subject: [PATCH] Apply annotations to pods in created StatefulSets (#196) --- pkg/k8sops/m3db/generators_test.go | 5 +++-- pkg/k8sops/m3db/statefulset.go | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/k8sops/m3db/generators_test.go b/pkg/k8sops/m3db/generators_test.go index b523c7a3..3f0c2cc4 100644 --- a/pkg/k8sops/m3db/generators_test.go +++ b/pkg/k8sops/m3db/generators_test.go @@ -35,10 +35,10 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/intstr" + "k8s.io/utils/pointer" crdutils "github.com/ant31/crd-validation/pkg" "github.com/stretchr/testify/assert" - "k8s.io/utils/pointer" ) func TestGenerateCRD(t *testing.T) { @@ -139,7 +139,8 @@ func TestGenerateStatefulSet(t *testing.T) { Replicas: instanceAmount, Template: v1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ - Labels: labels, + Labels: labels, + Annotations: annotations.BaseAnnotations(fixture), }, Spec: v1.PodSpec{ PriorityClassName: "m3db-priority", diff --git a/pkg/k8sops/m3db/statefulset.go b/pkg/k8sops/m3db/statefulset.go index da182b01..d58f5afe 100644 --- a/pkg/k8sops/m3db/statefulset.go +++ b/pkg/k8sops/m3db/statefulset.go @@ -118,7 +118,8 @@ func NewBaseStatefulSet(ssName, isolationGroup string, cluster *myspec.M3DBClust Replicas: &ic, Template: v1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ - Labels: objLabels, + Labels: objLabels, + Annotations: objAnnotations, }, Spec: v1.PodSpec{ PriorityClassName: cluster.Spec.PriorityClassName,