Skip to content

Commit 841cf8c

Browse files
fix: initialize Secret.Data map if nil to avoid nil map panic (#56)
Signed-off-by: RokibulHasan7 <mdrokibulhasan@appscode.com>
1 parent f592598 commit 841cf8c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/manager/license_acquirer.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ func (r *LicenseAcquirer) reconcile(clusterName, cid string, features []string)
125125
err := r.Get(context.TODO(), client.ObjectKey{Name: sec.Name, Namespace: sec.Namespace}, &sec)
126126
if err == nil {
127127
secretExists = true
128+
if sec.Data == nil {
129+
sec.Data = map[string][]byte{}
130+
}
128131
} else if apierrors.IsNotFound(err) {
129132
sec.Data = map[string][]byte{}
130133
} else {

0 commit comments

Comments
 (0)