mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
kubeadm: cleanup remove some empty feature gate for dual-stack
This commit is contained in:
parent
1385bd3a06
commit
751ad37a05
@ -28,7 +28,6 @@ import (
|
||||
|
||||
kubeadmapi "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm"
|
||||
kubeadmapiv1 "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta3"
|
||||
"k8s.io/kubernetes/cmd/kubeadm/app/features"
|
||||
)
|
||||
|
||||
func TestValidateToken(t *testing.T) {
|
||||
@ -1115,17 +1114,14 @@ func TestGetClusterNodeMask(t *testing.T) {
|
||||
expectedError bool
|
||||
}{
|
||||
{
|
||||
name: "dual ipv4 default mask",
|
||||
cfg: &kubeadmapi.ClusterConfiguration{
|
||||
FeatureGates: map[string]bool{features.IPv6DualStack: true},
|
||||
},
|
||||
name: "dual ipv4 default mask",
|
||||
cfg: &kubeadmapi.ClusterConfiguration{},
|
||||
isIPv6: false,
|
||||
expectedMask: 24,
|
||||
},
|
||||
{
|
||||
name: "dual ipv4 custom mask",
|
||||
cfg: &kubeadmapi.ClusterConfiguration{
|
||||
FeatureGates: map[string]bool{features.IPv6DualStack: true},
|
||||
ControllerManager: kubeadmapi.ControlPlaneComponent{
|
||||
ExtraArgs: map[string]string{"node-cidr-mask-size": "21", "node-cidr-mask-size-ipv4": "23"},
|
||||
},
|
||||
@ -1134,17 +1130,14 @@ func TestGetClusterNodeMask(t *testing.T) {
|
||||
expectedMask: 23,
|
||||
},
|
||||
{
|
||||
name: "dual ipv6 default mask",
|
||||
cfg: &kubeadmapi.ClusterConfiguration{
|
||||
FeatureGates: map[string]bool{features.IPv6DualStack: true},
|
||||
},
|
||||
name: "dual ipv6 default mask",
|
||||
cfg: &kubeadmapi.ClusterConfiguration{},
|
||||
isIPv6: true,
|
||||
expectedMask: 64,
|
||||
},
|
||||
{
|
||||
name: "dual ipv6 custom mask",
|
||||
cfg: &kubeadmapi.ClusterConfiguration{
|
||||
FeatureGates: map[string]bool{features.IPv6DualStack: true},
|
||||
ControllerManager: kubeadmapi.ControlPlaneComponent{
|
||||
ExtraArgs: map[string]string{"node-cidr-mask-size-ipv6": "83"},
|
||||
},
|
||||
@ -1155,7 +1148,6 @@ func TestGetClusterNodeMask(t *testing.T) {
|
||||
{
|
||||
name: "dual ipv4 custom mask",
|
||||
cfg: &kubeadmapi.ClusterConfiguration{
|
||||
FeatureGates: map[string]bool{features.IPv6DualStack: true},
|
||||
ControllerManager: kubeadmapi.ControlPlaneComponent{
|
||||
ExtraArgs: map[string]string{"node-cidr-mask-size-ipv4": "23"},
|
||||
},
|
||||
@ -1166,7 +1158,6 @@ func TestGetClusterNodeMask(t *testing.T) {
|
||||
{
|
||||
name: "dual ipv4 wrong mask",
|
||||
cfg: &kubeadmapi.ClusterConfiguration{
|
||||
FeatureGates: map[string]bool{features.IPv6DualStack: true},
|
||||
ControllerManager: kubeadmapi.ControlPlaneComponent{
|
||||
ExtraArgs: map[string]string{"node-cidr-mask-size-ipv4": "aa"},
|
||||
},
|
||||
@ -1177,7 +1168,6 @@ func TestGetClusterNodeMask(t *testing.T) {
|
||||
{
|
||||
name: "dual ipv6 default mask and legacy flag",
|
||||
cfg: &kubeadmapi.ClusterConfiguration{
|
||||
FeatureGates: map[string]bool{features.IPv6DualStack: true},
|
||||
ControllerManager: kubeadmapi.ControlPlaneComponent{
|
||||
ExtraArgs: map[string]string{"node-cidr-mask-size": "23"},
|
||||
},
|
||||
@ -1188,7 +1178,6 @@ func TestGetClusterNodeMask(t *testing.T) {
|
||||
{
|
||||
name: "dual ipv6 custom mask and legacy flag",
|
||||
cfg: &kubeadmapi.ClusterConfiguration{
|
||||
FeatureGates: map[string]bool{features.IPv6DualStack: true},
|
||||
ControllerManager: kubeadmapi.ControlPlaneComponent{
|
||||
ExtraArgs: map[string]string{"node-cidr-mask-size": "23", "node-cidr-mask-size-ipv6": "83"},
|
||||
},
|
||||
@ -1199,7 +1188,6 @@ func TestGetClusterNodeMask(t *testing.T) {
|
||||
{
|
||||
name: "dual ipv6 custom mask and wrong flag",
|
||||
cfg: &kubeadmapi.ClusterConfiguration{
|
||||
FeatureGates: map[string]bool{features.IPv6DualStack: true},
|
||||
ControllerManager: kubeadmapi.ControlPlaneComponent{
|
||||
ExtraArgs: map[string]string{"node-cidr-mask-size": "23", "node-cidr-mask-size-ipv6": "a83"},
|
||||
},
|
||||
|
@ -127,7 +127,6 @@ func TestKubeletDefault(t *testing.T) {
|
||||
{
|
||||
name: "Service subnet, enabled dual stack defaulting works",
|
||||
clusterCfg: kubeadmapi.ClusterConfiguration{
|
||||
FeatureGates: map[string]bool{},
|
||||
Networking: kubeadmapi.Networking{
|
||||
ServiceSubnet: "192.168.0.0/16",
|
||||
},
|
||||
|
@ -653,7 +653,7 @@ func GetKubernetesServiceCIDR(svcSubnetList string) (*net.IPNet, error) {
|
||||
return nil, errors.Wrapf(err, "unable to parse ServiceSubnet %v", svcSubnetList)
|
||||
}
|
||||
if len(svcSubnets) == 0 {
|
||||
return nil, errors.New("received empty ServiceSubnet for dual-stack")
|
||||
return nil, errors.New("received empty ServiceSubnet")
|
||||
}
|
||||
return svcSubnets[0], nil
|
||||
}
|
||||
|
@ -539,6 +539,31 @@ func TestGetControllerManagerCommand(t *testing.T) {
|
||||
cfg *kubeadmapi.ClusterConfiguration
|
||||
expected []string
|
||||
}{
|
||||
{
|
||||
name: "custom cluster name for " + cpVersion,
|
||||
cfg: &kubeadmapi.ClusterConfiguration{
|
||||
KubernetesVersion: cpVersion,
|
||||
CertificatesDir: testCertsDir,
|
||||
ClusterName: "some-other-cluster-name",
|
||||
},
|
||||
expected: []string{
|
||||
"kube-controller-manager",
|
||||
"--bind-address=127.0.0.1",
|
||||
"--leader-elect=true",
|
||||
"--kubeconfig=" + kubeadmconstants.KubernetesDir + "/controller-manager.conf",
|
||||
"--root-ca-file=" + testCertsDir + "/ca.crt",
|
||||
"--service-account-private-key-file=" + testCertsDir + "/sa.key",
|
||||
"--cluster-signing-cert-file=" + testCertsDir + "/ca.crt",
|
||||
"--cluster-signing-key-file=" + testCertsDir + "/ca.key",
|
||||
"--use-service-account-credentials=true",
|
||||
"--controllers=*,bootstrapsigner,tokencleaner",
|
||||
"--authentication-kubeconfig=" + kubeadmconstants.KubernetesDir + "/controller-manager.conf",
|
||||
"--authorization-kubeconfig=" + kubeadmconstants.KubernetesDir + "/controller-manager.conf",
|
||||
"--client-ca-file=" + testCertsDir + "/ca.crt",
|
||||
"--requestheader-client-ca-file=" + testCertsDir + "/front-proxy-ca.crt",
|
||||
"--cluster-name=some-other-cluster-name",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "custom certs dir for " + cpVersion,
|
||||
cfg: &kubeadmapi.ClusterConfiguration{
|
||||
|
Loading…
Reference in New Issue
Block a user