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
7333cc79
Commit
7333cc79
authored
Feb 04, 2019
by
fabriziopandini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove-kubeadm-alpha-preflight
parent
9d6ebf6c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
105 deletions
+0
-105
BUILD
cmd/kubeadm/app/cmd/alpha/BUILD
+0
-1
alpha.go
cmd/kubeadm/app/cmd/alpha/alpha.go
+0
-1
preflight.go
cmd/kubeadm/app/cmd/alpha/preflight.go
+0
-103
No files found.
cmd/kubeadm/app/cmd/alpha/BUILD
View file @
7333cc79
...
@@ -7,7 +7,6 @@ go_library(
...
@@ -7,7 +7,6 @@ go_library(
"certs.go",
"certs.go",
"kubeconfig.go",
"kubeconfig.go",
"kubelet.go",
"kubelet.go",
"preflight.go",
"selfhosting.go",
"selfhosting.go",
],
],
importpath = "k8s.io/kubernetes/cmd/kubeadm/app/cmd/alpha",
importpath = "k8s.io/kubernetes/cmd/kubeadm/app/cmd/alpha",
...
...
cmd/kubeadm/app/cmd/alpha/alpha.go
View file @
7333cc79
...
@@ -33,7 +33,6 @@ func NewCmdAlpha(in io.Reader, out io.Writer) *cobra.Command {
...
@@ -33,7 +33,6 @@ func NewCmdAlpha(in io.Reader, out io.Writer) *cobra.Command {
cmd
.
AddCommand
(
newCmdCertsUtility
())
cmd
.
AddCommand
(
newCmdCertsUtility
())
cmd
.
AddCommand
(
newCmdKubeletUtility
())
cmd
.
AddCommand
(
newCmdKubeletUtility
())
cmd
.
AddCommand
(
newCmdKubeConfigUtility
(
out
))
cmd
.
AddCommand
(
newCmdKubeConfigUtility
(
out
))
cmd
.
AddCommand
(
newCmdPreFlightUtility
())
cmd
.
AddCommand
(
NewCmdSelfhosting
(
in
))
cmd
.
AddCommand
(
NewCmdSelfhosting
(
in
))
// TODO: This command should be removed as soon as the kubeadm init phase refactoring is completed.
// TODO: This command should be removed as soon as the kubeadm init phase refactoring is completed.
...
...
cmd/kubeadm/app/cmd/alpha/preflight.go
deleted
100644 → 0
View file @
9d6ebf6c
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
alpha
import
(
"fmt"
"github.com/pkg/errors"
"github.com/spf13/cobra"
kubeadmscheme
"k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/scheme"
kubeadmapiv1beta1
"k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta1"
"k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/validation"
"k8s.io/kubernetes/cmd/kubeadm/app/cmd/options"
cmdutil
"k8s.io/kubernetes/cmd/kubeadm/app/cmd/util"
"k8s.io/kubernetes/cmd/kubeadm/app/preflight"
kubeadmutil
"k8s.io/kubernetes/cmd/kubeadm/app/util"
configutil
"k8s.io/kubernetes/cmd/kubeadm/app/util/config"
"k8s.io/kubernetes/pkg/util/normalizer"
utilsexec
"k8s.io/utils/exec"
)
var
(
nodePreflightLongDesc
=
normalizer
.
LongDesc
(
`
Run node pre-flight checks, functionally equivalent to what implemented by kubeadm join.
`
+
cmdutil
.
AlphaDisclaimer
)
nodePreflightExample
=
normalizer
.
Examples
(
`
# Run node pre-flight checks.
kubeadm alpha preflight node
`
)
errorMissingConfigFlag
=
errors
.
New
(
"the --config flag is mandatory"
)
)
// newCmdPreFlightUtility calls cobra.Command for preflight checks
func
newCmdPreFlightUtility
()
*
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
Use
:
"preflight"
,
Short
:
"Commands related to pre-flight checks"
,
Long
:
cmdutil
.
MacroCommandLongDescription
,
}
cmd
.
AddCommand
(
newCmdPreFlightNode
())
return
cmd
}
// newCmdPreFlightNode calls cobra.Command for node preflight checks
func
newCmdPreFlightNode
()
*
cobra
.
Command
{
var
cfgPath
string
var
ignorePreflightErrors
[]
string
cmd
:=
&
cobra
.
Command
{
Use
:
"node"
,
Short
:
"Run node pre-flight checks"
,
Long
:
nodePreflightLongDesc
,
Example
:
nodePreflightExample
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
if
len
(
cfgPath
)
==
0
{
kubeadmutil
.
CheckErr
(
errorMissingConfigFlag
)
}
ignorePreflightErrorsSet
,
err
:=
validation
.
ValidateIgnorePreflightErrors
(
ignorePreflightErrors
)
kubeadmutil
.
CheckErr
(
err
)
cfg
:=
&
kubeadmapiv1beta1
.
JoinConfiguration
{}
kubeadmscheme
.
Scheme
.
Default
(
cfg
)
internalcfg
,
err
:=
configutil
.
JoinConfigFileAndDefaultsToInternalConfig
(
cfgPath
,
cfg
)
kubeadmutil
.
CheckErr
(
err
)
if
internalcfg
.
ControlPlane
!=
nil
{
err
=
configutil
.
VerifyAPIServerBindAddress
(
internalcfg
.
ControlPlane
.
LocalAPIEndpoint
.
AdvertiseAddress
)
kubeadmutil
.
CheckErr
(
err
)
}
fmt
.
Println
(
"[preflight] running pre-flight checks"
)
err
=
preflight
.
RunJoinNodeChecks
(
utilsexec
.
New
(),
internalcfg
,
ignorePreflightErrorsSet
)
kubeadmutil
.
CheckErr
(
err
)
fmt
.
Println
(
"[preflight] pre-flight checks passed"
)
},
}
options
.
AddConfigFlag
(
cmd
.
PersistentFlags
(),
&
cfgPath
)
options
.
AddIgnorePreflightErrorsFlag
(
cmd
.
PersistentFlags
(),
&
ignorePreflightErrors
)
return
cmd
}
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