Skip to content

Commit 036fd95

Browse files
PeterFoldbergpfo-netic
authored andcommitted
add support for annotations on dashboard deployment
Signed-off-by: Peter Foldberg <[email protected]>
1 parent e5103bf commit 036fd95

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

opensearch-operator/pkg/builders/dashboards.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ func NewDashboardsDeploymentForCR(cr *opsterv1.OpenSearchCluster, volumes []core
127127
Name: cr.Name + "-dashboards",
128128
Namespace: cr.Namespace,
129129
Labels: labels,
130+
Annotations: annotations,
130131
},
131132
Spec: appsv1.DeploymentSpec{
132133
Replicas: &replicas,

opensearch-operator/pkg/builders/dashboards_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313

1414
var _ = Describe("Builders", func() {
1515
When("building the dashboards deployment with annotations supplied", func() {
16-
It("should populate the dashboard pod spec with annotations provided", func() {
16+
It("should populate the dashboard pod and deployment spec with annotations provided", func() {
1717
clusterName := "dashboards-add-annotations"
1818
spec := opsterv1.OpenSearchCluster{
1919
ObjectMeta: metav1.ObjectMeta{Name: clusterName, Namespace: clusterName, UID: "dummyuid"},
@@ -33,6 +33,10 @@ var _ = Describe("Builders", func() {
3333
"testAnnotationKey": "testValue",
3434
"testAnnotationKey2": "testValue2",
3535
}))
36+
Expect(result.ObjectMeta.Annotations).To(Equal(map[string]string{
37+
"testAnnotationKey": "testValue",
38+
"testAnnotationKey2": "testValue2",
39+
}))
3640
})
3741
})
3842

0 commit comments

Comments
 (0)