Skip to content

Commit a0d52ec

Browse files
committed
change as suggested by Martin
Signed-off-by: Sandor Szücs <sandor.szuecs@zalando.de>
1 parent 1b1153c commit a0d52ec

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

pkg/core/stackset.go

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,11 @@ func (ssc *StackSetContainer) NewStack() (*StackContainer, string) {
8383
spec.RouteGroup = ssc.StackSet.Spec.RouteGroup.DeepCopy()
8484
}
8585

86-
stackAnnotations := make(map[string]string)
87-
if a := ssc.StackSet.Spec.StackTemplate.Annotations; a != nil {
88-
stackAnnotations = a
89-
}
90-
9186
if forwardMigration {
92-
stackAnnotations[forwardBackendAnnotation] = forwardBackendName
93-
}
94-
if len(stackAnnotations) == 0 {
95-
stackAnnotations = nil
87+
if ssc.StackSet.Spec.StackTemplate.Annotations == nil {
88+
ssc.StackSet.Spec.StackTemplate.Annotations = make(map[string]string)
89+
}
90+
ssc.StackSet.Spec.StackTemplate.Annotations[forwardBackendAnnotation] = forwardBackendName
9691
}
9792

9893
return &StackContainer{
@@ -115,7 +110,7 @@ func (ssc *StackSetContainer) NewStack() (*StackContainer, string) {
115110
ssc.StackSet.Labels,
116111
map[string]string{StackVersionLabelKey: stackVersion},
117112
),
118-
Annotations: stackAnnotations,
113+
Annotations: ssc.StackSet.Spec.StackTemplate.Annotations,
119114
},
120115
Spec: *spec,
121116
},

0 commit comments

Comments
 (0)