mirror of https://github.com/k3s-io/k3s.git
Fix multiple bootstrap keys found
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>pull/3688/head
parent
37fcb61f5e
commit
a65e5b6466
|
@ -132,9 +132,9 @@ func (c *Cluster) getBootstrapKeyFromStorage(ctx context.Context, storageClient
|
|||
return nil, false, nil
|
||||
}
|
||||
if len(bootstrapList) > 1 {
|
||||
return nil, false, errors.New("found multiple bootstrap keys in storage")
|
||||
logrus.Warn("found multiple bootstrap keys in storage")
|
||||
}
|
||||
bootstrapKV := bootstrapList[0]
|
||||
for _, bootstrapKV := range bootstrapList {
|
||||
// checking for empty string bootstrap key
|
||||
switch string(bootstrapKV.Key) {
|
||||
case emptyStringKey:
|
||||
|
@ -147,6 +147,7 @@ func (c *Cluster) getBootstrapKeyFromStorage(ctx context.Context, storageClient
|
|||
case tokenKey:
|
||||
return &bootstrapKV, false, nil
|
||||
}
|
||||
}
|
||||
|
||||
return nil, false, errors.New("bootstrap data already found and encrypted with different token")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue