Skip to content

Commit

Permalink
Merge branch 'main' into e2e-live-iso-ssh-implementation/max
Browse files Browse the repository at this point in the history
  • Loading branch information
maxrantil committed Nov 21, 2023
2 parents afe00df + 26d958c commit 94c79bd
Show file tree
Hide file tree
Showing 22 changed files with 422 additions and 116 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/e2e-fixture-test.yml
Original file line number Diff line number Diff line change
@@ -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
71 changes: 71 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ GitHub pull requests.
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [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)
- [Backporting](#backporting)
- [Branches](#branches)
- [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)
Expand All @@ -31,6 +33,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 <jdoe@example.com>
```

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
Expand Down Expand Up @@ -78,6 +99,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.

### 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 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
`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 | Maintained 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 | Maintained 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
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
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=
Expand Down
5 changes: 3 additions & 2 deletions hack/ci-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
36 changes: 0 additions & 36 deletions hack/e2e/ensure_cmctl.sh

This file was deleted.

2 changes: 1 addition & 1 deletion hack/markdownlint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions hack/tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions hack/tools/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)))

Expand Down
7 changes: 0 additions & 7 deletions test/e2e/basic_ops_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 94c79bd

Please sign in to comment.