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
60efc38e
Commit
60efc38e
authored
Apr 20, 2017
by
derek mcquay
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kubeadm: remove func arg that isn't being used
parent
06d6a9ec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
11 deletions
+9
-11
manifests.go
cmd/kubeadm/app/master/manifests.go
+6
-6
manifests_test.go
cmd/kubeadm/app/master/manifests_test.go
+1
-3
selfhosted.go
cmd/kubeadm/app/master/selfhosted.go
+2
-2
No files found.
cmd/kubeadm/app/master/manifests.go
View file @
60efc38e
...
@@ -60,7 +60,7 @@ var (
...
@@ -60,7 +60,7 @@ var (
// WriteStaticPodManifests builds manifest objects based on user provided configuration and then dumps it to disk
// WriteStaticPodManifests builds manifest objects based on user provided configuration and then dumps it to disk
// where kubelet will pick and schedule them.
// where kubelet will pick and schedule them.
func
WriteStaticPodManifests
(
cfg
*
kubeadmapi
.
MasterConfiguration
)
error
{
func
WriteStaticPodManifests
(
cfg
*
kubeadmapi
.
MasterConfiguration
)
error
{
volumes
:=
[]
api
.
Volume
{
k8sVolume
(
cfg
)}
volumes
:=
[]
api
.
Volume
{
k8sVolume
()}
volumeMounts
:=
[]
api
.
VolumeMount
{
k8sVolumeMount
()}
volumeMounts
:=
[]
api
.
VolumeMount
{
k8sVolumeMount
()}
if
isCertsVolumeMountNeeded
()
{
if
isCertsVolumeMountNeeded
()
{
...
@@ -69,7 +69,7 @@ func WriteStaticPodManifests(cfg *kubeadmapi.MasterConfiguration) error {
...
@@ -69,7 +69,7 @@ func WriteStaticPodManifests(cfg *kubeadmapi.MasterConfiguration) error {
}
}
if
isPkiVolumeMountNeeded
()
{
if
isPkiVolumeMountNeeded
()
{
volumes
=
append
(
volumes
,
pkiVolume
(
cfg
))
volumes
=
append
(
volumes
,
pkiVolume
())
volumeMounts
=
append
(
volumeMounts
,
pkiVolumeMount
())
volumeMounts
=
append
(
volumeMounts
,
pkiVolumeMount
())
}
}
...
@@ -106,7 +106,7 @@ func WriteStaticPodManifests(cfg *kubeadmapi.MasterConfiguration) error {
...
@@ -106,7 +106,7 @@ func WriteStaticPodManifests(cfg *kubeadmapi.MasterConfiguration) error {
LivenessProbe
:
componentProbe
(
10251
,
"/healthz"
,
api
.
URISchemeHTTP
),
LivenessProbe
:
componentProbe
(
10251
,
"/healthz"
,
api
.
URISchemeHTTP
),
Resources
:
componentResources
(
"100m"
),
Resources
:
componentResources
(
"100m"
),
Env
:
getProxyEnvVars
(),
Env
:
getProxyEnvVars
(),
},
k8sVolume
(
cfg
)),
},
k8sVolume
()),
}
}
// Add etcd static pod spec only if external etcd is not configured
// Add etcd static pod spec only if external etcd is not configured
...
@@ -117,7 +117,7 @@ func WriteStaticPodManifests(cfg *kubeadmapi.MasterConfiguration) error {
...
@@ -117,7 +117,7 @@ func WriteStaticPodManifests(cfg *kubeadmapi.MasterConfiguration) error {
VolumeMounts
:
[]
api
.
VolumeMount
{
certsVolumeMount
(),
etcdVolumeMount
(
cfg
.
Etcd
.
DataDir
),
k8sVolumeMount
()},
VolumeMounts
:
[]
api
.
VolumeMount
{
certsVolumeMount
(),
etcdVolumeMount
(
cfg
.
Etcd
.
DataDir
),
k8sVolumeMount
()},
Image
:
images
.
GetCoreImage
(
images
.
KubeEtcdImage
,
cfg
,
kubeadmapi
.
GlobalEnvParams
.
EtcdImage
),
Image
:
images
.
GetCoreImage
(
images
.
KubeEtcdImage
,
cfg
,
kubeadmapi
.
GlobalEnvParams
.
EtcdImage
),
LivenessProbe
:
componentProbe
(
2379
,
"/health"
,
api
.
URISchemeHTTP
),
LivenessProbe
:
componentProbe
(
2379
,
"/health"
,
api
.
URISchemeHTTP
),
},
certsVolume
(
cfg
),
etcdVolume
(
cfg
),
k8sVolume
(
cfg
))
},
certsVolume
(
cfg
),
etcdVolume
(
cfg
),
k8sVolume
())
etcdPod
.
Spec
.
SecurityContext
=
&
api
.
PodSecurityContext
{
etcdPod
.
Spec
.
SecurityContext
=
&
api
.
PodSecurityContext
{
SELinuxOptions
:
&
api
.
SELinuxOptions
{
SELinuxOptions
:
&
api
.
SELinuxOptions
{
...
@@ -196,7 +196,7 @@ func isPkiVolumeMountNeeded() bool {
...
@@ -196,7 +196,7 @@ func isPkiVolumeMountNeeded() bool {
return
false
return
false
}
}
func
pkiVolume
(
cfg
*
kubeadmapi
.
MasterConfiguration
)
api
.
Volume
{
func
pkiVolume
()
api
.
Volume
{
return
api
.
Volume
{
return
api
.
Volume
{
Name
:
"pki"
,
Name
:
"pki"
,
VolumeSource
:
api
.
VolumeSource
{
VolumeSource
:
api
.
VolumeSource
{
...
@@ -230,7 +230,7 @@ func flockVolumeMount() api.VolumeMount {
...
@@ -230,7 +230,7 @@ func flockVolumeMount() api.VolumeMount {
}
}
}
}
func
k8sVolume
(
cfg
*
kubeadmapi
.
MasterConfiguration
)
api
.
Volume
{
func
k8sVolume
()
api
.
Volume
{
return
api
.
Volume
{
return
api
.
Volume
{
Name
:
"k8s"
,
Name
:
"k8s"
,
VolumeSource
:
api
.
VolumeSource
{
VolumeSource
:
api
.
VolumeSource
{
...
...
cmd/kubeadm/app/master/manifests_test.go
View file @
60efc38e
...
@@ -259,11 +259,9 @@ func TestCertsVolumeMount(t *testing.T) {
...
@@ -259,11 +259,9 @@ func TestCertsVolumeMount(t *testing.T) {
func
TestK8sVolume
(
t
*
testing
.
T
)
{
func
TestK8sVolume
(
t
*
testing
.
T
)
{
var
tests
=
[]
struct
{
var
tests
=
[]
struct
{
cfg
*
kubeadmapi
.
MasterConfiguration
expected
api
.
Volume
expected
api
.
Volume
}{
}{
{
{
cfg
:
&
kubeadmapi
.
MasterConfiguration
{},
expected
:
api
.
Volume
{
expected
:
api
.
Volume
{
Name
:
"k8s"
,
Name
:
"k8s"
,
VolumeSource
:
api
.
VolumeSource
{
VolumeSource
:
api
.
VolumeSource
{
...
@@ -274,7 +272,7 @@ func TestK8sVolume(t *testing.T) {
...
@@ -274,7 +272,7 @@ func TestK8sVolume(t *testing.T) {
}
}
for
_
,
rt
:=
range
tests
{
for
_
,
rt
:=
range
tests
{
actual
:=
k8sVolume
(
rt
.
cfg
)
actual
:=
k8sVolume
()
if
actual
.
Name
!=
rt
.
expected
.
Name
{
if
actual
.
Name
!=
rt
.
expected
.
Name
{
t
.
Errorf
(
t
.
Errorf
(
"failed k8sVolume:
\n\t
expected: %s
\n\t
actual: %s"
,
"failed k8sVolume:
\n\t
expected: %s
\n\t
actual: %s"
,
...
...
cmd/kubeadm/app/master/selfhosted.go
View file @
60efc38e
...
@@ -41,7 +41,7 @@ var (
...
@@ -41,7 +41,7 @@ var (
)
)
func
CreateSelfHostedControlPlane
(
cfg
*
kubeadmapi
.
MasterConfiguration
,
client
*
clientset
.
Clientset
)
error
{
func
CreateSelfHostedControlPlane
(
cfg
*
kubeadmapi
.
MasterConfiguration
,
client
*
clientset
.
Clientset
)
error
{
volumes
:=
[]
v1
.
Volume
{
k8sVolume
(
cfg
)}
volumes
:=
[]
v1
.
Volume
{
k8sVolume
()}
volumeMounts
:=
[]
v1
.
VolumeMount
{
k8sVolumeMount
()}
volumeMounts
:=
[]
v1
.
VolumeMount
{
k8sVolumeMount
()}
if
isCertsVolumeMountNeeded
()
{
if
isCertsVolumeMountNeeded
()
{
volumes
=
append
(
volumes
,
certsVolume
(
cfg
))
volumes
=
append
(
volumes
,
certsVolume
(
cfg
))
...
@@ -49,7 +49,7 @@ func CreateSelfHostedControlPlane(cfg *kubeadmapi.MasterConfiguration, client *c
...
@@ -49,7 +49,7 @@ func CreateSelfHostedControlPlane(cfg *kubeadmapi.MasterConfiguration, client *c
}
}
if
isPkiVolumeMountNeeded
()
{
if
isPkiVolumeMountNeeded
()
{
volumes
=
append
(
volumes
,
pkiVolume
(
cfg
))
volumes
=
append
(
volumes
,
pkiVolume
())
volumeMounts
=
append
(
volumeMounts
,
pkiVolumeMount
())
volumeMounts
=
append
(
volumeMounts
,
pkiVolumeMount
())
}
}
...
...
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