Commit a65e5b64 authored by galal-hussein's avatar galal-hussein

Fix multiple bootstrap keys found

parent 37fcb61f
...@@ -132,9 +132,9 @@ func (c *Cluster) getBootstrapKeyFromStorage(ctx context.Context, storageClient ...@@ -132,9 +132,9 @@ func (c *Cluster) getBootstrapKeyFromStorage(ctx context.Context, storageClient
return nil, false, nil return nil, false, nil
} }
if len(bootstrapList) > 1 { 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 // checking for empty string bootstrap key
switch string(bootstrapKV.Key) { switch string(bootstrapKV.Key) {
case emptyStringKey: case emptyStringKey:
...@@ -147,6 +147,7 @@ func (c *Cluster) getBootstrapKeyFromStorage(ctx context.Context, storageClient ...@@ -147,6 +147,7 @@ func (c *Cluster) getBootstrapKeyFromStorage(ctx context.Context, storageClient
case tokenKey: case tokenKey:
return &bootstrapKV, false, nil return &bootstrapKV, false, nil
} }
}
return nil, false, errors.New("bootstrap data already found and encrypted with different token") return nil, false, errors.New("bootstrap data already found and encrypted with different token")
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment