Unverified Commit 6efdc940 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #59683 from oomichi/cleanup

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Remove unused getClusterCIDR() **What this PR does / why we need it**: getClusterCIDR() has been unused since the PR 57305[1], so this removes the method for code cleanup. [1]: https://github.com/kubernetes/kubernetes/pull/57305 **Release note**: "NONE"
parents cfa6d35c 30e4ba74
...@@ -77,7 +77,7 @@ func EnsureProxyAddon(cfg *kubeadmapi.MasterConfiguration, client clientset.Inte ...@@ -77,7 +77,7 @@ func EnsureProxyAddon(cfg *kubeadmapi.MasterConfiguration, client clientset.Inte
if err != nil { if err != nil {
return fmt.Errorf("error when parsing kube-proxy configmap template: %v", err) return fmt.Errorf("error when parsing kube-proxy configmap template: %v", err)
} }
proxyDaemonSetBytes, err = kubeadmutil.ParseTemplate(KubeProxyDaemonSet19, struct{ ImageRepository, Arch, Version, ImageOverride, ClusterCIDR, MasterTaintKey, CloudTaintKey string }{ proxyDaemonSetBytes, err = kubeadmutil.ParseTemplate(KubeProxyDaemonSet19, struct{ ImageRepository, Arch, Version, ImageOverride, MasterTaintKey, CloudTaintKey string }{
ImageRepository: cfg.GetControlPlaneImageRepository(), ImageRepository: cfg.GetControlPlaneImageRepository(),
Arch: runtime.GOARCH, Arch: runtime.GOARCH,
Version: kubeadmutil.KubernetesVersionToImageTag(cfg.KubernetesVersion), Version: kubeadmutil.KubernetesVersionToImageTag(cfg.KubernetesVersion),
...@@ -154,10 +154,3 @@ func createClusterRoleBindings(client clientset.Interface) error { ...@@ -154,10 +154,3 @@ func createClusterRoleBindings(client clientset.Interface) error {
}, },
}) })
} }
func getClusterCIDR(podsubnet string) string {
if len(podsubnet) == 0 {
return ""
}
return "- --cluster-cidr=" + podsubnet
}
...@@ -90,23 +90,6 @@ func TestCreateServiceAccount(t *testing.T) { ...@@ -90,23 +90,6 @@ func TestCreateServiceAccount(t *testing.T) {
} }
} }
func TestGetClusterCIDR(t *testing.T) {
emptyClusterCIDR := getClusterCIDR("")
if emptyClusterCIDR != "" {
t.Errorf("Invalid format: %s", emptyClusterCIDR)
}
clusterCIDR := getClusterCIDR("10.244.0.0/16")
if clusterCIDR != "- --cluster-cidr=10.244.0.0/16" {
t.Errorf("Invalid format: %s", clusterCIDR)
}
clusterIPv6CIDR := getClusterCIDR("2001:db8::/64")
if clusterIPv6CIDR != "- --cluster-cidr=2001:db8::/64" {
t.Errorf("Invalid format: %s", clusterIPv6CIDR)
}
}
func TestCompileManifests(t *testing.T) { func TestCompileManifests(t *testing.T) {
var tests = []struct { var tests = []struct {
manifest string manifest string
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment