From d5a357c854a5e4df7e3277874bd35cf1550554f9 Mon Sep 17 00:00:00 2001 From: Rob Skillington Date: Fri, 14 Feb 2020 10:27:27 -0500 Subject: [PATCH 1/3] Apply annotations to pods in created StatefulSets --- 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 b7f87c41..485a0099 100644 --- a/pkg/k8sops/m3db/generators_test.go +++ b/pkg/k8sops/m3db/generators_test.go @@ -37,8 +37,8 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" crdutils "github.com/ant31/crd-validation/pkg" - "k8s.io/utils/pointer" "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, From abb10d200419621fb09e0090cdf0ab4b101847ef Mon Sep 17 00:00:00 2001 From: Rob Skillington Date: Fri, 14 Feb 2020 11:34:40 -0500 Subject: [PATCH 2/3] Move import --- pkg/k8sops/m3db/generators_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/k8sops/m3db/generators_test.go b/pkg/k8sops/m3db/generators_test.go index 485a0099..63087832 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) { From 9561d1acd592128e6c4f5278522dfb7971962d7e Mon Sep 17 00:00:00 2001 From: Rob Skillington Date: Fri, 14 Feb 2020 13:27:33 -0500 Subject: [PATCH 3/3] Fix build --- pkg/k8sops/m3db/generators_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/k8sops/m3db/generators_test.go b/pkg/k8sops/m3db/generators_test.go index b29456d6..3f0c2cc4 100644 --- a/pkg/k8sops/m3db/generators_test.go +++ b/pkg/k8sops/m3db/generators_test.go @@ -39,7 +39,6 @@ import ( crdutils "github.com/ant31/crd-validation/pkg" "github.com/stretchr/testify/assert" - "k8s.io/utils/pointer" ) func TestGenerateCRD(t *testing.T) {