Skip to content

Commit 570bd3e

Browse files
authored
fix: Initialize labels and annotations map if not existent yet
2 parents 95261a4 + 0ef614e commit 570bd3e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/argo_connector.go

+8
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,14 @@ func (connector *ArgoConnector) StoreClusterI(userCluster UserCluster, project K
142142
} else {
143143
secret.Data = TransformStringStringMapValuesToByteArray(data)
144144

145+
if secret.Labels == nil {
146+
secret.Labels = map[string]string{}
147+
}
148+
149+
if secret.Annotations == nil {
150+
secret.Annotations = map[string]string{}
151+
}
152+
145153
for key, value := range labels {
146154
secret.Labels[key] = value
147155
}

0 commit comments

Comments
 (0)