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
05e5a347
Unverified
Commit
05e5a347
authored
Dec 06, 2018
by
Yago Nobre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use kubeconfig flag instead of kubeconfig-dir in kubeadm init phase bootstrap-token
parent
0351853e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
bootstraptoken.go
cmd/kubeadm/app/cmd/phases/bootstraptoken.go
+3
-6
No files found.
cmd/kubeadm/app/cmd/phases/bootstraptoken.go
View file @
05e5a347
...
@@ -18,7 +18,6 @@ package phases
...
@@ -18,7 +18,6 @@ package phases
import
(
import
(
"fmt"
"fmt"
"path/filepath"
"github.com/pkg/errors"
"github.com/pkg/errors"
...
@@ -26,7 +25,6 @@ import (
...
@@ -26,7 +25,6 @@ import (
kubeadmapi
"k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm"
kubeadmapi
"k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm"
"k8s.io/kubernetes/cmd/kubeadm/app/cmd/options"
"k8s.io/kubernetes/cmd/kubeadm/app/cmd/options"
"k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow"
"k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow"
kubeadmconstants
"k8s.io/kubernetes/cmd/kubeadm/app/constants"
clusterinfophase
"k8s.io/kubernetes/cmd/kubeadm/app/phases/bootstraptoken/clusterinfo"
clusterinfophase
"k8s.io/kubernetes/cmd/kubeadm/app/phases/bootstraptoken/clusterinfo"
nodebootstraptokenphase
"k8s.io/kubernetes/cmd/kubeadm/app/phases/bootstraptoken/node"
nodebootstraptokenphase
"k8s.io/kubernetes/cmd/kubeadm/app/phases/bootstraptoken/node"
"k8s.io/kubernetes/pkg/util/normalizer"
"k8s.io/kubernetes/pkg/util/normalizer"
...
@@ -51,7 +49,7 @@ var (
...
@@ -51,7 +49,7 @@ var (
type
bootstrapTokenData
interface
{
type
bootstrapTokenData
interface
{
Cfg
()
*
kubeadmapi
.
InitConfiguration
Cfg
()
*
kubeadmapi
.
InitConfiguration
Client
()
(
clientset
.
Interface
,
error
)
Client
()
(
clientset
.
Interface
,
error
)
KubeConfig
Dir
()
string
KubeConfig
Path
()
string
SkipTokenPrint
()
bool
SkipTokenPrint
()
bool
Tokens
()
[]
string
Tokens
()
[]
string
}
}
...
@@ -66,7 +64,7 @@ func NewBootstrapTokenPhase() workflow.Phase {
...
@@ -66,7 +64,7 @@ func NewBootstrapTokenPhase() workflow.Phase {
Long
:
bootstrapTokenLongDesc
,
Long
:
bootstrapTokenLongDesc
,
InheritFlags
:
[]
string
{
InheritFlags
:
[]
string
{
options
.
CfgPath
,
options
.
CfgPath
,
options
.
Kubeconfig
Dir
,
options
.
Kubeconfig
Path
,
options
.
SkipTokenPrint
,
options
.
SkipTokenPrint
,
},
},
Run
:
runBoostrapToken
,
Run
:
runBoostrapToken
,
...
@@ -113,8 +111,7 @@ func runBoostrapToken(c workflow.RunData) error {
...
@@ -113,8 +111,7 @@ func runBoostrapToken(c workflow.RunData) error {
}
}
// Create the cluster-info ConfigMap with the associated RBAC rules
// Create the cluster-info ConfigMap with the associated RBAC rules
adminKubeConfigPath
:=
filepath
.
Join
(
data
.
KubeConfigDir
(),
kubeadmconstants
.
AdminKubeConfigFileName
)
if
err
:=
clusterinfophase
.
CreateBootstrapConfigMapIfNotExists
(
client
,
data
.
KubeConfigPath
());
err
!=
nil
{
if
err
:=
clusterinfophase
.
CreateBootstrapConfigMapIfNotExists
(
client
,
adminKubeConfigPath
);
err
!=
nil
{
return
errors
.
Wrap
(
err
,
"error creating bootstrap ConfigMap"
)
return
errors
.
Wrap
(
err
,
"error creating bootstrap ConfigMap"
)
}
}
if
err
:=
clusterinfophase
.
CreateClusterInfoRBACRules
(
client
);
err
!=
nil
{
if
err
:=
clusterinfophase
.
CreateClusterInfoRBACRules
(
client
);
err
!=
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