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
269a07c0
Commit
269a07c0
authored
Mar 04, 2019
by
Lubomir I. Ivanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kubeadm-reset: fetch init config only if client is non-nil
parent
37f01382
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
reset.go
cmd/kubeadm/app/cmd/reset.go
+7
-8
No files found.
cmd/kubeadm/app/cmd/reset.go
View file @
269a07c0
...
@@ -63,19 +63,18 @@ func NewCmdReset(in io.Reader, out io.Writer) *cobra.Command {
...
@@ -63,19 +63,18 @@ func NewCmdReset(in io.Reader, out io.Writer) *cobra.Command {
ignorePreflightErrorsSet
,
err
:=
validation
.
ValidateIgnorePreflightErrors
(
ignorePreflightErrors
)
ignorePreflightErrorsSet
,
err
:=
validation
.
ValidateIgnorePreflightErrors
(
ignorePreflightErrors
)
kubeadmutil
.
CheckErr
(
err
)
kubeadmutil
.
CheckErr
(
err
)
if
_
,
err
:=
os
.
Stat
(
kubeConfigFile
);
!
os
.
IsNotExist
(
err
)
{
var
cfg
*
kubeadmapi
.
InitConfiguration
client
,
err
=
getClientset
(
kubeConfigFile
,
false
)
client
,
err
=
getClientset
(
kubeConfigFile
,
false
)
kubeadmutil
.
CheckErr
(
err
)
if
err
==
nil
{
klog
.
V
(
1
)
.
Infof
(
"[reset] loaded client set from kubeconfig file: %s"
,
kubeConfigFile
)
klog
.
V
(
1
)
.
Infof
(
"[reset] loaded client set from kubeconfig file: %s"
,
kubeConfigFile
)
cfg
,
err
=
configutil
.
FetchInitConfigurationFromCluster
(
client
,
os
.
Stdout
,
"reset"
,
false
)
if
err
!=
nil
{
klog
.
Warningf
(
"[reset] Unable to fetch the kubeadm-config ConfigMap from cluster: %v"
,
err
)
}
}
else
{
}
else
{
klog
.
V
(
1
)
.
Infof
(
"[reset] could not get client set from missing kubeconfig file: %s"
,
kubeConfigFile
)
klog
.
V
(
1
)
.
Infof
(
"[reset] could not get client set from missing kubeconfig file: %s"
,
kubeConfigFile
)
}
}
cfg
,
err
:=
configutil
.
FetchInitConfigurationFromCluster
(
client
,
os
.
Stdout
,
"reset"
,
false
)
if
err
!=
nil
{
klog
.
Warningf
(
"[reset] Unable to fetch the kubeadm-config ConfigMap from cluster: %v"
,
err
)
}
if
criSocketPath
==
""
{
if
criSocketPath
==
""
{
criSocketPath
,
err
=
resetDetectCRISocket
(
cfg
)
criSocketPath
,
err
=
resetDetectCRISocket
(
cfg
)
kubeadmutil
.
CheckErr
(
err
)
kubeadmutil
.
CheckErr
(
err
)
...
...
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