From 582d4d44b94b0cfefa1fda3ae7be9c22486fd36f Mon Sep 17 00:00:00 2001 From: Jimmi Dyson Date: Wed, 15 May 2024 14:44:57 +0100 Subject: [PATCH] feat: Bump sigs.k8s.io/cluster-api to v1.7.2 Including updating `clusterctl`. --- api/go.mod | 2 +- api/go.sum | 4 ++-- ...r-api-runtime-extensions-nutanix.code-workspace | 1 + common/go.mod | 4 ++-- common/go.sum | 8 ++++---- go.mod | 4 ++-- go.sum | 8 ++++---- hack/flakes/flake.lock | 6 +++--- hack/flakes/flake.nix | 4 ++-- .../lifecycle/clusterautoscaler/template.go | 5 ++++- test/e2e/e2e_suite_test.go | 5 ++++- test/e2e/ownerreference_helpers.go | 14 +++++++++++++- test/e2e/quick_start_test.go | 7 +++++-- 13 files changed, 47 insertions(+), 25 deletions(-) diff --git a/api/go.mod b/api/go.mod index d262be24a..e26f1cc04 100644 --- a/api/go.mod +++ b/api/go.mod @@ -18,7 +18,7 @@ require ( k8s.io/apiextensions-apiserver v0.29.3 k8s.io/apimachinery v0.29.3 k8s.io/utils v0.0.0-20231127182322-b307cd553661 - sigs.k8s.io/cluster-api v1.7.1 + sigs.k8s.io/cluster-api v1.7.2 sigs.k8s.io/controller-runtime v0.17.3 ) diff --git a/api/go.sum b/api/go.sum index 93f8367ee..8242dcd37 100644 --- a/api/go.sum +++ b/api/go.sum @@ -220,8 +220,8 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= k8s.io/utils v0.0.0-20231127182322-b307cd553661 h1:FepOBzJ0GXm8t0su67ln2wAZjbQ6RxQGZDnzuLcrUTI= k8s.io/utils v0.0.0-20231127182322-b307cd553661/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -sigs.k8s.io/cluster-api v1.7.1 h1:JkMAbAMzBM+WBHxXLTJXTiCisv1PAaHRzld/3qrmLYY= -sigs.k8s.io/cluster-api v1.7.1/go.mod h1:V9ZhKLvQtsDODwjXOKgbitjyCmC71yMBwDcMyNNIov0= +sigs.k8s.io/cluster-api v1.7.2 h1:bRE8zoao7ajuLC0HijqfZVcubKQCPlZ04HMgcA53FGE= +sigs.k8s.io/cluster-api v1.7.2/go.mod h1:V9ZhKLvQtsDODwjXOKgbitjyCmC71yMBwDcMyNNIov0= sigs.k8s.io/controller-runtime v0.17.3 h1:65QmN7r3FWgTxDMz9fvGnO1kbf2nu+acg9p2R9oYYYk= sigs.k8s.io/controller-runtime v0.17.3/go.mod h1:N0jpP5Lo7lMTF9aL56Z/B2oWBJjey6StQM0jRbKQXtY= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= diff --git a/cluster-api-runtime-extensions-nutanix.code-workspace b/cluster-api-runtime-extensions-nutanix.code-workspace index ab34edc33..9c3f9a9b3 100644 --- a/cluster-api-runtime-extensions-nutanix.code-workspace +++ b/cluster-api-runtime-extensions-nutanix.code-workspace @@ -24,5 +24,6 @@ "url": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" }, ], + "ginkgotestexplorer.buildTags": "e2e", }, } diff --git a/common/go.mod b/common/go.mod index 970d24c42..edd2821e7 100644 --- a/common/go.mod +++ b/common/go.mod @@ -22,8 +22,8 @@ require ( k8s.io/apiextensions-apiserver v0.29.3 k8s.io/apimachinery v0.29.3 k8s.io/utils v0.0.0-20231127182322-b307cd553661 - sigs.k8s.io/cluster-api v1.7.1 - sigs.k8s.io/cluster-api/test v1.7.1 + sigs.k8s.io/cluster-api v1.7.2 + sigs.k8s.io/cluster-api/test v1.7.2 sigs.k8s.io/controller-runtime v0.17.3 ) diff --git a/common/go.sum b/common/go.sum index 53e5563d1..f37ac5bba 100644 --- a/common/go.sum +++ b/common/go.sum @@ -283,10 +283,10 @@ k8s.io/utils v0.0.0-20231127182322-b307cd553661 h1:FepOBzJ0GXm8t0su67ln2wAZjbQ6R k8s.io/utils v0.0.0-20231127182322-b307cd553661/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.28.0 h1:TgtAeesdhpm2SGwkQasmbeqDo8th5wOBA5h/AjTKA4I= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.28.0/go.mod h1:VHVDI/KrK4fjnV61bE2g3sA7tiETLn8sooImelsCx3Y= -sigs.k8s.io/cluster-api v1.7.1 h1:JkMAbAMzBM+WBHxXLTJXTiCisv1PAaHRzld/3qrmLYY= -sigs.k8s.io/cluster-api v1.7.1/go.mod h1:V9ZhKLvQtsDODwjXOKgbitjyCmC71yMBwDcMyNNIov0= -sigs.k8s.io/cluster-api/test v1.7.1 h1:QDru2586ZjIFBTW1Z7VVXVtauzR/yANm4tglUNLm9iE= -sigs.k8s.io/cluster-api/test v1.7.1/go.mod h1:yG0g5Mdq73fMn9JP4akgRQPSne973L+Qx6iVH+LjtSM= +sigs.k8s.io/cluster-api v1.7.2 h1:bRE8zoao7ajuLC0HijqfZVcubKQCPlZ04HMgcA53FGE= +sigs.k8s.io/cluster-api v1.7.2/go.mod h1:V9ZhKLvQtsDODwjXOKgbitjyCmC71yMBwDcMyNNIov0= +sigs.k8s.io/cluster-api/test v1.7.2 h1:muacGu5G/DGz2uTv3CUxml2QLi8fxbIra4CxA2S31KE= +sigs.k8s.io/cluster-api/test v1.7.2/go.mod h1:yG0g5Mdq73fMn9JP4akgRQPSne973L+Qx6iVH+LjtSM= sigs.k8s.io/controller-runtime v0.17.3 h1:65QmN7r3FWgTxDMz9fvGnO1kbf2nu+acg9p2R9oYYYk= sigs.k8s.io/controller-runtime v0.17.3/go.mod h1:N0jpP5Lo7lMTF9aL56Z/B2oWBJjey6StQM0jRbKQXtY= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= diff --git a/go.mod b/go.mod index c65cc6a17..c0b7249d2 100644 --- a/go.mod +++ b/go.mod @@ -33,8 +33,8 @@ require ( k8s.io/klog/v2 v2.120.1 k8s.io/kubelet v0.29.3 k8s.io/utils v0.0.0-20240102154912-e7106e64919e - sigs.k8s.io/cluster-api v1.7.1 - sigs.k8s.io/cluster-api/test v1.7.1 + sigs.k8s.io/cluster-api v1.7.2 + sigs.k8s.io/cluster-api/test v1.7.2 sigs.k8s.io/controller-runtime v0.17.3 sigs.k8s.io/yaml v1.4.0 ) diff --git a/go.sum b/go.sum index fe9a0b184..ccafe306a 100644 --- a/go.sum +++ b/go.sum @@ -429,10 +429,10 @@ k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCf k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.28.0 h1:TgtAeesdhpm2SGwkQasmbeqDo8th5wOBA5h/AjTKA4I= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.28.0/go.mod h1:VHVDI/KrK4fjnV61bE2g3sA7tiETLn8sooImelsCx3Y= -sigs.k8s.io/cluster-api v1.7.1 h1:JkMAbAMzBM+WBHxXLTJXTiCisv1PAaHRzld/3qrmLYY= -sigs.k8s.io/cluster-api v1.7.1/go.mod h1:V9ZhKLvQtsDODwjXOKgbitjyCmC71yMBwDcMyNNIov0= -sigs.k8s.io/cluster-api/test v1.7.1 h1:QDru2586ZjIFBTW1Z7VVXVtauzR/yANm4tglUNLm9iE= -sigs.k8s.io/cluster-api/test v1.7.1/go.mod h1:yG0g5Mdq73fMn9JP4akgRQPSne973L+Qx6iVH+LjtSM= +sigs.k8s.io/cluster-api v1.7.2 h1:bRE8zoao7ajuLC0HijqfZVcubKQCPlZ04HMgcA53FGE= +sigs.k8s.io/cluster-api v1.7.2/go.mod h1:V9ZhKLvQtsDODwjXOKgbitjyCmC71yMBwDcMyNNIov0= +sigs.k8s.io/cluster-api/test v1.7.2 h1:muacGu5G/DGz2uTv3CUxml2QLi8fxbIra4CxA2S31KE= +sigs.k8s.io/cluster-api/test v1.7.2/go.mod h1:yG0g5Mdq73fMn9JP4akgRQPSne973L+Qx6iVH+LjtSM= sigs.k8s.io/controller-runtime v0.17.3 h1:65QmN7r3FWgTxDMz9fvGnO1kbf2nu+acg9p2R9oYYYk= sigs.k8s.io/controller-runtime v0.17.3/go.mod h1:N0jpP5Lo7lMTF9aL56Z/B2oWBJjey6StQM0jRbKQXtY= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= diff --git a/hack/flakes/flake.lock b/hack/flakes/flake.lock index c26d95c24..d9f9c31ad 100644 --- a/hack/flakes/flake.lock +++ b/hack/flakes/flake.lock @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1715037484, - "narHash": "sha256-OUt8xQFmBU96Hmm4T9tOWTu4oCswCzoVl+pxSq/kiFc=", + "lastModified": 1715653339, + "narHash": "sha256-7lR9tpVXviSccl07GXI0+ve/natd24HAkuy1sQp0OlI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ad7efee13e0d216bf29992311536fce1d3eefbef", + "rev": "abd6d48f8c77bea7dc51beb2adfa6ed3950d2585", "type": "github" }, "original": { diff --git a/hack/flakes/flake.nix b/hack/flakes/flake.nix index f1d72cc65..6ccb9dc50 100644 --- a/hack/flakes/flake.nix +++ b/hack/flakes/flake.nix @@ -112,13 +112,13 @@ clusterctl = buildGo122Module rec { pname = "clusterctl"; - version = "1.7.1"; + version = "1.7.2"; src = fetchFromGitHub { owner = "kubernetes-sigs"; repo = "cluster-api"; rev = "v${version}"; - hash = "sha256-e+Ut6xoNUY9cJjjJ43P0siEa+G1igllcb8veirk1UX0="; + hash = "sha256-ZZkDc5INjUoNc9zcwbOa9WRIkkLr9bm3mohsSe3tKI4="; }; doCheck = false; subPackages = [ "cmd/clusterctl" ]; diff --git a/pkg/handlers/generic/lifecycle/clusterautoscaler/template.go b/pkg/handlers/generic/lifecycle/clusterautoscaler/template.go index 2b0341efa..ac85aac41 100644 --- a/pkg/handlers/generic/lifecycle/clusterautoscaler/template.go +++ b/pkg/handlers/generic/lifecycle/clusterautoscaler/template.go @@ -45,7 +45,10 @@ func templateValues(cluster *clusterv1.Cluster, text string) (string, error) { var b bytes.Buffer err = clusterAutoscalerTemplate.Execute(&b, templateInput) if err != nil { - return "", fmt.Errorf("failed setting target Cluster name and namespace in template: %w", err) + return "", fmt.Errorf( + "failed setting target Cluster name and namespace in template: %w", + err, + ) } return b.String(), nil diff --git a/test/e2e/e2e_suite_test.go b/test/e2e/e2e_suite_test.go index e9ca48f92..a6bf4844d 100644 --- a/test/e2e/e2e_suite_test.go +++ b/test/e2e/e2e_suite_test.go @@ -76,7 +76,10 @@ func init() { func TestE2E(t *testing.T) { ctrl.SetLogger(klog.Background()) RegisterFailHandler(Fail) - RunSpecs(t, "caren-e2e") + suiteConfig, reporterConfig := GinkgoConfiguration() + suiteConfig.LabelFilter = "provider:Docker && cni:Cilium && addonStrategy:ClusterResourceSet" + suiteConfig.FocusStrings = []string{"Quick start"} + RunSpecs(t, "caren-e2e", suiteConfig, reporterConfig) } // Using a SynchronizedBeforeSuite for controlling how to create resources shared across ParallelNodes (~ginkgo diff --git a/test/e2e/ownerreference_helpers.go b/test/e2e/ownerreference_helpers.go index a810871e6..9e67d6208 100644 --- a/test/e2e/ownerreference_helpers.go +++ b/test/e2e/ownerreference_helpers.go @@ -40,7 +40,8 @@ const ( helmChartProxyKind = "HelmChartProxy" helmReleaseProxyKind = "HelmReleaseProxy" - secretKind = "Secret" + secretKind = "Secret" + configMapKind = "ConfigMap" ) var ( @@ -158,11 +159,22 @@ var ( // NutanixClusterTemplate must be owned by a ClusterClass. return framework.HasExactOwners(owners, clusterClassOwner) }, + } + + // KubernetesReferenceAssertions maps Kubernetes types to functions which return an error if the passed OwnerReferences + // aren't as expected. + // Note: These relationships are documented in + // https://github.com/kubernetes-sigs/cluster-api/tree/main/docs/book/src/reference/owner_references.md. + KubernetesReferenceAssertions = map[string]func([]metav1.OwnerReference) error{ secretKind: func(owners []metav1.OwnerReference) error { // TODO:deepakm-ntnx Currently pc-creds, pc-creds-for-csi, dockerhub-credentials // and registry-creds have unexpected owners which needs more investigation return nil }, + configMapKind: func(owners []metav1.OwnerReference) error { + // The only configMaps considered here are those owned by a ClusterResourceSet. + return framework.HasExactOwners(owners, clusterResourceSetOwner) + }, } ) diff --git a/test/e2e/quick_start_test.go b/test/e2e/quick_start_test.go index 1bdfab19e..4dc061ca3 100644 --- a/test/e2e/quick_start_test.go +++ b/test/e2e/quick_start_test.go @@ -13,6 +13,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "k8s.io/utils/ptr" + clusterctlcluster "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" capie2e "sigs.k8s.io/cluster-api/test/e2e" "sigs.k8s.io/cluster-api/test/framework" @@ -85,15 +86,17 @@ var _ = Describe("Quick start", Serial, func() { framework.AssertOwnerReferences( namespace, proxy.GetKubeconfigPath(), + clusterctlcluster.FilterClusterObjectsWithNameFilter( + clusterName, + ), framework.CoreOwnerReferenceAssertion, - framework.ExpOwnerReferenceAssertions, framework.DockerInfraOwnerReferenceAssertions, framework.KubeadmBootstrapOwnerReferenceAssertions, framework.KubeadmControlPlaneOwnerReferenceAssertions, framework.KubernetesReferenceAssertions, - AWSInfraOwnerReferenceAssertions, NutanixInfraOwnerReferenceAssertions, AddonReferenceAssertions, + KubernetesReferenceAssertions, ) By("Waiting until nodes are ready")