Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubeadm: remove func arg that isn't being used #44731

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions cmd/kubeadm/app/master/manifests.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var (
// WriteStaticPodManifests builds manifest objects based on user provided configuration and then dumps it to disk
// where kubelet will pick and schedule them.
func WriteStaticPodManifests(cfg *kubeadmapi.MasterConfiguration) error {
volumes := []api.Volume{k8sVolume(cfg)}
volumes := []api.Volume{k8sVolume()}
volumeMounts := []api.VolumeMount{k8sVolumeMount()}

if isCertsVolumeMountNeeded() {
Expand All @@ -69,7 +69,7 @@ func WriteStaticPodManifests(cfg *kubeadmapi.MasterConfiguration) error {
}

if isPkiVolumeMountNeeded() {
volumes = append(volumes, pkiVolume(cfg))
volumes = append(volumes, pkiVolume())
volumeMounts = append(volumeMounts, pkiVolumeMount())
}

Expand Down Expand Up @@ -106,7 +106,7 @@ func WriteStaticPodManifests(cfg *kubeadmapi.MasterConfiguration) error {
LivenessProbe: componentProbe(10251, "/healthz", api.URISchemeHTTP),
Resources: componentResources("100m"),
Env: getProxyEnvVars(),
}, k8sVolume(cfg)),
}, k8sVolume()),
}

// Add etcd static pod spec only if external etcd is not configured
Expand All @@ -117,7 +117,7 @@ func WriteStaticPodManifests(cfg *kubeadmapi.MasterConfiguration) error {
VolumeMounts: []api.VolumeMount{certsVolumeMount(), etcdVolumeMount(cfg.Etcd.DataDir), k8sVolumeMount()},
Image: images.GetCoreImage(images.KubeEtcdImage, cfg, kubeadmapi.GlobalEnvParams.EtcdImage),
LivenessProbe: componentProbe(2379, "/health", api.URISchemeHTTP),
}, certsVolume(cfg), etcdVolume(cfg), k8sVolume(cfg))
}, certsVolume(cfg), etcdVolume(cfg), k8sVolume())

etcdPod.Spec.SecurityContext = &api.PodSecurityContext{
SELinuxOptions: &api.SELinuxOptions{
Expand Down Expand Up @@ -196,7 +196,7 @@ func isPkiVolumeMountNeeded() bool {
return false
}

func pkiVolume(cfg *kubeadmapi.MasterConfiguration) api.Volume {
func pkiVolume() api.Volume {
return api.Volume{
Name: "pki",
VolumeSource: api.VolumeSource{
Expand Down Expand Up @@ -230,7 +230,7 @@ func flockVolumeMount() api.VolumeMount {
}
}

func k8sVolume(cfg *kubeadmapi.MasterConfiguration) api.Volume {
func k8sVolume() api.Volume {
return api.Volume{
Name: "k8s",
VolumeSource: api.VolumeSource{
Expand Down
4 changes: 1 addition & 3 deletions cmd/kubeadm/app/master/manifests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,9 @@ func TestCertsVolumeMount(t *testing.T) {

func TestK8sVolume(t *testing.T) {
var tests = []struct {
cfg *kubeadmapi.MasterConfiguration
expected api.Volume
}{
{
cfg: &kubeadmapi.MasterConfiguration{},
expected: api.Volume{
Name: "k8s",
VolumeSource: api.VolumeSource{
Expand All @@ -274,7 +272,7 @@ func TestK8sVolume(t *testing.T) {
}

for _, rt := range tests {
actual := k8sVolume(rt.cfg)
actual := k8sVolume()
if actual.Name != rt.expected.Name {
t.Errorf(
"failed k8sVolume:\n\texpected: %s\n\t actual: %s",
Expand Down
4 changes: 2 additions & 2 deletions cmd/kubeadm/app/master/selfhosted.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ var (
)

func CreateSelfHostedControlPlane(cfg *kubeadmapi.MasterConfiguration, client *clientset.Clientset) error {
volumes := []v1.Volume{k8sVolume(cfg)}
volumes := []v1.Volume{k8sVolume()}
volumeMounts := []v1.VolumeMount{k8sVolumeMount()}
if isCertsVolumeMountNeeded() {
volumes = append(volumes, certsVolume(cfg))
volumeMounts = append(volumeMounts, certsVolumeMount())
}

if isPkiVolumeMountNeeded() {
volumes = append(volumes, pkiVolume(cfg))
volumes = append(volumes, pkiVolume())
volumeMounts = append(volumeMounts, pkiVolumeMount())
}

Expand Down