Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
a65e5b64
Commit
a65e5b64
authored
Jul 21, 2021
by
galal-hussein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix multiple bootstrap keys found
Signed-off-by:
galal-hussein
<
hussein.galal.ahmed.11@gmail.com
>
parent
37fcb61f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
storage.go
pkg/cluster/storage.go
+3
-2
No files found.
pkg/cluster/storage.go
View file @
a65e5b64
...
@@ -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"
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment