Skip to content

Commit 9d10bea

Browse files
authored
Ensure "UserLabels" are explicitly initialized
With the changes to the usage of UserLabels, this value was not being properly initialized under certain circumstances (e.g. direct API calls). Issue: [ch10371] Issue: CrunchyData#2262
1 parent c3a5d73 commit 9d10bea

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/apiserver/clusterservice/clusterimpl.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,6 +1079,7 @@ func getClusterParams(request *msgs.CreateClusterRequest, name string, ns string
10791079
Limits: v1.ResourceList{},
10801080
Resources: v1.ResourceList{},
10811081
},
1082+
UserLabels: map[string]string{},
10821083
}
10831084

10841085
// enable the exporter sidecar based on the what the user passed in or what
@@ -1358,7 +1359,9 @@ func getClusterParams(request *msgs.CreateClusterRequest, name string, ns string
13581359

13591360
spec.ServiceType = request.ServiceType
13601361

1361-
spec.UserLabels = request.UserLabels
1362+
if request.UserLabels != nil {
1363+
spec.UserLabels = request.UserLabels
1364+
}
13621365
spec.UserLabels[config.LABEL_PGO_VERSION] = msgs.PGO_VERSION
13631366

13641367
// override any values from config file

0 commit comments

Comments
 (0)