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
7d855464
Unverified
Commit
7d855464
authored
Dec 28, 2018
by
Kubernetes Prow Robot
Committed by
GitHub
Dec 28, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #72367 from rojkov/fix-golint-warnings
kubeadm: fix golint warnings for redundant ifs
parents
b89ab2c0
0bf0b3ef
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
7 additions
and
31 deletions
+7
-31
controlplane.go
cmd/kubeadm/app/cmd/phases/controlplane.go
+1
-4
markcontrolplane.go
cmd/kubeadm/app/cmd/phases/markcontrolplane.go
+1
-5
reset.go
cmd/kubeadm/app/cmd/reset.go
+1
-4
registrations.go
cmd/kubeadm/app/componentconfigs/registrations.go
+1
-4
certs.go
cmd/kubeadm/app/phases/certs/certs.go
+1
-5
initconfiguration.go
cmd/kubeadm/app/util/config/initconfiguration.go
+1
-4
joinconfiguration.go
cmd/kubeadm/app/util/config/joinconfiguration.go
+1
-5
No files found.
cmd/kubeadm/app/cmd/phases/controlplane.go
View file @
7d855464
...
@@ -149,9 +149,6 @@ func runControlPlaneSubPhase(component string) func(c workflow.RunData) error {
...
@@ -149,9 +149,6 @@ func runControlPlaneSubPhase(component string) func(c workflow.RunData) error {
cfg
:=
data
.
Cfg
()
cfg
:=
data
.
Cfg
()
fmt
.
Printf
(
"[control-plane] Creating static Pod manifest for %q
\n
"
,
component
)
fmt
.
Printf
(
"[control-plane] Creating static Pod manifest for %q
\n
"
,
component
)
if
err
:=
controlplane
.
CreateStaticPodFiles
(
data
.
ManifestDir
(),
cfg
,
component
);
err
!=
nil
{
return
controlplane
.
CreateStaticPodFiles
(
data
.
ManifestDir
(),
cfg
,
component
)
return
err
}
return
nil
}
}
}
}
cmd/kubeadm/app/cmd/phases/markcontrolplane.go
View file @
7d855464
...
@@ -69,9 +69,5 @@ func runMarkControlPlane(c workflow.RunData) error {
...
@@ -69,9 +69,5 @@ func runMarkControlPlane(c workflow.RunData) error {
}
}
nodeRegistration
:=
data
.
Cfg
()
.
NodeRegistration
nodeRegistration
:=
data
.
Cfg
()
.
NodeRegistration
if
err
:=
markcontrolplanephase
.
MarkControlPlane
(
client
,
nodeRegistration
.
Name
,
nodeRegistration
.
Taints
);
err
!=
nil
{
return
markcontrolplanephase
.
MarkControlPlane
(
client
,
nodeRegistration
.
Name
,
nodeRegistration
.
Taints
)
return
err
}
return
nil
}
}
cmd/kubeadm/app/cmd/reset.go
View file @
7d855464
...
@@ -239,10 +239,7 @@ func removeContainers(execer utilsexec.Interface, criSocketPath string) error {
...
@@ -239,10 +239,7 @@ func removeContainers(execer utilsexec.Interface, criSocketPath string) error {
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
if
err
:=
containerRuntime
.
RemoveContainers
(
containers
);
err
!=
nil
{
return
containerRuntime
.
RemoveContainers
(
containers
)
return
err
}
return
nil
}
}
// cleanDir removes everything in a directory, but not the directory itself
// cleanDir removes everything in a directory, but not the directory itself
...
...
cmd/kubeadm/app/componentconfigs/registrations.go
View file @
7d855464
...
@@ -74,10 +74,7 @@ func (r Registration) Unmarshal(fileContent []byte) (runtime.Object, error) {
...
@@ -74,10 +74,7 @@ func (r Registration) Unmarshal(fileContent []byte) (runtime.Object, error) {
func
unmarshalObject
(
obj
runtime
.
Object
,
fileContent
[]
byte
)
error
{
func
unmarshalObject
(
obj
runtime
.
Object
,
fileContent
[]
byte
)
error
{
// Decode the file content using the componentconfig Codecs that knows about all APIs
// Decode the file content using the componentconfig Codecs that knows about all APIs
if
err
:=
runtime
.
DecodeInto
(
Codecs
.
UniversalDecoder
(),
fileContent
,
obj
);
err
!=
nil
{
return
runtime
.
DecodeInto
(
Codecs
.
UniversalDecoder
(),
fileContent
,
obj
)
return
err
}
return
nil
}
}
const
(
const
(
...
...
cmd/kubeadm/app/phases/certs/certs.go
View file @
7d855464
...
@@ -59,11 +59,7 @@ func CreatePKIAssets(cfg *kubeadmapi.InitConfiguration) error {
...
@@ -59,11 +59,7 @@ func CreatePKIAssets(cfg *kubeadmapi.InitConfiguration) error {
fmt
.
Printf
(
"[certs] valid certificates and keys now exist in %q
\n
"
,
cfg
.
CertificatesDir
)
fmt
.
Printf
(
"[certs] valid certificates and keys now exist in %q
\n
"
,
cfg
.
CertificatesDir
)
// Service accounts are not x509 certs, so handled separately
// Service accounts are not x509 certs, so handled separately
if
err
:=
CreateServiceAccountKeyAndPublicKeyFiles
(
cfg
);
err
!=
nil
{
return
CreateServiceAccountKeyAndPublicKeyFiles
(
cfg
)
return
err
}
return
nil
}
}
// CreateServiceAccountKeyAndPublicKeyFiles create a new public/private key files for signing service account users.
// CreateServiceAccountKeyAndPublicKeyFiles create a new public/private key files for signing service account users.
...
...
cmd/kubeadm/app/util/config/initconfiguration.go
View file @
7d855464
...
@@ -54,10 +54,7 @@ func SetInitDynamicDefaults(cfg *kubeadmapi.InitConfiguration) error {
...
@@ -54,10 +54,7 @@ func SetInitDynamicDefaults(cfg *kubeadmapi.InitConfiguration) error {
if
err
:=
SetAPIEndpointDynamicDefaults
(
&
cfg
.
LocalAPIEndpoint
);
err
!=
nil
{
if
err
:=
SetAPIEndpointDynamicDefaults
(
&
cfg
.
LocalAPIEndpoint
);
err
!=
nil
{
return
err
return
err
}
}
if
err
:=
SetClusterDynamicDefaults
(
&
cfg
.
ClusterConfiguration
,
cfg
.
LocalAPIEndpoint
.
AdvertiseAddress
,
cfg
.
LocalAPIEndpoint
.
BindPort
);
err
!=
nil
{
return
SetClusterDynamicDefaults
(
&
cfg
.
ClusterConfiguration
,
cfg
.
LocalAPIEndpoint
.
AdvertiseAddress
,
cfg
.
LocalAPIEndpoint
.
BindPort
)
return
err
}
return
nil
}
}
// SetBootstrapTokensDynamicDefaults checks and sets configuration values for the BootstrapTokens object
// SetBootstrapTokensDynamicDefaults checks and sets configuration values for the BootstrapTokens object
...
...
cmd/kubeadm/app/util/config/joinconfiguration.go
View file @
7d855464
...
@@ -41,11 +41,7 @@ func SetJoinDynamicDefaults(cfg *kubeadmapi.JoinConfiguration) error {
...
@@ -41,11 +41,7 @@ func SetJoinDynamicDefaults(cfg *kubeadmapi.JoinConfiguration) error {
return
err
return
err
}
}
if
err
:=
SetJoinControlPlaneDefaults
(
cfg
.
ControlPlane
);
err
!=
nil
{
return
SetJoinControlPlaneDefaults
(
cfg
.
ControlPlane
)
return
err
}
return
nil
}
}
// SetJoinControlPlaneDefaults checks and sets configuration values for the JoinControlPlane object
// SetJoinControlPlaneDefaults checks and sets configuration values for the JoinControlPlane object
...
...
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