Skip to content

Commit

Permalink
Merge pull request #17167 from hakman/drop-1.26
Browse files Browse the repository at this point in the history
Remove support for K8s 1.26 in kOps 1.32
  • Loading branch information
k8s-ci-robot authored Jan 5, 2025
2 parents 6b0d029 + 1f69da9 commit eb170d2
Show file tree
Hide file tree
Showing 952 changed files with 4,008 additions and 58,835 deletions.
13 changes: 6 additions & 7 deletions cmd/kops/create_cluster_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ var MagicTimestamp = metav1.Time{Time: time.Date(2017, 1, 1, 0, 0, 0, 0, time.UT

// TestCreateClusterMinimal runs kops create cluster minimal.example.com --zones us-test-1a
func TestCreateClusterMinimal(t *testing.T) {
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.25", "v1alpha2")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.26", "v1alpha2")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.27", "v1alpha2")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.28", "v1alpha2")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.29", "v1alpha2")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.30", "v1alpha2")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.26-arm64", "v1alpha2")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.26-irsa", "v1alpha2")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.31", "v1alpha2")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.32", "v1alpha2")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-arm64", "v1alpha2")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-irsa", "v1alpha2")
}

// TestCreateClusterHetzner runs kops create cluster minimal.k8s.local --zones fsn1
Expand Down Expand Up @@ -111,9 +111,8 @@ func TestCreateClusterHA(t *testing.T) {

// TestCreateClusterMinimalGCE runs kops create cluster minimal.example.com --cloud gce --zones us-test1-a
func TestCreateClusterMinimalGCE(t *testing.T) {
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.26-gce", "v1alpha2")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.26-gce-dns-none", "v1alpha2")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.29-gce", "v1alpha2")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-gce", "v1alpha2")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-gce-dns-none", "v1alpha2")
}

// TestCreateClusterHAGCE runs kops create cluster ha-gce.example.com --cloud gce --zones us-test1-a,us-test1-b,us-test1-c --master-zones us-test1-a,us-test1-b,us-test1-c
Expand Down
130 changes: 33 additions & 97 deletions cmd/kops/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,16 +190,6 @@ func (i integrationTest) withDefaultServiceAccountRoles24() *integrationTest {
withServiceAccountRole("ebs-csi-controller-sa.kube-system", true)
}

// withDefaultAddons24 adds the default addons for an AWS cluster running k8s 1.24
func (i integrationTest) withDefaultAddons24() *integrationTest {
return i.withAddons(
awsCCMAddon,
awsEBSCSIAddon,
dnsControllerAddon,
leaderElectionAddon,
)
}

// withDefaultAddons30 adds the default addons for an AWS cluster running k8s 1.30
func (i integrationTest) withDefaultAddons30() *integrationTest {
return i.withAddons(
Expand All @@ -210,7 +200,7 @@ func (i integrationTest) withDefaultAddons30() *integrationTest {
}

func (i integrationTest) withDefaults24() *integrationTest {
return i.withDefaultAddons24().withDefaultServiceAccountRoles24()
return i.withDefaultAddons30().withDefaultServiceAccountRoles24()
}

const (
Expand All @@ -232,7 +222,6 @@ const (
certManagerAddon = "certmanager.io-k8s-1.16"
clusterAutoscalerAddon = "cluster-autoscaler.addons.k8s.io-k8s-1.15"
dnsControllerAddon = "dns-controller.addons.k8s.io-k8s-1.12"
leaderElectionAddon = "leader-migration.rbac.addons.k8s.io-k8s-1.23"
metricsServerAddon = "metrics-server.addons.k8s.io-k8s-1.11"
nodeProblemDetectorAddon = "node-problem-detector.addons.k8s.io-k8s-1.17"
)
Expand All @@ -249,22 +238,19 @@ func TestMinimalAWS(t *testing.T) {
}

// TestMinimal runs the test on a minimum configuration
func TestMinimal_v1_25(t *testing.T) {
newIntegrationTest("minimal.example.com", "minimal-1.25").
func TestMinimal_v1_27(t *testing.T) {
newIntegrationTest("minimal.example.com", "minimal-1.27").
withAddons(
awsEBSCSIAddon,
dnsControllerAddon,
awsCCMAddon,
leaderElectionAddon,
).
runTestTerraformAWS(t)
}

// TestMinimal runs the test on a minimum configuration
func TestMinimal_v1_26(t *testing.T) {
t.Setenv("KOPS_RUN_TOO_NEW_VERSION", "1")

newIntegrationTest("minimal.example.com", "minimal-1.26").
func TestMinimal_v1_28(t *testing.T) {
newIntegrationTest("minimal.example.com", "minimal-1.28").
withAddons(
awsEBSCSIAddon,
dnsControllerAddon,
Expand All @@ -274,10 +260,8 @@ func TestMinimal_v1_26(t *testing.T) {
}

// TestMinimal runs the test on a minimum configuration
func TestMinimal_v1_27(t *testing.T) {
t.Setenv("KOPS_RUN_TOO_NEW_VERSION", "1")

newIntegrationTest("minimal.example.com", "minimal-1.27").
func TestMinimal_v1_29(t *testing.T) {
newIntegrationTest("minimal.example.com", "minimal-1.29").
withAddons(
awsEBSCSIAddon,
dnsControllerAddon,
Expand All @@ -287,10 +271,8 @@ func TestMinimal_v1_27(t *testing.T) {
}

// TestMinimal runs the test on a minimum configuration
func TestMinimal_v1_28(t *testing.T) {
t.Setenv("KOPS_RUN_TOO_NEW_VERSION", "1")

newIntegrationTest("minimal.example.com", "minimal-1.28").
func TestMinimal_v1_30(t *testing.T) {
newIntegrationTest("minimal.example.com", "minimal-1.30").
withAddons(
awsEBSCSIAddon,
dnsControllerAddon,
Expand All @@ -300,10 +282,8 @@ func TestMinimal_v1_28(t *testing.T) {
}

// TestMinimal runs the test on a minimum configuration
func TestMinimal_v1_29(t *testing.T) {
t.Setenv("KOPS_RUN_TOO_NEW_VERSION", "1")

newIntegrationTest("minimal.example.com", "minimal-1.29").
func TestMinimal_v1_31(t *testing.T) {
newIntegrationTest("minimal.example.com", "minimal-1.31").
withAddons(
awsEBSCSIAddon,
dnsControllerAddon,
Expand All @@ -313,10 +293,8 @@ func TestMinimal_v1_29(t *testing.T) {
}

// TestMinimal runs the test on a minimum configuration
func TestMinimal_v1_30(t *testing.T) {
t.Setenv("KOPS_RUN_TOO_NEW_VERSION", "1")

newIntegrationTest("minimal.example.com", "minimal-1.30").
func TestMinimal_v1_32(t *testing.T) {
newIntegrationTest("minimal.example.com", "minimal-1.32").
withAddons(
awsEBSCSIAddon,
dnsControllerAddon,
Expand All @@ -327,8 +305,6 @@ func TestMinimal_v1_30(t *testing.T) {

// TestMinimal_NoneDNS runs the test on a minimum configuration with --dns=none
func TestMinimal_NoneDNS(t *testing.T) {
t.Setenv("KOPS_RUN_TOO_NEW_VERSION", "1")

newIntegrationTest("minimal.example.com", "minimal-dns-none").
withAddons(
awsEBSCSIAddon,
Expand Down Expand Up @@ -538,30 +514,30 @@ func TestExternalPolicies(t *testing.T) {
// TestMinimalIPv6 runs the test on a minimum IPv6 configuration
func TestMinimalIPv6(t *testing.T) {
newIntegrationTest("minimal-ipv6.example.com", "minimal-ipv6").
withDefaultAddons24().
withDefaultAddons30().
runTestTerraformAWS(t)
}

// TestMinimalIPv6Calico runs the test on a minimum IPv6 configuration with Calico
func TestMinimalIPv6Calico(t *testing.T) {
newIntegrationTest("minimal-ipv6.example.com", "minimal-ipv6-calico").
withDefaultAddons24().
withDefaultAddons30().
withAddons(calicoAddon).
runTestTerraformAWS(t)
}

// TestMinimalIPv6Cilium runs the test on a minimum IPv6 configuration with Cilium
func TestMinimalIPv6Cilium(t *testing.T) {
newIntegrationTest("minimal-ipv6.example.com", "minimal-ipv6-cilium").
withDefaultAddons24().
withDefaultAddons30().
withAddons(ciliumAddon).
runTestTerraformAWS(t)
}

// TestMinimalIPv6NoSubnetPrefix runs the test with "/64#N" subnet notation
func TestMinimalIPv6NoSubnetPrefix(t *testing.T) {
newIntegrationTest("minimal-ipv6.example.com", "minimal-ipv6-no-subnet-prefix").
withDefaultAddons24().
withDefaultAddons30().
runTestTerraformAWS(t)
}

Expand Down Expand Up @@ -637,7 +613,7 @@ func TestBastionAdditionalUserData(t *testing.T) {
func TestPrivateFlannel(t *testing.T) {
newIntegrationTest("privateflannel.example.com", "privateflannel").
withPrivate().
withDefaultAddons24().
withDefaultAddons30().
withAddons(flannelAddon).
runTestTerraformAWS(t)
}
Expand All @@ -646,7 +622,7 @@ func TestPrivateFlannel(t *testing.T) {
func TestPrivateCalico(t *testing.T) {
newIntegrationTest("privatecalico.example.com", "privatecalico").
withPrivate().
withDefaultAddons24().
withDefaultAddons30().
withAddons(calicoAddon).
runTestTerraformAWS(t)
}
Expand Down Expand Up @@ -702,7 +678,7 @@ func TestPrivateCiliumENI(t *testing.T) {
func TestPrivateCanal(t *testing.T) {
newIntegrationTest("privatecanal.example.com", "privatecanal").
withPrivate().
withDefaultAddons24().
withDefaultAddons30().
withAddons(canalAddon).
runTestTerraformAWS(t)
}
Expand Down Expand Up @@ -861,57 +837,7 @@ func TestManyAddonsCCMIRSA(t *testing.T) {
runTestTerraformAWS(t)
}

func TestManyAddonsCCMIRSA25(t *testing.T) {
newIntegrationTest("minimal.example.com", "many-addons-ccm-irsa25").
withOIDCDiscovery().
withServiceAccountRole("aws-load-balancer-controller.kube-system", true).
withServiceAccountRole("dns-controller.kube-system", true).
withServiceAccountRole("aws-cloud-controller-manager.kube-system", true).
withServiceAccountRole("cluster-autoscaler.kube-system", true).
withServiceAccountRole("ebs-csi-controller-sa.kube-system", true).
withServiceAccountRole("aws-node-termination-handler.kube-system", true).
withAddons(
"aws-load-balancer-controller.addons.k8s.io-k8s-1.19",
"aws-ebs-csi-driver.addons.k8s.io-k8s-1.17",
"certmanager.io-k8s-1.16",
"cluster-autoscaler.addons.k8s.io-k8s-1.15",
"networking.amazon-vpc-routed-eni-k8s-1.16",
"snapshot-controller.addons.k8s.io-k8s-1.20",
"aws-cloud-controller.addons.k8s.io-k8s-1.18",
leaderElectionAddon,
metricsServerAddon,
dnsControllerAddon,
).
runTestTerraformAWS(t)
}

func TestManyAddonsCCMIRSA26(t *testing.T) {
t.Setenv("KOPS_RUN_TOO_NEW_VERSION", "1")
newIntegrationTest("minimal.example.com", "many-addons-ccm-irsa26").
withOIDCDiscovery().
withServiceAccountRole("aws-load-balancer-controller.kube-system", true).
withServiceAccountRole("dns-controller.kube-system", true).
withServiceAccountRole("aws-cloud-controller-manager.kube-system", true).
withServiceAccountRole("cluster-autoscaler.kube-system", true).
withServiceAccountRole("ebs-csi-controller-sa.kube-system", true).
withServiceAccountRole("aws-node-termination-handler.kube-system", true).
withAddons(
"aws-load-balancer-controller.addons.k8s.io-k8s-1.19",
"aws-ebs-csi-driver.addons.k8s.io-k8s-1.17",
"certmanager.io-k8s-1.16",
"cluster-autoscaler.addons.k8s.io-k8s-1.15",
"networking.amazon-vpc-routed-eni-k8s-1.16",
"snapshot-controller.addons.k8s.io-k8s-1.20",
"aws-cloud-controller.addons.k8s.io-k8s-1.18",
"nodelocaldns.addons.k8s.io-k8s-1.12",
metricsServerAddon,
dnsControllerAddon,
).
runTestTerraformAWS(t)
}

func TestManyAddonsGCE(t *testing.T) {
t.Setenv("KOPS_RUN_TOO_NEW_VERSION", "1")
newIntegrationTest("minimal.example.com", "many-addons-gce").
withAddons(
certManagerAddon,
Expand Down Expand Up @@ -1007,7 +933,7 @@ func TestSharedVPC(t *testing.T) {
// TestSharedVPCIPv6 runs the test on a configuration with a shared VPC using IPv6
func TestSharedVPCIPv6(t *testing.T) {
newIntegrationTest("minimal-ipv6.example.com", "shared_vpc_ipv6").
withDefaultAddons24().
withDefaultAddons30().
runTestTerraformAWS(t)
}

Expand Down Expand Up @@ -1527,6 +1453,8 @@ func storeKeyset(t *testing.T, ctx context.Context, keyStore fi.Keystore, name s
}

func (i *integrationTest) runTestTerraformAWS(t *testing.T) {
t.Setenv("KOPS_RUN_TOO_NEW_VERSION", "1")

ctx := testcontext.ForTest(t)
h := testutils.NewIntegrationTestHarness(t)
defer h.Close()
Expand Down Expand Up @@ -1615,6 +1543,8 @@ func (i *integrationTest) runTestTerraformAWS(t *testing.T) {
}

func (i *integrationTest) runTestPhase(t *testing.T, phase cloudup.Phase) {
t.Setenv("KOPS_RUN_TOO_NEW_VERSION", "1")

ctx := testcontext.ForTest(t)
h := testutils.NewIntegrationTestHarness(t)
defer h.Close()
Expand Down Expand Up @@ -1660,6 +1590,8 @@ func (i *integrationTest) runTestPhase(t *testing.T, phase cloudup.Phase) {
}

func (i *integrationTest) runTestTerraformGCE(t *testing.T) {
t.Setenv("KOPS_RUN_TOO_NEW_VERSION", "1")

ctx := testcontext.ForTest(t)
h := testutils.NewIntegrationTestHarness(t)
defer h.Close()
Expand Down Expand Up @@ -1688,8 +1620,8 @@ func (i *integrationTest) runTestTerraformGCE(t *testing.T) {
"aws_s3_object_"+i.clusterName+"-addons-kops-controller.addons.k8s.io-k8s-1.16_content",
"aws_s3_object_"+i.clusterName+"-addons-kubelet-api.rbac.addons.k8s.io-k8s-1.9_content",
"aws_s3_object_"+i.clusterName+"-addons-limit-range.addons.k8s.io_content",
"aws_s3_object_"+i.clusterName+"-addons-metadata-proxy.addons.k8s.io-v0.1.12_content",
"aws_s3_object_"+i.clusterName+"-addons-storage-gce.addons.k8s.io-v1.7.0_content")
"aws_s3_object_"+i.clusterName+"-addons-storage-gce.addons.k8s.io-v1.7.0_content",
)

for j := 0; j < i.zones; j++ {
zone := "us-test1-" + string([]byte{byte('a') + byte(j)})
Expand All @@ -1710,6 +1642,8 @@ func (i *integrationTest) runTestTerraformGCE(t *testing.T) {
}

func (i *integrationTest) runTestTerraformHetzner(t *testing.T) {
t.Setenv("KOPS_RUN_TOO_NEW_VERSION", "1")

ctx := testcontext.ForTest(t)
h := testutils.NewIntegrationTestHarness(t)
defer h.Close()
Expand Down Expand Up @@ -1743,6 +1677,8 @@ func (i *integrationTest) runTestTerraformHetzner(t *testing.T) {
}

func (i *integrationTest) runTestTerraformScaleway(t *testing.T) {
t.Setenv("KOPS_RUN_TOO_NEW_VERSION", "1")

featureflag.ParseFlags("+Scaleway")
unsetFeatureFlags := func() {
featureflag.ParseFlags("-Scaleway")
Expand Down
10 changes: 4 additions & 6 deletions cmd/kops/lifecycle_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ func runLifecycleTestAWS(o *LifecycleTestOptions) {
o.AddDefaults()

t := o.t
t.Setenv("KOPS_RUN_TOO_NEW_VERSION", "1")

h := testutils.NewIntegrationTestHarness(o.t)
defer h.Close()
Expand Down Expand Up @@ -401,16 +402,12 @@ func runLifecycleTestOpenstack(o *LifecycleTestOptions) {
o.AddDefaults()

t := o.t
t.Setenv("KOPS_RUN_TOO_NEW_VERSION", "1")
t.Setenv("OS_REGION_NAME", "us-test1")

h := testutils.NewIntegrationTestHarness(o.t)
defer h.Close()

origRegion := os.Getenv("OS_REGION_NAME")
os.Setenv("OS_REGION_NAME", "us-test1")
defer func() {
os.Setenv("OS_REGION_NAME", origRegion)
}()

h.MockKopsVersion("1.21.0-alpha.1")
cloud := testutils.SetupMockOpenstack()

Expand Down Expand Up @@ -459,6 +456,7 @@ func runLifecycleTestGCE(o *LifecycleTestOptions) {
o.AddDefaults()

t := o.t
t.Setenv("KOPS_RUN_TOO_NEW_VERSION", "1")

h := testutils.NewIntegrationTestHarness(o.t)
defer h.Close()
Expand Down
Loading

0 comments on commit eb170d2

Please sign in to comment.