Skip to content

Commit

Permalink
drop cgroupfs template
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriziopandini committed Jun 27, 2023
1 parent 917dd69 commit 5541ee1
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 76 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,6 @@ generate-e2e-templates-main: $(KUSTOMIZE)
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-machine-pool --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-machine-pool.yaml
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-node-drain --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-node-drain.yaml
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-upgrades --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-upgrades.yaml
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-upgrades-cgroupfs --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-upgrades-cgroupfs.yaml
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-upgrades-runtimesdk --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-upgrades-runtimesdk.yaml
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-kcp-scale-in --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-kcp-scale-in.yaml
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-ipv6 --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-ipv6.yaml
Expand Down
27 changes: 1 addition & 26 deletions test/e2e/cluster_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,45 +20,20 @@ limitations under the License.
package e2e

import (
"github.com/blang/semver"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"k8s.io/utils/pointer"
)

var _ = Describe("When upgrading a workload cluster using ClusterClass and testing K8S conformance [Conformance] [K8s-Upgrade] [ClusterClass]", func() {
ClusterUpgradeConformanceSpec(ctx, func() ClusterUpgradeConformanceSpecInput {
// "upgrades" is the same as the "topology" flavor but with an additional MachinePool.
flavor := pointer.String("upgrades")
// For KubernetesVersionUpgradeFrom < v1.24 we have to use upgrades-cgroupfs flavor.
// This is because kind and CAPD only support:
// * cgroupDriver cgroupfs for Kubernetes < v1.24
// * cgroupDriver systemd for Kubernetes >= v1.24.
// Notes:
// * We always use a ClusterClass-based cluster-template for the upgrade test
// * The ClusterClass will automatically adjust the cgroupDriver for KCP and MDs.
// * We have to handle the MachinePool ourselves
// * The upgrades-cgroupfs flavor uses an MP which is pinned to cgroupfs
// * During the upgrade UpgradeMachinePoolAndWait automatically drops the cgroupfs pinning
// when the target version is >= v1.24.
// We can remove this as soon as we don't test upgrades from Kubernetes < v1.24 anymore with CAPD
// or MachinePools are supported in ClusterClass.
version, err := semver.ParseTolerant(e2eConfig.GetVariable(KubernetesVersionUpgradeFrom))
Expect(err).ToNot(HaveOccurred(), "Invalid argument, KUBERNETES_VERSION_UPGRADE_FROM is not a valid version")
if version.LT(semver.MustParse("1.24.0")) {
// "upgrades-cgroupfs" is the same as the "topology" flavor but with an additional MachinePool
// with pinned cgroupDriver to cgroupfs.
flavor = pointer.String("upgrades-cgroupfs")
}

return ClusterUpgradeConformanceSpecInput{
E2EConfig: e2eConfig,
ClusterctlConfigPath: clusterctlConfigPath,
BootstrapClusterProxy: bootstrapClusterProxy,
ArtifactFolder: artifactFolder,
SkipCleanup: skipCleanup,
Flavor: flavor,
InfrastructureProvider: pointer.String("docker"),
Flavor: pointer.String("upgrades"),
}
})
})
Expand Down
1 change: 0 additions & 1 deletion test/e2e/config/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ providers:
- sourcePath: "../data/infrastructure-docker/main/cluster-template-machine-pool.yaml"
- sourcePath: "../data/infrastructure-docker/main/cluster-template-node-drain.yaml"
- sourcePath: "../data/infrastructure-docker/main/cluster-template-upgrades.yaml"
- sourcePath: "../data/infrastructure-docker/main/cluster-template-upgrades-cgroupfs.yaml"
- sourcePath: "../data/infrastructure-docker/main/cluster-template-upgrades-runtimesdk.yaml"
- sourcePath: "../data/infrastructure-docker/main/cluster-template-kcp-scale-in.yaml"
- sourcePath: "../data/infrastructure-docker/main/cluster-template-ipv6.yaml"
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

19 changes: 0 additions & 19 deletions test/framework/machinepool_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ package framework
import (
"context"
"fmt"
"strings"
"time"

"github.com/blang/semver"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/pkg/errors"
Expand Down Expand Up @@ -151,23 +149,6 @@ func UpgradeMachinePoolAndWait(ctx context.Context, input UpgradeMachinePoolAndW
// Upgrade to new Version.
mp.Spec.Template.Spec.Version = &input.UpgradeVersion

// Drop "-cgroupfs" suffix from BootstrapConfig ref name, i.e. we switch from a
// BootstrapConfig with pinned cgroupfs cgroupDriver to the regular BootstrapConfig.
// This is a workaround for CAPD, because kind and CAPD only support:
// * cgroupDriver cgroupfs for Kubernetes < v1.24
// * cgroupDriver systemd for Kubernetes >= v1.24.
// We can remove this as soon as we don't test upgrades from Kubernetes < v1.24 anymore with CAPD
// or MachinePools are supported in ClusterClass.
if mp.Spec.Template.Spec.InfrastructureRef.Kind == "DockerMachinePool" {
version, err := semver.ParseTolerant(input.UpgradeVersion)
Expect(err).ToNot(HaveOccurred(), fmt.Sprintf("Failed to parse UpgradeVersion %q", input.UpgradeVersion))
if version.GTE(semver.MustParse("1.24.0")) && strings.HasSuffix(mp.Spec.Template.Spec.Bootstrap.ConfigRef.Name, "-cgroupfs") {
mp.Spec.Template.Spec.Bootstrap.ConfigRef.Name = strings.TrimSuffix(mp.Spec.Template.Spec.Bootstrap.ConfigRef.Name, "-cgroupfs")
// We have to set DataSecretName to nil, so the secret of the new bootstrap ConfigRef gets picked up.
mp.Spec.Template.Spec.Bootstrap.DataSecretName = nil
}
}

Eventually(func() error {
return patchHelper.Patch(ctx, mp)
}, retryableOperationTimeout, retryableOperationInterval).Should(Succeed(), "Failed to patch the new Kubernetes version to Machine Pool %s", klog.KObj(mp))
Expand Down

0 comments on commit 5541ee1

Please sign in to comment.