From e6dd8530c7560aca551950ee61af24cf5721e38d Mon Sep 17 00:00:00 2001 From: Kashif Khan Date: Thu, 12 Oct 2023 10:56:08 +0300 Subject: [PATCH 1/9] Add support and guarantees section --- CONTRIBUTING.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a92298e947..4c0989017e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,6 +12,7 @@ GitHub pull requests. - [Codebase](#codebase) - [Backporting](#backporting) - [Branches](#branches) + - [Support and guarantees](#support-and-guarantees) - [Contributing a Patch](#contributing-a-patch) - [Backporting a Patch](#backporting-a-patch) - [Breaking Changes](#breaking-changes) @@ -78,6 +79,56 @@ branches that minor and patch releases will be tagged. In some cases, it may be necessary to open PRs for bugfixes directly against stable branches, but this should generally not be the case. +### Support and guarantees + +Baremetal-operator maintains the most recent release/releases for all supported +APIs and contract versions. Support for this section refers to the ability to +backport and release patch versions; +[backport policy](#backporting) is defined above. + +- The API version is determined from the GroupVersion defined in the top-level + `apis/` package. + +- The EOL date of each API Version is determined from the last release available + once a new API version is published. + +| API Version | Supported Until | +| ------------ | ------------------------------------------------------------- | +| **v1alpha1** | TBD (current latest) | +| **v1beta1** | Upcoming (Proposal [PR](https://github.com/metal3-io/metal3-docs/pull/332)) | + +- For the current stable API version (v1alpha1) we support the two most recent + minor releases; older minor releases are immediately unsupported when a new + major/minor release is available. + +- Once we have v1beta1 API, we will determine support policies for older API + versions. + +- We will maintain test coverage for all supported minor releases and for one + additional release for the current stable API version in case we have to do an + emergency patch release. For example, if v0.4 and v0.3 are currently + supported, we will also maintain test coverage for v0.2 for one additional + release cycle. When v0.5 is released, tests for v0.2 will be removed. + +**Note**: Currently, BMO release branches are tested with CAPM3 integration/e2e + tests, so dropping a test for BMO release version is dependant on CAPM3 + release. As such, we might test a BMO release until we drop the test for + CAPM3. Once BMO e2e tests take over, we can follow the above policy for + dropping tests. + +| Minor Release | API Version | Supported Until | +| ------------- | ------------ | --------------------------------------------- | +| v0.4.x | **v1alpha1** | when v0.6.0 will be released | +| v0.3.x | **v1alpha1** | when v0.5.0 will be released | +| v0.2.x | **v1alpha1** | EOL since 2023-08-30 (*) | +| v0.1.x | **v1alpha1** | EOL since 2023-04-26 (*) | + +(*) Previous support policy applies, older minor releases were immediately +unsupported when a new major/minor release was available + +- Exceptions can be filed with maintainers and taken into consideration on a + case-by-case basis. + ## Contributing a Patch 1. If you haven't already done so, sign a Contributor License Agreement (see From c341b9084a630a6a70dfdcca636ac3f9da26ab1d Mon Sep 17 00:00:00 2001 From: Kashif Khan Date: Thu, 12 Oct 2023 10:58:39 +0300 Subject: [PATCH 2/9] Fix unbound variable issue in markdownlint script --- CONTRIBUTING.md | 12 ++++++------ hack/markdownlint.sh | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4c0989017e..c9b5c7353a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,7 +12,7 @@ GitHub pull requests. - [Codebase](#codebase) - [Backporting](#backporting) - [Branches](#branches) - - [Support and guarantees](#support-and-guarantees) + - [CI Support and Branch Maintenance](#ci-support-and-branch-maintenance) - [Contributing a Patch](#contributing-a-patch) - [Backporting a Patch](#backporting-a-patch) - [Breaking Changes](#breaking-changes) @@ -79,11 +79,11 @@ branches that minor and patch releases will be tagged. In some cases, it may be necessary to open PRs for bugfixes directly against stable branches, but this should generally not be the case. -### Support and guarantees +### CI Support and Branch Maintenance Baremetal-operator maintains the most recent release/releases for all supported -APIs and contract versions. Support for this section refers to the ability to -backport and release patch versions; +APIs and contract versions. Support for this section refers to CI support and +the ability to backport and release patch versions; [backport policy](#backporting) is defined above. - The API version is determined from the GroupVersion defined in the top-level @@ -92,7 +92,7 @@ backport and release patch versions; - The EOL date of each API Version is determined from the last release available once a new API version is published. -| API Version | Supported Until | +| API Version | Maintained Until | | ------------ | ------------------------------------------------------------- | | **v1alpha1** | TBD (current latest) | | **v1beta1** | Upcoming (Proposal [PR](https://github.com/metal3-io/metal3-docs/pull/332)) | @@ -116,7 +116,7 @@ backport and release patch versions; CAPM3. Once BMO e2e tests take over, we can follow the above policy for dropping tests. -| Minor Release | API Version | Supported Until | +| Minor Release | API Version | Maintained Until | | ------------- | ------------ | --------------------------------------------- | | v0.4.x | **v1alpha1** | when v0.6.0 will be released | | v0.3.x | **v1alpha1** | when v0.5.0 will be released | diff --git a/hack/markdownlint.sh b/hack/markdownlint.sh index 8115a1682a..d556b25cb5 100755 --- a/hack/markdownlint.sh +++ b/hack/markdownlint.sh @@ -20,7 +20,7 @@ else --entrypoint sh \ --workdir /workdir \ docker.io/pipelinecomponents/markdownlint:0.12.0@sha256:0b8f9fcf0410257b2f3548f67ffe25934cfc9877a618b9f85afcf345a25804a2 \ - /workdir/hack/markdownlint.sh "${@}" + /workdir/hack/markdownlint.sh "$@" fi; # $ mdl --style all -l From e2a124363448ab4fc21e282a3ce082a3dbccb197 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 21:24:11 +0000 Subject: [PATCH 3/9] :seedling: Bump github.com/golangci/golangci-lint in /hack/tools Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.55.1 to 1.55.2. - [Release notes](https://github.com/golangci/golangci-lint/releases) - [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md) - [Commits](https://github.com/golangci/golangci-lint/compare/v1.55.1...v1.55.2) --- updated-dependencies: - dependency-name: github.com/golangci/golangci-lint dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- hack/tools/go.mod | 6 +++--- hack/tools/go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hack/tools/go.mod b/hack/tools/go.mod index a772ae80ab..0888686f74 100644 --- a/hack/tools/go.mod +++ b/hack/tools/go.mod @@ -3,7 +3,7 @@ module github.com/metal3-io/baremetal-operator/tooling go 1.20 require ( - github.com/golangci/golangci-lint v1.55.1 + github.com/golangci/golangci-lint v1.55.2 sigs.k8s.io/controller-tools v0.12.1 sigs.k8s.io/kustomize/kustomize/v4 v4.5.7 ) @@ -34,7 +34,7 @@ require ( github.com/bombsimon/wsl/v3 v3.4.0 // indirect github.com/breml/bidichk v0.2.7 // indirect github.com/breml/errchkjson v0.3.6 // indirect - github.com/butuzov/ireturn v0.2.1 // indirect + github.com/butuzov/ireturn v0.2.2 // indirect github.com/butuzov/mirror v1.1.0 // indirect github.com/catenacyber/perfsprint v0.2.0 // indirect github.com/ccojocar/zxcvbn-go v1.0.1 // indirect @@ -135,7 +135,7 @@ require ( github.com/nakabonne/nestif v0.3.1 // indirect github.com/nishanths/exhaustive v0.11.0 // indirect github.com/nishanths/predeclared v0.2.2 // indirect - github.com/nunnatsa/ginkgolinter v0.14.0 // indirect + github.com/nunnatsa/ginkgolinter v0.14.1 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/pelletier/go-toml/v2 v2.0.5 // indirect diff --git a/hack/tools/go.sum b/hack/tools/go.sum index 92164acb6c..0776d9acad 100644 --- a/hack/tools/go.sum +++ b/hack/tools/go.sum @@ -98,8 +98,8 @@ github.com/breml/bidichk v0.2.7 h1:dAkKQPLl/Qrk7hnP6P+E0xOodrq8Us7+U0o4UBOAlQY= github.com/breml/bidichk v0.2.7/go.mod h1:YodjipAGI9fGcYM7II6wFvGhdMYsC5pHDlGzqvEW3tQ= github.com/breml/errchkjson v0.3.6 h1:VLhVkqSBH96AvXEyclMR37rZslRrY2kcyq+31HCsVrA= github.com/breml/errchkjson v0.3.6/go.mod h1:jhSDoFheAF2RSDOlCfhHO9KqhZgAYLyvHe7bRCX8f/U= -github.com/butuzov/ireturn v0.2.1 h1:w5Ks4tnfeFDZskGJ2x1GAkx5gaQV+kdU3NKNr3NEBzY= -github.com/butuzov/ireturn v0.2.1/go.mod h1:RfGHUvvAuFFxoHKf4Z8Yxuh6OjlCw1KvR2zM1NFHeBk= +github.com/butuzov/ireturn v0.2.2 h1:jWI36dxXwVrI+RnXDwux2IZOewpmfv930OuIRfaBUJ0= +github.com/butuzov/ireturn v0.2.2/go.mod h1:RfGHUvvAuFFxoHKf4Z8Yxuh6OjlCw1KvR2zM1NFHeBk= github.com/butuzov/mirror v1.1.0 h1:ZqX54gBVMXu78QLoiqdwpl2mgmoOJTk7s4p4o+0avZI= github.com/butuzov/mirror v1.1.0/go.mod h1:8Q0BdQU6rC6WILDiBM60DBfvV78OLJmMmixe7GF45AE= github.com/catenacyber/perfsprint v0.2.0 h1:azOocHLscPjqXVJ7Mf14Zjlkn4uNua0+Hcg1wTR6vUo= @@ -249,8 +249,8 @@ github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe h1:6RGUuS7EGotKx6 github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe/go.mod h1:gjqyPShc/m8pEMpk0a3SeagVb0kaqvhscv+i9jI5ZhQ= github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e h1:ULcKCDV1LOZPFxGZaA6TlQbiM3J2GCPnkx/bGF6sX/g= github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e/go.mod h1:Pm5KhLPA8gSnQwrQ6ukebRcapGb/BG9iUkdaiCcGHJM= -github.com/golangci/golangci-lint v1.55.1 h1:DL2j9Eeapg1N3WEkKnQFX5L40SYtjZZJjGVdyEgNrDc= -github.com/golangci/golangci-lint v1.55.1/go.mod h1:z00biPRqjo5MISKV1+RWgONf2KvrPDmfqxHpHKB6bI4= +github.com/golangci/golangci-lint v1.55.2 h1:yllEIsSJ7MtlDBwDJ9IMBkyEUz2fYE0b5B8IUgO1oP8= +github.com/golangci/golangci-lint v1.55.2/go.mod h1:H60CZ0fuqoTwlTvnbyjhpZPWp7KmsjwV2yupIMiMXbM= github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 h1:MfyDlzVjl1hoaPzPD4Gpb/QgoRfSBR0jdhwGyAWwMSA= github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg= github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca h1:kNY3/svz5T29MYHubXix4aDDuE3RWHkPvopM/EDv/MA= @@ -440,8 +440,8 @@ github.com/nishanths/exhaustive v0.11.0 h1:T3I8nUGhl/Cwu5Z2hfc92l0e04D2GEW6e0l8p github.com/nishanths/exhaustive v0.11.0/go.mod h1:RqwDsZ1xY0dNdqHho2z6X+bgzizwbLYOWnZbbl2wLB4= github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk= github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= -github.com/nunnatsa/ginkgolinter v0.14.0 h1:XQPNmw+kZz5cC/HbFK3mQutpjzAQv1dHregRA+4CGGg= -github.com/nunnatsa/ginkgolinter v0.14.0/go.mod h1:cm2xaqCUCRd7qcP4DqbVvpcyEMkuLM9CF0wY6VASohk= +github.com/nunnatsa/ginkgolinter v0.14.1 h1:khx0CqR5U4ghsscjJ+lZVthp3zjIFytRXPTaQ/TMiyA= +github.com/nunnatsa/ginkgolinter v0.14.1/go.mod h1:nY0pafUSst7v7F637e7fymaMlQqI9c0Wka2fGsDkzWg= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= From 4b8c5812fbac4fe1b7903e790f02eecfc275e196 Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Fri, 10 Nov 2023 15:39:26 +1300 Subject: [PATCH 4/9] Don't munge timestamp in structured logs, again Structured logging tools expect a POSIX timestamp. 0a887a16fb26dd26a2b372953ec8d860a3a251b5 reverted to changing the timestamp formatting only in development log mode, after 9ecf1718dfe3f785e151b6d2b5a01ba04e0a00a9 had explicitly and unconditionally set the format to ISO-8601. However, almost immediately after this, 5bf044038b17aec6c2265d325046f475bc4bb52f bumped the controller-runtime version from 0.13.1 to 0.14.5. In 0.14, the default zap options in controller-runtime changed to RFC3339 - which is the same as ISO-8601 but even worse because subsecond precision (which can be very important to debugging) is lost as well. This change explicitly restores the original default. --- main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.go b/main.go index b3db5ae35f..8ea82bf367 100644 --- a/main.go +++ b/main.go @@ -175,6 +175,8 @@ func main() { if devLogging { logOpts.Development = true logOpts.TimeEncoder = zapcore.ISO8601TimeEncoder + } else { + logOpts.TimeEncoder = zapcore.EpochTimeEncoder } ctrl.SetLogger(zap.New(zap.UseFlagOptions(&logOpts))) From 587056ea70dc03974679459f0ebf18e8aa00cafa Mon Sep 17 00:00:00 2001 From: Max Rantil Date: Fri, 3 Nov 2023 18:29:38 +0000 Subject: [PATCH 5/9] Implement Detached/Status Annotation E2E Test Validate BMH status retention across delete & recreate with annotations. --- test/e2e/basic_provisioning_test.go | 136 +++++++++++++++++++++++++++- test/e2e/config/fixture.yaml | 2 + test/e2e/config/ironic.yaml | 8 +- 3 files changed, 143 insertions(+), 3 deletions(-) diff --git a/test/e2e/basic_provisioning_test.go b/test/e2e/basic_provisioning_test.go index c3ede85444..db376a27ee 100644 --- a/test/e2e/basic_provisioning_test.go +++ b/test/e2e/basic_provisioning_test.go @@ -2,20 +2,25 @@ package e2e import ( "context" + "encoding/json" "fmt" + "time" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/cluster-api/test/framework" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/patch" + "sigs.k8s.io/controller-runtime/pkg/client" metal3api "github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1" ) -var _ = Describe("Provisioning", func() { +var _ = Describe("BMH Provisioning and Annotation Management", func() { var ( specName = "provisioning-ops" namespace *corev1.Namespace @@ -40,7 +45,7 @@ var _ = Describe("Provisioning", func() { }) }) - It("should provision and then deprovision a BMH", func() { + It("provisions a BMH, applies detached and status annotations, then deprovisions", func() { By("Creating a secret with BMH credentials") bmcCredentials := corev1.Secret{ ObjectMeta: metav1.ObjectMeta{ @@ -118,6 +123,133 @@ var _ = Describe("Provisioning", func() { State: metal3api.StateProvisioned, }, e2eConfig.GetIntervals(specName, "wait-provisioned")...) + By("Retrieving the latest BMH object") + err = clusterProxy.GetClient().Get(ctx, client.ObjectKey{ + Name: bmh.Name, + Namespace: bmh.Namespace, + }, &bmh) + Expect(err).NotTo(HaveOccurred()) + + By("Adding the detached annotation") + helper, err = patch.NewHelper(&bmh, clusterProxy.GetClient()) + Expect(err).NotTo(HaveOccurred()) + + // Add the detached annotation; "true" is used explicitly to clarify intent. + bmh.ObjectMeta.Annotations["baremetalhost.metal3.io/detached"] = "true" + + Expect(helper.Patch(ctx, &bmh)).To(Succeed()) + + By("Saving the status to a JSON string") + savedStatus := bmh.Status + statusJSON, err := json.Marshal(savedStatus) + Expect(err).NotTo(HaveOccurred()) + + By("Deleting the BMH") + // Wait for 2 seconds to allow time to confirm annotation is set + // TODO: fix this so we do not need the sleep + time.Sleep(2 * time.Second) + + err = clusterProxy.GetClient().Delete(ctx, &bmh) + Expect(err).NotTo(HaveOccurred()) + + By("Waiting for the BMH to be deleted") + Eventually(func() (string, error) { + var currentBmh metal3api.BareMetalHost + err := clusterProxy.GetClient().Get(ctx, types.NamespacedName{Name: bmh.Name, Namespace: bmh.Namespace}, ¤tBmh) + if err != nil { + if apierrors.IsNotFound(err) { + // If the BMH is not found, we assume it has been successfully deleted. + return "deleted", nil + } + // Any other error should be returned. + return "", err + } + + currentStatus := currentBmh.Status.Provisioning.State + + // If the state is 'deleting' or 'provisioned', we continue polling. + if currentStatus == "deleting" || currentStatus == "provisioned" { + return string(currentStatus), nil + } + + // Any other state is unexpected, and we stop the polling. + return "", StopTrying(fmt.Sprintf("BMH is in an unexpected state: %s", currentStatus)) + }, e2eConfig.GetIntervals(specName, "wait-deleted")...).Should(Equal("deleted")) + + By("Waiting for the secret to be deleted") + Eventually(func() bool { + err := clusterProxy.GetClient().Get(ctx, client.ObjectKey{ + Name: "bmc-credentials", + Namespace: namespace.Name, + }, &corev1.Secret{}) + return apierrors.IsNotFound(err) + }, e2eConfig.GetIntervals(specName, "wait-secret-deletion")...).Should(BeTrue()) + + By("Creating a secret with BMH credentials") + secretName := "bmc-credentials" + bmcCredentials = corev1.Secret{ + ObjectMeta: metav1.ObjectMeta{ + Name: secretName, + Namespace: namespace.Name, + }, + StringData: map[string]string{ + "username": bmcUser, + "password": bmcPassword, + }, + } + + err = clusterProxy.GetClient().Create(ctx, &bmcCredentials) + Expect(err).NotTo(HaveOccurred()) + + By("Recreating the BMH with the previously saved status in the status annotation") + bmh = metal3api.BareMetalHost{ + ObjectMeta: metav1.ObjectMeta{ + Name: specName, + Namespace: namespace.Name, + Annotations: map[string]string{ + metal3api.StatusAnnotation: string(statusJSON), + }, + }, + Spec: metal3api.BareMetalHostSpec{ + Online: true, + BMC: metal3api.BMCDetails{ + Address: bmcAddress, + CredentialsName: "bmc-credentials", + }, + BootMode: metal3api.Legacy, + BootMACAddress: bootMacAddress, + Image: &metal3api.Image{ + URL: e2eConfig.GetVariable("IMAGE_URL"), + Checksum: e2eConfig.GetVariable("IMAGE_CHECKSUM"), + }, + RootDeviceHints: &metal3api.RootDeviceHints{ + DeviceName: "/dev/vda", + }, + }, + } + + err = clusterProxy.GetClient().Create(ctx, &bmh) + Expect(err).NotTo(HaveOccurred()) + + By("Checking that the BMH goes directly to 'provisioned' state") + Eventually(func() (string, error) { + var currentBmh metal3api.BareMetalHost + err := clusterProxy.GetClient().Get(ctx, types.NamespacedName{Name: bmh.Name, Namespace: bmh.Namespace}, ¤tBmh) + if err != nil { + // Handle errors that may occur while fetching the BMH. + return "", err + } + + currentStatus := currentBmh.Status.Provisioning.State + + if currentStatus == "provisioned" || currentStatus == "" { + return string(currentStatus), nil + } + + // Any other state is unexpected, and we stop the polling. + return "", StopTrying(fmt.Sprintf("BMH should not be in '%s' state", currentStatus)) + }, e2eConfig.GetIntervals(specName, "wait-provisioned")...).Should(Equal("provisioned")) + By("Triggering the deprovisioning of the BMH") helper, err = patch.NewHelper(&bmh, clusterProxy.GetClient()) Expect(err).NotTo(HaveOccurred()) diff --git a/test/e2e/config/fixture.yaml b/test/e2e/config/fixture.yaml index 1055a59418..cda5607348 100644 --- a/test/e2e/config/fixture.yaml +++ b/test/e2e/config/fixture.yaml @@ -40,3 +40,5 @@ intervals: default/wait-provisioned: ["20s", "1s"] default/wait-deprovisioning: ["5s", "10ms"] default/wait-available: ["20s", "1s"] + default/wait-deleting: ["5s", "10ms"] + default/wait-secret-deletion: ["5s", "10ms"] diff --git a/test/e2e/config/ironic.yaml b/test/e2e/config/ironic.yaml index 339305c830..27fd40c5c5 100644 --- a/test/e2e/config/ironic.yaml +++ b/test/e2e/config/ironic.yaml @@ -23,7 +23,11 @@ variables: # Test credentials. The tests will create a BMH with these. BMC_USER: admin BMC_PASSWORD: password - BMC_ADDRESS: "ipmi://192.168.222.1:16230" + # During development, select the preferred BMC interface when running tests from the command line: + # Note: These settings are only applicable for command line executions, not when running via the ci-e2e.sh script. + # Uncomment the desired BMC_ADDRESS line: + # BMC_ADDRESS: "ipmi://192.168.222.1:16230" + BMC_ADDRESS: "redfish+http://192.168.222.1:8000/redfish/v1/Systems/bmo-e2e-0" BOOT_MAC_ADDRESS: "00:60:2f:31:81:01" IMAGE_URL: "http://192.168.222.1/cirros-0.6.2-x86_64-disk.img" IMAGE_CHECKSUM: "c8fc807773e5354afe61636071771906" @@ -42,3 +46,5 @@ intervals: default/wait-provisioning: ["20s", "1s"] default/wait-provisioned: ["5m", "1s"] default/wait-deprovisioning: ["1m", "10ms"] + default/wait-deleted: ["20s", "10ms"] + default/wait-secret-deletion: ["1m", "1s"] From f2efd140bba6e0e1a16cb3a99a1e37a59d4aa855 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 21:13:23 +0000 Subject: [PATCH 6/9] :seedling: Bump github.com/onsi/gomega from 1.29.0 to 1.30.0 Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.29.0 to 1.30.0. - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/gomega/compare/v1.29.0...v1.30.0) --- updated-dependencies: - dependency-name: github.com/onsi/gomega dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 395300d07d..9bb693bc5c 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/gophercloud/gophercloud v1.5.1-0.20230912084133-c79ed6d3b371 github.com/metal3-io/baremetal-operator/apis v0.4.0 github.com/metal3-io/baremetal-operator/pkg/hardwareutils v0.4.0 - github.com/onsi/gomega v1.29.0 + github.com/onsi/gomega v1.30.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.17.0 github.com/stretchr/testify v1.8.4 diff --git a/go.sum b/go.sum index 627d3f803e..f318943220 100644 --- a/go.sum +++ b/go.sum @@ -106,8 +106,8 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= -github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= -github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8= +github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= From 63a838299ea17f74d58dbdf6abdb908efa59e31b Mon Sep 17 00:00:00 2001 From: Huy Mai Date: Fri, 10 Nov 2023 09:17:15 +0000 Subject: [PATCH 7/9] Replace uses of kubectl and cmctl binaries in e2e --- hack/ci-e2e.sh | 5 ++- hack/e2e/ensure_cmctl.sh | 36 --------------- test/e2e/cert_manager.go | 87 ++++++++++++++++++++++++++++++++++++ test/e2e/common.go | 13 ++++++ test/e2e/config/fixture.yaml | 1 + test/e2e/config/ironic.yaml | 1 + test/e2e/e2e_suite_test.go | 36 ++++++++------- test/go.mod | 13 +++++- test/go.sum | 28 ++++++++++-- 9 files changed, 160 insertions(+), 60 deletions(-) delete mode 100755 hack/e2e/ensure_cmctl.sh create mode 100644 test/e2e/cert_manager.go diff --git a/hack/ci-e2e.sh b/hack/ci-e2e.sh index e544e8f0c3..9bd9ac2789 100755 --- a/hack/ci-e2e.sh +++ b/hack/ci-e2e.sh @@ -10,7 +10,8 @@ set -eux -REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. +REPO_ROOT=$(realpath "$(dirname "${BASH_SOURCE[0]}")/..") + cd "${REPO_ROOT}" || exit 1 # BMO_E2E_EMULATOR can be set to either "vbmc" or "sushy-tools" @@ -20,8 +21,8 @@ BMO_E2E_EMULATOR=${BMO_E2E_EMULATOR:-"sushy-tools"} "${REPO_ROOT}/hack/e2e/ensure_go.sh" export PATH="${PATH}:/usr/local/go/bin" "${REPO_ROOT}/hack/e2e/ensure_minikube.sh" +# CAPI test framework uses kubectl in the background "${REPO_ROOT}/hack/e2e/ensure_kubectl.sh" -"${REPO_ROOT}/hack/e2e/ensure_cmctl.sh" # Build the container image with e2e tag (used in tests) IMG=quay.io/metal3-io/baremetal-operator:e2e make docker diff --git a/hack/e2e/ensure_cmctl.sh b/hack/e2e/ensure_cmctl.sh deleted file mode 100755 index 22982db3a4..0000000000 --- a/hack/e2e/ensure_cmctl.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash - -set -eux - -USR_LOCAL_BIN="/usr/local/bin" -OS=$(go env GOOS) -ARCH=$(go env GOARCH) -MINIMUM_CMCTL_VERSION=v1.13.0 - -verify_cmctl_version() { - if ! [ -x "$(command -v cmctl)" ]; then - if [[ "${OSTYPE}" == "linux-gnu" ]]; then - echo "cmctl not found, installing" - curl -fsSL -o cmctl.tar.gz "https://github.com/cert-manager/cert-manager/releases/download/${MINIMUM_CMCTL_VERSION}/cmctl-${OS}-${ARCH}.tar.gz" - tar xzf cmctl.tar.gz - sudo mv cmctl "${USR_LOCAL_BIN}/cmctl" - rm cmctl.tar.gz - else - echo "Missing required binary in path: cmctl" - return 2 - fi - fi - - local cmctl_version - IFS=" " read -ra cmctl_version <<< "$(cmctl version --client --short)" - if [[ "${MINIMUM_CMCTL_VERSION}" != $(echo -e "${MINIMUM_CMCTL_VERSION}\n${cmctl_version[2]}" | sort -s -t. -k 1,1 -k 2,2n -k 3,3n | head -n1) ]]; then - cat << EOF -Detected cmctl version: ${cmctl_version[2]}. -Requires ${MINIMUM_CMCTL_VERSION} or greater. -Please install ${MINIMUM_CMCTL_VERSION} or later. -EOF - return 2 - fi -} - -verify_cmctl_version diff --git a/test/e2e/cert_manager.go b/test/e2e/cert_manager.go new file mode 100644 index 0000000000..53ed547e47 --- /dev/null +++ b/test/e2e/cert_manager.go @@ -0,0 +1,87 @@ +package e2e + +import ( + "context" + "fmt" + "io" + "net/http" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "sigs.k8s.io/cluster-api/test/framework" + "sigs.k8s.io/controller-runtime/pkg/client" + + cmapi "github.com/cert-manager/cert-manager/pkg/apis/certmanager/v1" + cmmeta "github.com/cert-manager/cert-manager/pkg/apis/meta/v1" + "github.com/pkg/errors" +) + +func checkCertManagerAPI(clusterProxy framework.ClusterProxy) error { + certManagerAPIVersion := "cert-manager.io/v1" + clientset := clusterProxy.GetClientSet() + _, err := clientset.Discovery().ServerResourcesForGroupVersion(certManagerAPIVersion) + return err +} + +func installCertManager(ctx context.Context, clusterProxy framework.ClusterProxy, cmVersion string) error { + response, err := http.Get(fmt.Sprintf("https://github.com/cert-manager/cert-manager/releases/download/%s/cert-manager.yaml", cmVersion)) + if err != nil { + return errors.Wrapf(err, "Error downloading cert-manager manifest") + } + defer response.Body.Close() + manifests, err := io.ReadAll(response.Body) + if err != nil { + return errors.Wrapf(err, "Error reading downloaded cert-manager manifest") + } + err = clusterProxy.Apply(ctx, manifests) + if err != nil { + return errors.Wrapf(err, "Error installing cert-manager from downloaded manifest") + } + return nil +} + +// checkCertManagerWebhook attempts to perform a dry-run create of a cert-manager +// Issuer and Certificate resources in order to verify that CRDs are installed and all the +// required webhooks are reachable by the K8S API server. +func checkCertManagerWebhook(ctx context.Context, clusterProxy framework.ClusterProxy) error { + scheme := clusterProxy.GetScheme() + const ns = "cert-manager" + cmapi.AddToScheme(scheme) + cl, err := client.New(clusterProxy.GetRESTConfig(), client.Options{ + Scheme: scheme, + }) + if err != nil { + return err + } + c := client.NewNamespacedClient(client.NewDryRunClient(cl), ns) + issuer := &cmapi.Issuer{ + ObjectMeta: metav1.ObjectMeta{ + Name: "cmapichecker", + }, + Spec: cmapi.IssuerSpec{ + IssuerConfig: cmapi.IssuerConfig{ + SelfSigned: &cmapi.SelfSignedIssuer{}, + }, + }, + } + if err = c.Create(ctx, issuer); err != nil { + return errors.Wrapf(err, "cert-manager webhook not ready") + } + cert := &cmapi.Certificate{ + ObjectMeta: metav1.ObjectMeta{ + Name: "cmapichecker", + }, + Spec: cmapi.CertificateSpec{ + DNSNames: []string{"cmapichecker.example"}, + SecretName: "cmapichecker", + IssuerRef: cmmeta.ObjectReference{ + Name: "cmapichecker", + }, + }, + } + + if err = c.Create(ctx, cert); err != nil { + return errors.Wrapf(err, "cert-manager webhook not ready") + } + return nil +} diff --git a/test/e2e/common.go b/test/e2e/common.go index 4798009d64..234c431379 100644 --- a/test/e2e/common.go +++ b/test/e2e/common.go @@ -20,8 +20,11 @@ import ( "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/cluster-api/test/framework" + "sigs.k8s.io/cluster-api/test/framework/clusterctl" "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/kustomize/api/krusty" + "sigs.k8s.io/kustomize/kyaml/filesys" ) // LoadImageBehavior indicates the behavior when loading an image. @@ -208,3 +211,13 @@ func WaitForBmhInPowerState(ctx context.Context, input WaitForBmhInPowerStateInp g.Expect(bmh.Status.PoweredOn).To(Equal(input.State == PoweredOn)) }, intervals...).Should(Succeed()) } + +func buildKustomizeManifest(source string) ([]byte, error) { + kustomizer := krusty.MakeKustomizer(krusty.MakeDefaultOptions()) + fSys := filesys.MakeFsOnDisk() + resources, err := kustomizer.Run(fSys, source) + if err != nil { + return nil, err + } + return resources.AsYaml() +} diff --git a/test/e2e/config/fixture.yaml b/test/e2e/config/fixture.yaml index 1055a59418..ca82116027 100644 --- a/test/e2e/config/fixture.yaml +++ b/test/e2e/config/fixture.yaml @@ -24,6 +24,7 @@ variables: BOOT_MAC_ADDRESS: "00:60:2f:31:81:01" IMAGE_URL: "http://192.168.222.1/cirros-0.6.2-x86_64-disk.img" IMAGE_CHECKSUM: "c8fc807773e5354afe61636071771906" + CERT_MANAGER_VERSION: "v1.13.0" intervals: inspection/wait-unmanaged: ["1m", "10ms"] diff --git a/test/e2e/config/ironic.yaml b/test/e2e/config/ironic.yaml index 339305c830..2b25d46101 100644 --- a/test/e2e/config/ironic.yaml +++ b/test/e2e/config/ironic.yaml @@ -27,6 +27,7 @@ variables: BOOT_MAC_ADDRESS: "00:60:2f:31:81:01" IMAGE_URL: "http://192.168.222.1/cirros-0.6.2-x86_64-disk.img" IMAGE_CHECKSUM: "c8fc807773e5354afe61636071771906" + CERT_MANAGER_VERSION: "v1.13.0" intervals: inspection/wait-unmanaged: ["1m", "5s"] diff --git a/test/e2e/e2e_suite_test.go b/test/e2e/e2e_suite_test.go index 9ef9c05721..d054d8c8e3 100644 --- a/test/e2e/e2e_suite_test.go +++ b/test/e2e/e2e_suite_test.go @@ -3,9 +3,7 @@ package e2e import ( "context" "flag" - "fmt" "os" - "os/exec" "path/filepath" "strings" "testing" @@ -103,16 +101,18 @@ var _ = SynchronizedBeforeSuite(func() []byte { if e2eConfig.GetVariable("DEPLOY_CERT_MANAGER") != "false" { // Install cert-manager By("Installing cert-manager") - cmd := exec.Command("cmctl", "check", "api") - _, err := cmd.CombinedOutput() + err := checkCertManagerAPI(clusterProxy) if err != nil { - cmd = exec.Command("cmctl", "x", "install") - output, err := cmd.CombinedOutput() - Expect(err).NotTo(HaveOccurred(), fmt.Sprintf("%s", output)) - By("Checking that the cert-manager API is available") - cmd = exec.Command("cmctl", "check", "api") - output, err = cmd.CombinedOutput() - Expect(err).NotTo(HaveOccurred(), fmt.Sprintf("%s", output)) + cmVersion := e2eConfig.GetVariable("CERT_MANAGER_VERSION") + err = installCertManager(ctx, clusterProxy, cmVersion) + Expect(err).NotTo(HaveOccurred()) + + By("Waiting for cert-manager webhook") + Eventually(func() error { + return checkCertManagerWebhook(ctx, clusterProxy) + }, e2eConfig.GetIntervals("default", "wait-available")...).Should(Succeed()) + err = checkCertManagerAPI(clusterProxy) + Expect(err).NotTo(HaveOccurred()) } } @@ -120,9 +120,10 @@ var _ = SynchronizedBeforeSuite(func() []byte { // Install BMO By("Installing BMO") kustomization := e2eConfig.GetVariable("BMO_KUSTOMIZATION") - cmd := exec.Command("kubectl", "--kubeconfig", clusterProxy.GetKubeconfigPath(), "apply", "-k", kustomization) //nolint:gosec - output, err := cmd.CombinedOutput() - Expect(err).NotTo(HaveOccurred(), fmt.Sprintf("%s", output)) + manifest, err := buildKustomizeManifest(kustomization) + Expect(err).NotTo(HaveOccurred()) + err = clusterProxy.Apply(ctx, manifest) + Expect(err).NotTo(HaveOccurred()) bmoDeployment := &v1.Deployment{ ObjectMeta: metav1.ObjectMeta{ @@ -149,9 +150,10 @@ var _ = SynchronizedBeforeSuite(func() []byte { // Install Ironic By("Installing Ironic") kustomization := e2eConfig.GetVariable("IRONIC_KUSTOMIZATION") - cmd := exec.Command("kubectl", "--kubeconfig", clusterProxy.GetKubeconfigPath(), "apply", "-k", kustomization) //nolint:gosec - output, err := cmd.CombinedOutput() - Expect(err).NotTo(HaveOccurred(), fmt.Sprintf("%s", output)) + manifest, err := buildKustomizeManifest(kustomization) + Expect(err).NotTo(HaveOccurred()) + err = clusterProxy.Apply(ctx, manifest) + Expect(err).NotTo(HaveOccurred()) ironicDeployment := &v1.Deployment{ ObjectMeta: metav1.ObjectMeta{ diff --git a/test/go.mod b/test/go.mod index a00950853a..d27866e3a4 100644 --- a/test/go.mod +++ b/test/go.mod @@ -3,6 +3,7 @@ module github.com/metal3-io/baremetal-operator/test go 1.20 require ( + github.com/cert-manager/cert-manager v1.10.0 github.com/metal3-io/baremetal-operator/apis v0.4.0 github.com/metal3-io/cluster-api-provider-metal3/test v1.5.1 github.com/onsi/ginkgo/v2 v2.13.0 @@ -16,10 +17,12 @@ require ( sigs.k8s.io/cluster-api v1.5.3 sigs.k8s.io/cluster-api/test v1.5.3 sigs.k8s.io/controller-runtime v0.15.2 + sigs.k8s.io/kustomize/api v0.13.2 + sigs.k8s.io/kustomize/kyaml v0.14.1 ) require ( - github.com/BurntSushi/toml v1.0.0 // indirect + github.com/BurntSushi/toml v1.1.0 // indirect github.com/MakeNowJust/heredoc v1.0.0 // indirect github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/semver/v3 v3.2.0 // indirect @@ -45,6 +48,7 @@ require ( github.com/evanphx/json-patch v5.6.0+incompatible // indirect github.com/evanphx/json-patch/v5 v5.6.0 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/go-errors/errors v1.4.2 // indirect github.com/go-logr/logr v1.2.4 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect github.com/go-openapi/jsonreference v0.20.1 // indirect @@ -62,6 +66,7 @@ require ( github.com/google/gofuzz v1.2.0 // indirect github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2 // indirect + github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/google/uuid v1.4.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/huandu/xstrings v1.4.0 // indirect @@ -81,9 +86,10 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.0.2 // indirect + github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/prometheus/client_golang v1.16.0 // indirect @@ -100,6 +106,8 @@ require ( github.com/stoewer/go-strcase v1.2.0 // indirect github.com/subosito/gotenv v1.4.2 // indirect github.com/valyala/fastjson v1.6.4 // indirect + github.com/xlab/treeprint v1.1.0 // indirect + go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect golang.org/x/crypto v0.14.0 // indirect golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect golang.org/x/mod v0.12.0 // indirect @@ -124,6 +132,7 @@ require ( k8s.io/cluster-bootstrap v0.27.7 // indirect k8s.io/component-base v0.27.7 // indirect k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect + sigs.k8s.io/gateway-api v0.5.0 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/kind v0.20.0 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect diff --git a/test/go.sum b/test/go.sum index be1eba3a50..41403b479d 100644 --- a/test/go.sum +++ b/test/go.sum @@ -39,8 +39,9 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.0.0 h1:dtDWrepsVPfW9H/4y7dDgFc2MBUSeJhlaDtK13CxFlU= github.com/BurntSushi/toml v1.0.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/toml v1.1.0 h1:ksErzDEI1khOiGPgpwuI7x2ebx/uXQNw7xJpn9Eq1+I= +github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ= github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= @@ -79,6 +80,8 @@ github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cert-manager/cert-manager v1.10.0 h1:qWMM2nqt3pyCVKTWoS645PORJpK5XvtE0iImk9qTPsc= +github.com/cert-manager/cert-manager v1.10.0/go.mod h1:xKakpUDYRHgUry/DkvcCCgQDRSwVSeSXTlw7slT+AYo= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -141,6 +144,8 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -241,6 +246,8 @@ github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLe github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2 h1:SJ+NtwL6QaZ21U+IrK7d0gGgpjGGvd2kz+FzTHVzdqI= github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2/go.mod h1:Tv1PlzqC9t8wNnpPdctvtSUOPUUg4SHeE6vR1Ir2hmg= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= @@ -356,6 +363,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0= +github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= @@ -368,8 +377,8 @@ github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= -github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= +github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 h1:rc3tiVYb5z54aKaDfakKn0dDjIyPpTtszkjuMzyt7ec= +github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= @@ -411,6 +420,7 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= @@ -445,6 +455,7 @@ github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -467,6 +478,8 @@ github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2 github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xlab/treeprint v1.1.0 h1:G/1DjNkPpfZCFt9CSh6b5/nY4VimlbHF3Rh4obvtzDk= +github.com/xlab/treeprint v1.1.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -480,6 +493,8 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 h1:+FNtrFTmVw0YZGpBGX56XDee331t6JAXeK2bcyhLOOc= +go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0Hg7FvpRQsQh5OSqIylirxKC7o= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= @@ -618,6 +633,7 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -905,10 +921,16 @@ sigs.k8s.io/cluster-api/test v1.5.3 h1:csAqV0aCJ6rsOfr2k5FaZ6ENdTZgJS44mxPvrHtMI sigs.k8s.io/cluster-api/test v1.5.3/go.mod h1:D+jHrP3ghuN/k/wfOGnE91riDLSzMmyaYjVUkRAnl80= sigs.k8s.io/controller-runtime v0.15.2 h1:9V7b7SDQSJ08IIsJ6CY1CE85Okhp87dyTMNDG0FS7f4= sigs.k8s.io/controller-runtime v0.15.2/go.mod h1:7ngYvp1MLT+9GeZ+6lH3LOlcHkp/+tzA/fmHa4iq9kk= +sigs.k8s.io/gateway-api v0.5.0 h1:ze+k9fJqvmL8s1t3e4q1ST8RnN+f09dEv+gfacahlAE= +sigs.k8s.io/gateway-api v0.5.0/go.mod h1:x0AP6gugkFV8fC/oTlnOMU0pnmuzIR8LfIPRVUjxSqA= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/kind v0.20.0 h1:f0sc3v9mQbGnjBUaqSFST1dwIuiikKVGgoTwpoP33a8= sigs.k8s.io/kind v0.20.0/go.mod h1:aBlbxg08cauDgZ612shr017/rZwqd7AS563FvpWKPVs= +sigs.k8s.io/kustomize/api v0.13.2 h1:kejWfLeJhUsTGioDoFNJET5LQe/ajzXhJGYoU+pJsiA= +sigs.k8s.io/kustomize/api v0.13.2/go.mod h1:DUp325VVMFVcQSq+ZxyDisA8wtldwHxLZbr1g94UHsw= +sigs.k8s.io/kustomize/kyaml v0.14.1 h1:c8iibius7l24G2wVAGZn/Va2wNys03GXLjYVIcFVxKA= +sigs.k8s.io/kustomize/kyaml v0.14.1/go.mod h1:AN1/IpawKilWD7V+YvQwRGUvuUOOWpjsHu6uHwonSF4= sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= From ecd0ae180f26261697fdcf0fbae1628e6995d760 Mon Sep 17 00:00:00 2001 From: muhammad adil ghaffar Date: Tue, 14 Nov 2023 09:55:35 +0200 Subject: [PATCH 8/9] Commit signing off update. Signed-off-by: muhammad adil ghaffar --- CONTRIBUTING.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a92298e947..b828744d04 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,6 +7,7 @@ GitHub pull requests. - [Certificate of Origin](#certificate-of-origin) + - [Git commit Sign-off](#git-commit-sign-off) - [Finding Things That Need Help](#finding-things-that-need-help) - [Versioning](#versioning) - [Codebase](#codebase) @@ -31,6 +32,25 @@ Origin (DCO). This document was created by the Linux Kernel community and is a simple statement that you, as a contributor, have the legal right to make the contribution. See the [DCO](DCO) file for details. +### Git commit Sign-off + +Commit message should contain signed off section with full name and email. For example: + + ```text + Signed-off-by: John Doe + ``` + +When making commits, include the `-s` flag and `Signed-off-by` section will be automatically +added to your commit message. If you want GPG signing too, add the `-S` flag alongside `-s`. + +```bash + # Signing off commit + git commit -s + + # Signing off commit and also additional signing with GPG + git commit -s -S +``` + ## Finding Things That Need Help If you're new to the project and want to help, but don't know where to start, we From d76e42e337e42686a795194dab26bdf6ea0335e0 Mon Sep 17 00:00:00 2001 From: Max Rantil Date: Wed, 8 Nov 2023 16:52:31 +0000 Subject: [PATCH 9/9] Add CI-independent BMO e2e tests Implement lightweight fixture-based tests to ensure CI platform flexibility. --- .github/workflows/e2e-fixture-test.yml | 35 ++++++++++++++++++++++++++ test/e2e/basic_ops_test.go | 7 ------ test/e2e/basic_provisioning_test.go | 7 ------ test/e2e/config/ironic.yaml | 2 +- test/e2e/external_inspection_test.go | 7 ------ test/e2e/inspection_test.go | 7 ------ test/e2e/re_inspection_test.go | 7 ------ 7 files changed, 36 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/e2e-fixture-test.yml diff --git a/.github/workflows/e2e-fixture-test.yml b/.github/workflows/e2e-fixture-test.yml new file mode 100644 index 0000000000..d4f5604b87 --- /dev/null +++ b/.github/workflows/e2e-fixture-test.yml @@ -0,0 +1,35 @@ +name: E2E Fixture Test + +on: + pull_request: + branches: [ main ] + paths-ignore: + - '**/*.md' + - 'docs/**' + - '.gitignore' + - 'hack/*.sh' + - 'LICENSE' + - 'SECURITY_CONTACTS' + - 'DCO' + - 'OWNERS' + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Build BMO e2e Docker Image + env: + IMG: quay.io/metal3-io/baremetal-operator:e2e + run: make docker + + - name: Set Up Environment and Run BMO e2e Tests + env: + E2E_CONF_FILE: ${GITHUB_WORKSPACE}/test/e2e/config/fixture.yaml + USE_EXISTING_CLUSTER: "false" + run: make test-e2e diff --git a/test/e2e/basic_ops_test.go b/test/e2e/basic_ops_test.go index f081ad1a7c..946735ecac 100644 --- a/test/e2e/basic_ops_test.go +++ b/test/e2e/basic_ops_test.go @@ -82,13 +82,6 @@ var _ = Describe("basic", func() { err = clusterProxy.GetClient().Create(ctx, &bmh) Expect(err).NotTo(HaveOccurred()) - By("waiting for the BMH to be in registering state") - WaitForBmhInProvisioningState(ctx, WaitForBmhInProvisioningStateInput{ - Client: clusterProxy.GetClient(), - Bmh: bmh, - State: metal3api.StateRegistering, - }, e2eConfig.GetIntervals(specName, "wait-registering")...) - By("waiting for the BMH to become available") WaitForBmhInProvisioningState(ctx, WaitForBmhInProvisioningStateInput{ Client: clusterProxy.GetClient(), diff --git a/test/e2e/basic_provisioning_test.go b/test/e2e/basic_provisioning_test.go index c3ede85444..cb3ba9b7ec 100644 --- a/test/e2e/basic_provisioning_test.go +++ b/test/e2e/basic_provisioning_test.go @@ -78,13 +78,6 @@ var _ = Describe("Provisioning", func() { err = clusterProxy.GetClient().Create(ctx, &bmh) Expect(err).NotTo(HaveOccurred()) - By("Waiting for the BMH to be in registering state") - WaitForBmhInProvisioningState(ctx, WaitForBmhInProvisioningStateInput{ - Client: clusterProxy.GetClient(), - Bmh: bmh, - State: metal3api.StateRegistering, - }, e2eConfig.GetIntervals(specName, "wait-registering")...) - By("Waiting for the BMH to become available") WaitForBmhInProvisioningState(ctx, WaitForBmhInProvisioningStateInput{ Client: clusterProxy.GetClient(), diff --git a/test/e2e/config/ironic.yaml b/test/e2e/config/ironic.yaml index 339305c830..e724b9db8a 100644 --- a/test/e2e/config/ironic.yaml +++ b/test/e2e/config/ironic.yaml @@ -33,7 +33,7 @@ intervals: default/wait-registering: ["1m", "5s"] inspection/wait-registration-error: ["1m", "5s"] external-inspection/wait-available: ["20s", "1s"] - default/wait-inspecting: ["2m", "10s"] + default/wait-inspecting: ["2m", "2s"] default/wait-available: ["10m", "1s"] default/wait-deployment: ["5m", "1s"] default/wait-namespace-deleted: ["10m", "1s"] diff --git a/test/e2e/external_inspection_test.go b/test/e2e/external_inspection_test.go index 3c0d29fc90..7315a005c5 100644 --- a/test/e2e/external_inspection_test.go +++ b/test/e2e/external_inspection_test.go @@ -232,13 +232,6 @@ var _ = Describe("External Inspection", func() { err = clusterProxy.GetClient().Create(ctx, &bmh) Expect(err).NotTo(HaveOccurred()) - By("waiting for the BMH to be in registering state") - WaitForBmhInProvisioningState(ctx, WaitForBmhInProvisioningStateInput{ - Client: clusterProxy.GetClient(), - Bmh: bmh, - State: metal3api.StateRegistering, - }, e2eConfig.GetIntervals(specName, "wait-registering")...) - By("waiting for the BMH to become available") WaitForBmhInProvisioningState(ctx, WaitForBmhInProvisioningStateInput{ Client: clusterProxy.GetClient(), diff --git a/test/e2e/inspection_test.go b/test/e2e/inspection_test.go index a4c0aff30f..20306bc96a 100644 --- a/test/e2e/inspection_test.go +++ b/test/e2e/inspection_test.go @@ -123,13 +123,6 @@ var _ = Describe("Inspection", func() { err = clusterProxy.GetClient().Create(ctx, &bmh) Expect(err).NotTo(HaveOccurred()) - By("waiting for the BMH to be in registering state") - WaitForBmhInProvisioningState(ctx, WaitForBmhInProvisioningStateInput{ - Client: clusterProxy.GetClient(), - Bmh: bmh, - State: metal3api.StateRegistering, - }, e2eConfig.GetIntervals(specName, "wait-registering")...) - By("waiting for the BMH to be in inspecting state") WaitForBmhInProvisioningState(ctx, WaitForBmhInProvisioningStateInput{ Client: clusterProxy.GetClient(), diff --git a/test/e2e/re_inspection_test.go b/test/e2e/re_inspection_test.go index e9b486f7d9..42e0739114 100644 --- a/test/e2e/re_inspection_test.go +++ b/test/e2e/re_inspection_test.go @@ -86,13 +86,6 @@ var _ = Describe("Re-Inspection", func() { err = clusterProxy.GetClient().Create(ctx, &bmh) Expect(err).NotTo(HaveOccurred()) - By("waiting for the BMH to be in registering state") - WaitForBmhInProvisioningState(ctx, WaitForBmhInProvisioningStateInput{ - Client: clusterProxy.GetClient(), - Bmh: bmh, - State: metal3api.StateRegistering, - }, e2eConfig.GetIntervals(specName, "wait-registering")...) - By("waiting for the BMH to become available") WaitForBmhInProvisioningState(ctx, WaitForBmhInProvisioningStateInput{ Client: clusterProxy.GetClient(),