Skip to content

Commit b0a4739

Browse files
committed
fix panic in commons if serviceaccount is nil
1 parent 275fece commit b0a4739

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

api/v1alpha1/utils/commons.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,10 @@ func (kc *KubeAuthConfiguration) GetKubeAuthPath() string {
194194
}
195195

196196
func (kc *KubeAuthConfiguration) GetServiceAccountName() string {
197-
return kc.ServiceAccount.Name
197+
if kc.ServiceAccount != nil {
198+
return kc.ServiceAccount.Name
199+
}
200+
return "default"
198201
}
199202

200203
func (kc *KubeAuthConfiguration) getCacheKey(kubeNamespace string) string {

0 commit comments

Comments
 (0)