fix contour httproxy annotations overwrite

Signed-off-by: brandoncate <brandon.cate@shipt.com>
This commit is contained in:
brandoncate
2022-06-17 10:02:02 -05:00
parent 560f884cc0
commit 0cecab530f
+3 -2
View File
@@ -188,9 +188,10 @@ func (cr *ContourRouter) Reconcile(canary *flaggerv1.Canary) error {
}
if cr.ingressClass != "" {
proxy.Annotations = map[string]string{
annotation: cr.ingressClass,
if proxy.Annotations == nil {
proxy.Annotations = make(map[string]string)
}
proxy.Annotations[annotation] = cr.ingressClass
}
_, err = cr.contourClient.ProjectcontourV1().HTTPProxies(canary.Namespace).Create(context.TODO(), proxy, metav1.CreateOptions{})