mirror of
https://github.com/fluxcd/flagger.git
synced 2026-04-15 06:57:34 +00:00
Initialize the label and annotation maps if they are nil
This commit is contained in:
committed by
stefanprodan
parent
9d907deece
commit
5c48430ed2
@@ -113,6 +113,13 @@ func (c *KubernetesDefaultRouter) reconcileService(canary *flaggerv1.Canary, nam
|
||||
svcSpec.Ports = append(svcSpec.Ports, cp)
|
||||
}
|
||||
|
||||
if metadata.Labels == nil {
|
||||
metadata.Labels = make(map[string]string)
|
||||
}
|
||||
if metadata.Annotations == nil {
|
||||
metadata.Annotations = make(map[string]string)
|
||||
}
|
||||
|
||||
metadata.Labels[c.labelSelector] = name
|
||||
for k, v := range c.annotations {
|
||||
metadata.Annotations[k] = v
|
||||
|
||||
Reference in New Issue
Block a user