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
0a1f013f
Commit
0a1f013f
authored
Jan 06, 2022
by
Brad Davidson
Committed by
Brad Davidson
Jan 07, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix handling of agent-token fallback to token
Signed-off-by:
Brad Davidson
<
brad.davidson@rancher.com
>
parent
4decce56
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
bootstrap.go
pkg/cluster/bootstrap.go
+8
-4
No files found.
pkg/cluster/bootstrap.go
View file @
0a1f013f
...
@@ -4,7 +4,6 @@ import (
...
@@ -4,7 +4,6 @@ import (
"bytes"
"bytes"
"context"
"context"
"encoding/json"
"encoding/json"
"errors"
"fmt"
"fmt"
"io"
"io"
"io/ioutil"
"io/ioutil"
...
@@ -20,6 +19,7 @@ import (
...
@@ -20,6 +19,7 @@ import (
"github.com/k3s-io/kine/pkg/client"
"github.com/k3s-io/kine/pkg/client"
"github.com/k3s-io/kine/pkg/endpoint"
"github.com/k3s-io/kine/pkg/endpoint"
"github.com/otiai10/copy"
"github.com/otiai10/copy"
"github.com/pkg/errors"
"github.com/rancher/k3s/pkg/bootstrap"
"github.com/rancher/k3s/pkg/bootstrap"
"github.com/rancher/k3s/pkg/clientaccess"
"github.com/rancher/k3s/pkg/clientaccess"
"github.com/rancher/k3s/pkg/daemons/config"
"github.com/rancher/k3s/pkg/daemons/config"
...
@@ -615,7 +615,7 @@ func (c *Cluster) bootstrap(ctx context.Context) error {
...
@@ -615,7 +615,7 @@ func (c *Cluster) bootstrap(ctx context.Context) error {
if
c
.
runtime
.
HTTPBootstrap
{
if
c
.
runtime
.
HTTPBootstrap
{
// Assuming we should just compare on managed databases
// Assuming we should just compare on managed databases
if
err
:=
c
.
compareConfig
();
err
!=
nil
{
if
err
:=
c
.
compareConfig
();
err
!=
nil
{
return
err
return
err
ors
.
Wrap
(
err
,
"failed to validate server configuration"
)
}
}
return
c
.
httpBootstrap
(
ctx
)
return
c
.
httpBootstrap
(
ctx
)
}
}
...
@@ -635,7 +635,11 @@ func (c *Cluster) Snapshot(ctx context.Context, config *config.Control) error {
...
@@ -635,7 +635,11 @@ func (c *Cluster) Snapshot(ctx context.Context, config *config.Control) error {
// compareConfig verifies that the config of the joining control plane node coincides with the cluster's config
// compareConfig verifies that the config of the joining control plane node coincides with the cluster's config
func
(
c
*
Cluster
)
compareConfig
()
error
{
func
(
c
*
Cluster
)
compareConfig
()
error
{
agentClientAccessInfo
,
err
:=
clientaccess
.
ParseAndValidateTokenForUser
(
c
.
config
.
JoinURL
,
c
.
config
.
AgentToken
,
"node"
)
token
:=
c
.
config
.
AgentToken
if
token
==
""
{
token
=
c
.
config
.
Token
}
agentClientAccessInfo
,
err
:=
clientaccess
.
ParseAndValidateTokenForUser
(
c
.
config
.
JoinURL
,
token
,
"node"
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
@@ -655,7 +659,7 @@ func (c *Cluster) compareConfig() error {
...
@@ -655,7 +659,7 @@ func (c *Cluster) compareConfig() error {
if
!
reflect
.
DeepEqual
(
clusterControl
.
CriticalControlArgs
,
c
.
config
.
CriticalControlArgs
)
{
if
!
reflect
.
DeepEqual
(
clusterControl
.
CriticalControlArgs
,
c
.
config
.
CriticalControlArgs
)
{
logrus
.
Debugf
(
"This is the server CriticalControlArgs: %#v"
,
clusterControl
.
CriticalControlArgs
)
logrus
.
Debugf
(
"This is the server CriticalControlArgs: %#v"
,
clusterControl
.
CriticalControlArgs
)
logrus
.
Debugf
(
"This is the local CriticalControlArgs: %#v"
,
c
.
config
.
CriticalControlArgs
)
logrus
.
Debugf
(
"This is the local CriticalControlArgs: %#v"
,
c
.
config
.
CriticalControlArgs
)
return
errors
.
New
(
"
unable to join cluster due to
critical configuration value mismatch"
)
return
errors
.
New
(
"critical configuration value mismatch"
)
}
}
return
nil
return
nil
}
}
...
...
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