From ee5fa0e29223b74dfe8152c588ee53bc1f3bd404 Mon Sep 17 00:00:00 2001 From: Stefan Bueringer Date: Wed, 6 Nov 2024 12:05:04 +0100 Subject: [PATCH 1/3] Bump to CAPI v1.9.0-beta.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stefan Büringer buringerst@vmware.com --- Makefile | 2 +- go.mod | 2 +- go.sum | 4 ++-- packaging/go.mod | 2 +- packaging/go.sum | 4 ++-- test/e2e/config/vsphere.yaml | 12 ++++++------ test/go.mod | 6 +++--- test/go.sum | 12 ++++++------ 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Makefile b/Makefile index 828c7ee190..9df7077cf6 100644 --- a/Makefile +++ b/Makefile @@ -182,7 +182,7 @@ IMPORT_BOSS_VER := v0.28.1 IMPORT_BOSS := $(abspath $(TOOLS_BIN_DIR)/$(IMPORT_BOSS_BIN)) IMPORT_BOSS_PKG := k8s.io/code-generator/cmd/import-boss -CAPI_HACK_TOOLS_VER := 5d54746e010854a1316e72733e13577d4d5695ec # Note: this is the commit ID of CAPI 5d54746e010854a1316e72733e13577d4d5695ec from 2024-10-23 +CAPI_HACK_TOOLS_VER := 180d732ac4d6931466415ac66e8603f762eb4167 # Note: this is the commit ID of CAPI v1.9.0-beta.0 BOSKOSCTL_BIN := boskosctl BOSKOSCTL := $(abspath $(TOOLS_BIN_DIR)/$(BOSKOSCTL_BIN)) diff --git a/go.mod b/go.mod index 6a7a855884..d54c6b8e37 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module sigs.k8s.io/cluster-api-provider-vsphere go 1.22.0 -replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.8.0-rc.0.0.20241022191051-5d54746e0108 +replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.9.0-beta.0 replace github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels => github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels v0.0.0-20240404200847-de75746a9505 diff --git a/go.sum b/go.sum index 6375a1acf3..1e18c04f6b 100644 --- a/go.sum +++ b/go.sum @@ -417,8 +417,8 @@ k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1 k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 h1:2770sDpzrjjsAtVhSeUFseziht227YAWYHLGNM8QPwY= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= -sigs.k8s.io/cluster-api v1.8.0-rc.0.0.20241022191051-5d54746e0108 h1:dq1LAkaJ3XIR8iPpLqgfpK+mSjnZZqqLsNZneGMmUd8= -sigs.k8s.io/cluster-api v1.8.0-rc.0.0.20241022191051-5d54746e0108/go.mod h1:7GSFeeja8jIcDaMVNJgHdxm2YDNHiKeYAzvZDscodIQ= +sigs.k8s.io/cluster-api v1.9.0-beta.0 h1:mcaPkmnpPcN9NdMAmwzhFqZt+HoJfKkneAWiZeCp0Wc= +sigs.k8s.io/cluster-api v1.9.0-beta.0/go.mod h1:LkFhFajMVWxyfuM4BShEKOSCN2lXBs/hDLQjbKoZ4XA= sigs.k8s.io/controller-runtime v0.19.1 h1:Son+Q40+Be3QWb+niBXAg2vFiYWolDjjRfO8hn/cxOk= sigs.k8s.io/controller-runtime v0.19.1/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= diff --git a/packaging/go.mod b/packaging/go.mod index eb5b9f0af0..8bf9e50ef4 100644 --- a/packaging/go.mod +++ b/packaging/go.mod @@ -2,7 +2,7 @@ module sigs.k8s.io/cluster-api-provider-vsphere/packaging go 1.22.7 -replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.8.0-rc.0.0.20241022191051-5d54746e0108 +replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.9.0-beta.0 replace sigs.k8s.io/cluster-api-provider-vsphere => ../ diff --git a/packaging/go.sum b/packaging/go.sum index bd94b35302..5a9fda9bcf 100644 --- a/packaging/go.sum +++ b/packaging/go.sum @@ -232,8 +232,8 @@ k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7F k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -sigs.k8s.io/cluster-api v1.8.0-rc.0.0.20241022191051-5d54746e0108 h1:dq1LAkaJ3XIR8iPpLqgfpK+mSjnZZqqLsNZneGMmUd8= -sigs.k8s.io/cluster-api v1.8.0-rc.0.0.20241022191051-5d54746e0108/go.mod h1:7GSFeeja8jIcDaMVNJgHdxm2YDNHiKeYAzvZDscodIQ= +sigs.k8s.io/cluster-api v1.9.0-beta.0 h1:mcaPkmnpPcN9NdMAmwzhFqZt+HoJfKkneAWiZeCp0Wc= +sigs.k8s.io/cluster-api v1.9.0-beta.0/go.mod h1:LkFhFajMVWxyfuM4BShEKOSCN2lXBs/hDLQjbKoZ4XA= sigs.k8s.io/controller-runtime v0.19.1 h1:Son+Q40+Be3QWb+niBXAg2vFiYWolDjjRfO8hn/cxOk= sigs.k8s.io/controller-runtime v0.19.1/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= diff --git a/test/e2e/config/vsphere.yaml b/test/e2e/config/vsphere.yaml index eb513b640c..c75363d73d 100644 --- a/test/e2e/config/vsphere.yaml +++ b/test/e2e/config/vsphere.yaml @@ -26,8 +26,8 @@ providers: - name: cluster-api type: CoreProvider versions: - - name: "v1.9.99" - value: "https://storage.googleapis.com/k8s-staging-cluster-api/components/nightly_main_20241023/core-components.yaml" + - name: "v1.9.0" + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.9.0-beta.0/core-components.yaml" type: "url" contract: v1beta1 files: @@ -66,8 +66,8 @@ providers: - name: kubeadm type: BootstrapProvider versions: - - name: "v1.9.99" - value: "https://storage.googleapis.com/k8s-staging-cluster-api/components/nightly_main_20241023/bootstrap-components.yaml" + - name: "v1.9.0" + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.9.0-beta.0/bootstrap-components.yaml" type: "url" contract: v1beta1 files: @@ -106,8 +106,8 @@ providers: - name: kubeadm type: ControlPlaneProvider versions: - - name: "v1.9.99" - value: "https://storage.googleapis.com/k8s-staging-cluster-api/components/nightly_main_20241023/control-plane-components.yaml" + - name: "v1.9.0" + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.9.0-beta.0/control-plane-components.yaml" type: "url" contract: v1beta1 files: diff --git a/test/go.mod b/test/go.mod index e8d4d58716..a40ac2add9 100644 --- a/test/go.mod +++ b/test/go.mod @@ -2,9 +2,9 @@ module sigs.k8s.io/cluster-api-provider-vsphere/test go 1.22.0 -replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.8.0-rc.0.0.20241022191051-5d54746e0108 +replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.9.0-beta.0 -replace sigs.k8s.io/cluster-api/test => sigs.k8s.io/cluster-api/test v1.8.0-rc.0.0.20241022191051-5d54746e0108 +replace sigs.k8s.io/cluster-api/test => sigs.k8s.io/cluster-api/test v1.9.0-beta.0 replace sigs.k8s.io/cluster-api-provider-vsphere => ../ @@ -50,7 +50,7 @@ require ( github.com/Microsoft/go-winio v0.5.0 // indirect github.com/NYTimes/gziphandler v1.1.1 // indirect github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect - github.com/adrg/xdg v0.5.1 // indirect + github.com/adrg/xdg v0.5.3 // indirect github.com/alessio/shellescape v1.4.2 // indirect github.com/antlr4-go/antlr/v4 v4.13.0 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect diff --git a/test/go.sum b/test/go.sum index 0afb2b91cc..1f9f94bc5d 100644 --- a/test/go.sum +++ b/test/go.sum @@ -21,8 +21,8 @@ github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwF github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/adrg/xdg v0.5.1 h1:Im8iDbEFARltY09yOJlSGu4Asjk2vF85+3Dyru8uJ0U= -github.com/adrg/xdg v0.5.1/go.mod h1:nlTsY+NNiCBGCK2tpm09vRqfVzrc2fLmXGpBLF0zlTQ= +github.com/adrg/xdg v0.5.3 h1:xRnxJXne7+oWDatRhR1JLnvuccuIeCoBu2rtuLqQB78= +github.com/adrg/xdg v0.5.3/go.mod h1:nlTsY+NNiCBGCK2tpm09vRqfVzrc2fLmXGpBLF0zlTQ= github.com/alessio/shellescape v1.4.2 h1:MHPfaU+ddJ0/bYWpgIeUnQUqKrlJ1S7BfEYPM4uEoM0= github.com/alessio/shellescape v1.4.2/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30= github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI= @@ -507,10 +507,10 @@ k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1 k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 h1:2770sDpzrjjsAtVhSeUFseziht227YAWYHLGNM8QPwY= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= -sigs.k8s.io/cluster-api v1.8.0-rc.0.0.20241022191051-5d54746e0108 h1:dq1LAkaJ3XIR8iPpLqgfpK+mSjnZZqqLsNZneGMmUd8= -sigs.k8s.io/cluster-api v1.8.0-rc.0.0.20241022191051-5d54746e0108/go.mod h1:7GSFeeja8jIcDaMVNJgHdxm2YDNHiKeYAzvZDscodIQ= -sigs.k8s.io/cluster-api/test v1.8.0-rc.0.0.20241022191051-5d54746e0108 h1:ZXwhzzAwn/L45gnxwUEp5/fSA4sIYy6LgPHMqzFCR+Q= -sigs.k8s.io/cluster-api/test v1.8.0-rc.0.0.20241022191051-5d54746e0108/go.mod h1:SNYIhqJ4f5Cw9fO5zT7imaRi2laIgf8xVpyRAMJM/ak= +sigs.k8s.io/cluster-api v1.9.0-beta.0 h1:mcaPkmnpPcN9NdMAmwzhFqZt+HoJfKkneAWiZeCp0Wc= +sigs.k8s.io/cluster-api v1.9.0-beta.0/go.mod h1:LkFhFajMVWxyfuM4BShEKOSCN2lXBs/hDLQjbKoZ4XA= +sigs.k8s.io/cluster-api/test v1.9.0-beta.0 h1:CNmLVsJckFqYP2UbtItv88hs/CANyAyubSq0PLE9gG4= +sigs.k8s.io/cluster-api/test v1.9.0-beta.0/go.mod h1:c84DQYINLIni0NVy7QDePCT7lpPsLi0O4T2FhUIBV78= sigs.k8s.io/controller-runtime v0.19.1 h1:Son+Q40+Be3QWb+niBXAg2vFiYWolDjjRfO8hn/cxOk= sigs.k8s.io/controller-runtime v0.19.1/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= From fb16df19de0c4fb7bc0c5cdfdd808e01f5521b2f Mon Sep 17 00:00:00 2001 From: Stefan Bueringer Date: Wed, 6 Nov 2024 12:13:00 +0100 Subject: [PATCH 2/3] Regenerate manifests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stefan Büringer buringerst@vmware.com --- ...ture.cluster.x-k8s.io_vsphereclusteridentities.yaml | 6 +++--- ...nfrastructure.cluster.x-k8s.io_vsphereclusters.yaml | 10 +++++----- ...ucture.cluster.x-k8s.io_vspheredeploymentzones.yaml | 6 +++--- ...nfrastructure.cluster.x-k8s.io_vspheremachines.yaml | 6 +++--- ...cture.cluster.x-k8s.io_vspheremachinetemplates.yaml | 2 +- .../infrastructure.cluster.x-k8s.io_vspherevms.yaml | 6 +++--- ...nfrastructure.cluster.x-k8s.io_vsphereclusters.yaml | 10 +++++----- ...nfrastructure.cluster.x-k8s.io_vspheremachines.yaml | 6 +++--- 8 files changed, 26 insertions(+), 26 deletions(-) diff --git a/config/default/crd/bases/infrastructure.cluster.x-k8s.io_vsphereclusteridentities.yaml b/config/default/crd/bases/infrastructure.cluster.x-k8s.io_vsphereclusteridentities.yaml index 5a1a3dca25..820917b973 100644 --- a/config/default/crd/bases/infrastructure.cluster.x-k8s.io_vsphereclusteridentities.yaml +++ b/config/default/crd/bases/infrastructure.cluster.x-k8s.io_vsphereclusteridentities.yaml @@ -416,16 +416,16 @@ spec: type: string severity: description: |- - Severity provides an explicit classification of Reason code, so the users or machines can immediately + severity provides an explicit classification of Reason code, so the users or machines can immediately understand the current situation and act accordingly. The Severity field MUST be set only when Status=False. type: string status: - description: Status of the condition, one of True, False, Unknown. + description: status of the condition, one of True, False, Unknown. type: string type: description: |- - Type of condition in CamelCase or in foo.example.com/CamelCase. + type of condition in CamelCase or in foo.example.com/CamelCase. Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. type: string diff --git a/config/default/crd/bases/infrastructure.cluster.x-k8s.io_vsphereclusters.yaml b/config/default/crd/bases/infrastructure.cluster.x-k8s.io_vsphereclusters.yaml index a6721e9c13..f53338efb0 100644 --- a/config/default/crd/bases/infrastructure.cluster.x-k8s.io_vsphereclusters.yaml +++ b/config/default/crd/bases/infrastructure.cluster.x-k8s.io_vsphereclusters.yaml @@ -808,16 +808,16 @@ spec: type: string severity: description: |- - Severity provides an explicit classification of Reason code, so the users or machines can immediately + severity provides an explicit classification of Reason code, so the users or machines can immediately understand the current situation and act accordingly. The Severity field MUST be set only when Status=False. type: string status: - description: Status of the condition, one of True, False, Unknown. + description: status of the condition, one of True, False, Unknown. type: string type: description: |- - Type of condition in CamelCase or in foo.example.com/CamelCase. + type of condition in CamelCase or in foo.example.com/CamelCase. Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. type: string @@ -836,11 +836,11 @@ spec: attributes: additionalProperties: type: string - description: Attributes is a free form map of attributes an + description: attributes is a free form map of attributes an infrastructure provider might use or require. type: object controlPlane: - description: ControlPlane determines if this failure domain + description: controlPlane determines if this failure domain is suitable for use by control plane machines. type: boolean type: object diff --git a/config/default/crd/bases/infrastructure.cluster.x-k8s.io_vspheredeploymentzones.yaml b/config/default/crd/bases/infrastructure.cluster.x-k8s.io_vspheredeploymentzones.yaml index e79d0b1e08..42e5e0d736 100644 --- a/config/default/crd/bases/infrastructure.cluster.x-k8s.io_vspheredeploymentzones.yaml +++ b/config/default/crd/bases/infrastructure.cluster.x-k8s.io_vspheredeploymentzones.yaml @@ -333,16 +333,16 @@ spec: type: string severity: description: |- - Severity provides an explicit classification of Reason code, so the users or machines can immediately + severity provides an explicit classification of Reason code, so the users or machines can immediately understand the current situation and act accordingly. The Severity field MUST be set only when Status=False. type: string status: - description: Status of the condition, one of True, False, Unknown. + description: status of the condition, one of True, False, Unknown. type: string type: description: |- - Type of condition in CamelCase or in foo.example.com/CamelCase. + type of condition in CamelCase or in foo.example.com/CamelCase. Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. type: string diff --git a/config/default/crd/bases/infrastructure.cluster.x-k8s.io_vspheremachines.yaml b/config/default/crd/bases/infrastructure.cluster.x-k8s.io_vspheremachines.yaml index 6c35e7dd3f..ccc8f6e33d 100644 --- a/config/default/crd/bases/infrastructure.cluster.x-k8s.io_vspheremachines.yaml +++ b/config/default/crd/bases/infrastructure.cluster.x-k8s.io_vspheremachines.yaml @@ -1490,16 +1490,16 @@ spec: type: string severity: description: |- - Severity provides an explicit classification of Reason code, so the users or machines can immediately + severity provides an explicit classification of Reason code, so the users or machines can immediately understand the current situation and act accordingly. The Severity field MUST be set only when Status=False. type: string status: - description: Status of the condition, one of True, False, Unknown. + description: status of the condition, one of True, False, Unknown. type: string type: description: |- - Type of condition in CamelCase or in foo.example.com/CamelCase. + type of condition in CamelCase or in foo.example.com/CamelCase. Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. type: string diff --git a/config/default/crd/bases/infrastructure.cluster.x-k8s.io_vspheremachinetemplates.yaml b/config/default/crd/bases/infrastructure.cluster.x-k8s.io_vspheremachinetemplates.yaml index 1cf5a58c33..aa999ab7df 100644 --- a/config/default/crd/bases/infrastructure.cluster.x-k8s.io_vspheremachinetemplates.yaml +++ b/config/default/crd/bases/infrastructure.cluster.x-k8s.io_vspheremachinetemplates.yaml @@ -798,7 +798,7 @@ spec: additionalProperties: type: string description: |- - Annotations is an unstructured key value map stored with a resource that may be + annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations diff --git a/config/default/crd/bases/infrastructure.cluster.x-k8s.io_vspherevms.yaml b/config/default/crd/bases/infrastructure.cluster.x-k8s.io_vspherevms.yaml index 079466a2f4..3610144dbc 100644 --- a/config/default/crd/bases/infrastructure.cluster.x-k8s.io_vspherevms.yaml +++ b/config/default/crd/bases/infrastructure.cluster.x-k8s.io_vspherevms.yaml @@ -1567,16 +1567,16 @@ spec: type: string severity: description: |- - Severity provides an explicit classification of Reason code, so the users or machines can immediately + severity provides an explicit classification of Reason code, so the users or machines can immediately understand the current situation and act accordingly. The Severity field MUST be set only when Status=False. type: string status: - description: Status of the condition, one of True, False, Unknown. + description: status of the condition, one of True, False, Unknown. type: string type: description: |- - Type of condition in CamelCase or in foo.example.com/CamelCase. + type of condition in CamelCase or in foo.example.com/CamelCase. Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. type: string diff --git a/config/supervisor/crd/bases/vmware.infrastructure.cluster.x-k8s.io_vsphereclusters.yaml b/config/supervisor/crd/bases/vmware.infrastructure.cluster.x-k8s.io_vsphereclusters.yaml index 84938c74fe..b66ef07794 100644 --- a/config/supervisor/crd/bases/vmware.infrastructure.cluster.x-k8s.io_vsphereclusters.yaml +++ b/config/supervisor/crd/bases/vmware.infrastructure.cluster.x-k8s.io_vsphereclusters.yaml @@ -85,16 +85,16 @@ spec: type: string severity: description: |- - Severity provides an explicit classification of Reason code, so the users or machines can immediately + severity provides an explicit classification of Reason code, so the users or machines can immediately understand the current situation and act accordingly. The Severity field MUST be set only when Status=False. type: string status: - description: Status of the condition, one of True, False, Unknown. + description: status of the condition, one of True, False, Unknown. type: string type: description: |- - Type of condition in CamelCase or in foo.example.com/CamelCase. + type of condition in CamelCase or in foo.example.com/CamelCase. Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. type: string @@ -113,11 +113,11 @@ spec: attributes: additionalProperties: type: string - description: Attributes is a free form map of attributes an + description: attributes is a free form map of attributes an infrastructure provider might use or require. type: object controlPlane: - description: ControlPlane determines if this failure domain + description: controlPlane determines if this failure domain is suitable for use by control plane machines. type: boolean type: object diff --git a/config/supervisor/crd/bases/vmware.infrastructure.cluster.x-k8s.io_vspheremachines.yaml b/config/supervisor/crd/bases/vmware.infrastructure.cluster.x-k8s.io_vspheremachines.yaml index 7f898a1191..ff131a2d18 100644 --- a/config/supervisor/crd/bases/vmware.infrastructure.cluster.x-k8s.io_vspheremachines.yaml +++ b/config/supervisor/crd/bases/vmware.infrastructure.cluster.x-k8s.io_vspheremachines.yaml @@ -205,16 +205,16 @@ spec: type: string severity: description: |- - Severity provides an explicit classification of Reason code, so the users or machines can immediately + severity provides an explicit classification of Reason code, so the users or machines can immediately understand the current situation and act accordingly. The Severity field MUST be set only when Status=False. type: string status: - description: Status of the condition, one of True, False, Unknown. + description: status of the condition, one of True, False, Unknown. type: string type: description: |- - Type of condition in CamelCase or in foo.example.com/CamelCase. + type of condition in CamelCase or in foo.example.com/CamelCase. Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. type: string From fc11ba9fe401bbbb7f0011ae567b4def80c61ca5 Mon Sep 17 00:00:00 2001 From: Stefan Bueringer Date: Wed, 6 Nov 2024 13:31:39 +0100 Subject: [PATCH 3/3] Extend vcsim controller: create default namespaces, add more Node conditions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stefan Büringer buringerst@vmware.com --- .../controllers/virtualmachine_controller.go | 26 ++++++++++++++++++- .../controllers/vmbootstrap_controller.go | 19 ++++++++++++++ .../vcsim/controllers/vspherevm_controller.go | 26 ++++++++++++++++++- 3 files changed, 69 insertions(+), 2 deletions(-) diff --git a/test/infrastructure/vcsim/controllers/virtualmachine_controller.go b/test/infrastructure/vcsim/controllers/virtualmachine_controller.go index 3c65de530c..6b9d5184d1 100644 --- a/test/infrastructure/vcsim/controllers/virtualmachine_controller.go +++ b/test/infrastructure/vcsim/controllers/virtualmachine_controller.go @@ -23,6 +23,7 @@ import ( "github.com/pkg/errors" vmoprv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2" + corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" kerrors "k8s.io/apimachinery/pkg/util/errors" @@ -138,6 +139,30 @@ func (r *VirtualMachineReconciler) Reconcile(ctx context.Context, req ctrl.Reque resourceGroup := klog.KObj(cluster).String() r.InMemoryManager.AddResourceGroup(resourceGroup) + inmemoryClient := r.InMemoryManager.GetResourceGroup(resourceGroup).GetClient() + + // Create default Namespaces. + for _, nsName := range []string{metav1.NamespaceDefault, metav1.NamespacePublic, metav1.NamespaceSystem} { + ns := &corev1.Namespace{ + ObjectMeta: metav1.ObjectMeta{ + Name: nsName, + Labels: map[string]string{ + "kubernetes.io/metadata.name": nsName, + }, + }, + } + + if err := inmemoryClient.Get(ctx, client.ObjectKeyFromObject(ns), ns); err != nil { + if !apierrors.IsNotFound(err) { + return ctrl.Result{}, errors.Wrapf(err, "failed to get %s Namespace", nsName) + } + + if err := inmemoryClient.Create(ctx, ns); err != nil && !apierrors.IsAlreadyExists(err) { + return ctrl.Result{}, errors.Wrapf(err, "failed to create %s Namespace", nsName) + } + } + } + if _, err := r.APIServerMux.WorkloadClusterByResourceGroup(resourceGroup); err != nil { l := &vcsimv1.ControlPlaneEndpointList{} if err := r.Client.List(ctx, l); err != nil { @@ -168,7 +193,6 @@ func (r *VirtualMachineReconciler) Reconcile(ctx context.Context, req ctrl.Reque // The conditionsTracker is an object stored in memory with the scope of storing conditions used for keeping // track of the provisioning process of the fake node, etcd, api server, etc for this specific virtualMachine. // (the process managed by this controller). - inmemoryClient := r.InMemoryManager.GetResourceGroup(resourceGroup).GetClient() // NOTE: The type of the in memory conditionsTracker object doesn't matter as soon as it implements Cluster API's conditions interfaces. // Unfortunately vmoprv1.VirtualMachine isn't a condition getter, so we fallback on using a infrav1.VSphereVM. conditionsTracker := &infrav1.VSphereVM{} diff --git a/test/infrastructure/vcsim/controllers/vmbootstrap_controller.go b/test/infrastructure/vcsim/controllers/vmbootstrap_controller.go index 5d690aefd9..e1298ccfc9 100644 --- a/test/infrastructure/vcsim/controllers/vmbootstrap_controller.go +++ b/test/infrastructure/vcsim/controllers/vmbootstrap_controller.go @@ -237,6 +237,25 @@ func (r *vmBootstrapReconciler) reconcileBoostrapNode(ctx context.Context, clust LastTransitionTime: metav1.Now(), Type: corev1.NodeReady, Status: corev1.ConditionTrue, + Reason: "KubeletReady", + }, + { + LastTransitionTime: metav1.Now(), + Type: corev1.NodeMemoryPressure, + Status: corev1.ConditionFalse, + Reason: "KubeletHasSufficientMemory", + }, + { + LastTransitionTime: metav1.Now(), + Type: corev1.NodeDiskPressure, + Status: corev1.ConditionFalse, + Reason: "KubeletHasNoDiskPressure", + }, + { + LastTransitionTime: metav1.Now(), + Type: corev1.NodePIDPressure, + Status: corev1.ConditionFalse, + Reason: "KubeletHasSufficientPID", }, }, }, diff --git a/test/infrastructure/vcsim/controllers/vspherevm_controller.go b/test/infrastructure/vcsim/controllers/vspherevm_controller.go index 511f93aed1..b2e9cfed19 100644 --- a/test/infrastructure/vcsim/controllers/vspherevm_controller.go +++ b/test/infrastructure/vcsim/controllers/vspherevm_controller.go @@ -22,6 +22,7 @@ import ( "path" "github.com/pkg/errors" + corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" kerrors "k8s.io/apimachinery/pkg/util/errors" @@ -141,6 +142,30 @@ func (r *VSphereVMReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( resourceGroup := klog.KObj(cluster).String() r.InMemoryManager.AddResourceGroup(resourceGroup) + inmemoryClient := r.InMemoryManager.GetResourceGroup(resourceGroup).GetClient() + + // Create default Namespaces. + for _, nsName := range []string{metav1.NamespaceDefault, metav1.NamespacePublic, metav1.NamespaceSystem} { + ns := &corev1.Namespace{ + ObjectMeta: metav1.ObjectMeta{ + Name: nsName, + Labels: map[string]string{ + "kubernetes.io/metadata.name": nsName, + }, + }, + } + + if err := inmemoryClient.Get(ctx, client.ObjectKeyFromObject(ns), ns); err != nil { + if !apierrors.IsNotFound(err) { + return ctrl.Result{}, errors.Wrapf(err, "failed to get %s Namespace", nsName) + } + + if err := inmemoryClient.Create(ctx, ns); err != nil && !apierrors.IsAlreadyExists(err) { + return ctrl.Result{}, errors.Wrapf(err, "failed to create %s Namespace", nsName) + } + } + } + if _, err := r.APIServerMux.WorkloadClusterByResourceGroup(resourceGroup); err != nil { l := &vcsimv1.ControlPlaneEndpointList{} if err := r.Client.List(ctx, l); err != nil { @@ -171,7 +196,6 @@ func (r *VSphereVMReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( // The conditionsTracker is an object stored in memory with the scope of storing conditions used for keeping // track of the provisioning process of the fake node, etcd, api server, etc for this specific vSphereVM. // (the process managed by this controller). - inmemoryClient := r.InMemoryManager.GetResourceGroup(resourceGroup).GetClient() // NOTE: The type of the in memory conditionsTracker object doesn't matter as soon as it implements Cluster API's conditions interfaces. conditionsTracker := &infrav1.VSphereVM{} if err := inmemoryClient.Get(ctx, client.ObjectKeyFromObject(vSphereVM), conditionsTracker); err != nil {