Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Dockerfile.rhel
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.25-openshift-4.22 AS builder
WORKDIR /go/src/github.com/openshift/cluster-capi-operator
COPY . .
RUN make clean build
RUN make clean build && \
gzip bin/cluster-capi-operator-ext

FROM registry.ci.openshift.org/ocp/4.22:base-rhel9
COPY --from=builder /go/src/github.com/openshift/cluster-capi-operator/bin/capi-operator .
COPY --from=builder /go/src/github.com/openshift/cluster-capi-operator/bin/capi-controllers .
COPY --from=builder /go/src/github.com/openshift/cluster-capi-operator/bin/machine-api-migration .
COPY --from=builder /go/src/github.com/openshift/cluster-capi-operator/bin/crd-compatibility-checker .
COPY --from=builder /go/src/github.com/openshift/cluster-capi-operator/bin/cluster-capi-operator-ext.gz .

COPY ./manifests /manifests
COPY ./capi-operator-manifests /capi-operator-manifests

LABEL io.openshift.release.operator true
LABEL io.k8s.display-name="OpenShift Cluster CAPI Operator" \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want a separate docker file for the tests extension? I'm not sure we're shipping this as part of payload?

That being said, I'm not sure what existing patterns exist here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @theobarberbany no separate docker file needed, other similar implementations also modify their existing docker file to include the extension binary, it ships as part of the operator payload, openShift's test framework discovers it via the label and extracts it when needed.

  • machine-api-operator #1338
  • cloud-provider-aws #117
  • cluster-control-plane-machine-set-operator #372

io.openshift.release.operator=true \
io.openshift.tags="openshift,tests,e2e,e2e-extension"
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ifeq ($(HOME), /)
HOME = /tmp/kubebuilder-testing
endif

.PHONY: help all verify test build operator migration manifests-gen ocp-manifests unit e2e run fmt vet lint vendor image push aws-cluster azure-cluster gcp-cluster powervs-cluster vsphere-cluster
.PHONY: help all verify test build operator migration manifests-gen ocp-manifests tests-ext unit e2e run fmt vet lint vendor image push aws-cluster azure-cluster gcp-cluster powervs-cluster vsphere-cluster
.DEFAULT_GOAL := build

help: ## Display this help message
Expand All @@ -29,7 +29,7 @@ verify: fmt lint verify-ocp-manifests ## Run formatting and linting checks

test: verify unit ## Run verification and unit tests

build: bin/capi-operator bin/capi-controllers bin/machine-api-migration bin/crd-compatibility-checker manifests-gen ## Build all binaries
build: bin/capi-operator bin/capi-controllers bin/machine-api-migration bin/crd-compatibility-checker manifests-gen tests-ext ## Build all binaries

clean:
rm -rf bin/*
Expand Down Expand Up @@ -60,6 +60,9 @@ ocp-manifests: manifests-gen ## Generate admission policy profiles for image emb
bin/%: FORCE | bin/
go build -o "$@" "./cmd/$*"

tests-ext: | bin/ ## Build tests extension binary
cd openshift-tests-extension && go build -o ../bin/cluster-capi-operator-ext ./cmd
Comment thread
coderabbitai[bot] marked this conversation as resolved.

.PHONY: localtestenv
localtestenv: .localtestenv

Expand All @@ -69,7 +72,7 @@ localtestenv: .localtestenv

TEST_DIRS ?= ./pkg/... ./manifests-gen/...
unit: .localtestenv ## Run unit tests
./hack/test.sh "$(TEST_DIRS)" 20m
./hack/test.sh "$(TEST_DIRS)" 30m

.PHONY: e2e
e2e: ## Run e2e tests against active kubeconfig
Expand Down
3 changes: 2 additions & 1 deletion e2e/aws_test.go → e2e/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
)

var _ = Describe("Cluster API AWS MachineSet", Ordered, func() {
var _ = Describe("[sig-cluster-lifecycle][Feature:ClusterAPI] Cluster API AWS MachineSet", Ordered, Label("Platform:aws"), Label("Serial"), Label("Disruptive"), func() {
var (
awsMachineTemplate *awsv1.AWSMachineTemplate
machineSet *clusterv1.MachineSet
Expand All @@ -37,6 +37,7 @@ var _ = Describe("Cluster API AWS MachineSet", Ordered, func() {
)

BeforeAll(func() {
InitCommonVariables()
if platform != configv1.AWSPlatformType {
Skip("Skipping AWS E2E tests")
}
Expand Down
5 changes: 3 additions & 2 deletions e2e/azure_test.go → e2e/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ const (
capzManagerBootstrapCredentials = "capz-manager-bootstrap-credentials"
)

var _ = Describe("Cluster API Azure MachineSet", Ordered, func() {
var _ = Describe("[sig-cluster-lifecycle][Feature:ClusterAPI] Cluster API Azure MachineSet", Ordered, Label("Platform:azure"), Label("Serial"), Label("Disruptive"), func() {
var azureMachineTemplate *azurev1.AzureMachineTemplate
var machineSet *clusterv1.MachineSet
var mapiMachineSpec *mapiv1beta1.AzureMachineProviderSpec

BeforeAll(func() {
InitCommonVariables()
if platform != configv1.AzurePlatformType {
Skip("Skipping Azure E2E tests")
}
Expand Down Expand Up @@ -114,7 +115,7 @@ func createAzureMachineTemplate(ctx context.Context, cl client.Client, mapiProvi
if mi := mapiProviderSpec.ManagedIdentity; mi != "" {
providerID := mi
if !strings.HasPrefix(mi, "/subscriptions/") {
providerID = fmt.Sprintf("azure:///subscriptions/%s/resourcegroups/%s/providers/Microsoft.ManagedIdentity/userAssignedIdentities/%s", subscriptionID, mapiProviderSpec.ResourceGroup, mi)
providerID = fmt.Sprintf("azure:///subscriptions/%s/resourcegroups/%s/providers/Microsoft.ManagedIdentity/userAssignedIdentities/%s", string(subscriptionID), mapiProviderSpec.ResourceGroup, mi)
}

userAssignedIdentities = []azurev1.UserAssignedIdentity{{ProviderID: providerID}}
Expand Down
3 changes: 2 additions & 1 deletion e2e/baremetal_test.go → e2e/baremetal.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@ const (
baremetalMachineTemplateName = "baremetal-machine-template"
)

var _ = Describe("Cluster API Baremetal MachineSet", Ordered, func() {
var _ = Describe("[sig-cluster-lifecycle][Feature:ClusterAPI] Cluster API Baremetal MachineSet", Ordered, Label("Platform:baremetal"), Label("Serial"), Label("Disruptive"), func() {
var baremetalMachineTemplate *metal3v1.Metal3MachineTemplate
var machineSet *clusterv1.MachineSet
var mapiMachineSpec *bmv1alpha1.BareMetalMachineProviderSpec

BeforeAll(func() {
InitCommonVariables()
if platform != configv1.BareMetalPlatformType {
Skip("Skipping Baremetal E2E tests")
}
Expand Down
3 changes: 2 additions & 1 deletion e2e/gcp_test.go → e2e/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@ const (
gcpMachineTemplateName = "gcp-machine-template"
)

var _ = Describe("Cluster API GCP MachineSet", Ordered, func() {
var _ = Describe("[sig-cluster-lifecycle][Feature:ClusterAPI] Cluster API GCP MachineSet", Ordered, Label("Platform:gcp"), Label("Serial"), Label("Disruptive"), func() {
var gcpMachineTemplate *gcpv1.GCPMachineTemplate
var machineSet *clusterv1.MachineSet
var mapiMachineSpec *mapiv1beta1.GCPMachineProviderSpec

BeforeAll(func() {
InitCommonVariables()
if platform != configv1.GCPPlatformType {
Skip("Skipping GCP E2E tests")
}
Expand Down
6 changes: 6 additions & 0 deletions e2e/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ require (
github.com/metal3-io/cluster-api-provider-metal3/api v1.11.2
github.com/onsi/ginkgo/v2 v2.28.1
github.com/onsi/gomega v1.39.1
github.com/openshift-eng/openshift-tests-extension v0.0.0-20251125140340-13f4631a80b0
github.com/openshift/api v0.0.0-20260306141135-f595753a3e66
github.com/openshift/cluster-api-actuator-pkg v0.0.0-20260310144400-bec013a007a8
github.com/openshift/cluster-api-provider-baremetal v0.0.0-20250619124612-fb678fec5f7e
Expand All @@ -36,12 +37,14 @@ require (
)

require (
cel.dev/expr v0.25.1 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 // indirect
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.7.0 // indirect
github.com/IBM/go-sdk-core/v5 v5.21.2 // indirect
github.com/IBM/vpc-go-sdk v0.76.2 // indirect
github.com/Masterminds/semver/v3 v3.4.0 // indirect
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
github.com/asaskevich/govalidator/v11 v11.0.2-0.20250122183457-e11347878e23 // indirect
github.com/aws/aws-sdk-go-v2 v1.40.1 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.15 // indirect
Expand Down Expand Up @@ -81,6 +84,7 @@ require (
github.com/go-viper/mapstructure/v2 v2.5.0 // indirect
github.com/golang/mock v1.7.0-rc.1 // indirect
github.com/google/btree v1.1.3 // indirect
github.com/google/cel-go v0.27.0 // indirect
github.com/google/gnostic-models v0.7.1 // indirect
github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83 // indirect
github.com/google/uuid v1.6.0 // indirect
Expand Down Expand Up @@ -131,6 +135,8 @@ require (
golang.org/x/time v0.15.0 // indirect
golang.org/x/tools v0.42.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260209200024-4cfbd4190f57 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260209200024-4cfbd4190f57 // indirect
google.golang.org/protobuf v1.36.11 // indirect
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
Expand Down
21 changes: 10 additions & 11 deletions e2e/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cel.dev/expr v0.24.0 h1:56OvJKSH3hDGL0ml5uSxZmz3/3Pq4tJ+fb1unVLAFcY=
cel.dev/expr v0.24.0/go.mod h1:hLPLo1W4QUmuYdA72RBX06QTs6MXw941piREPl3Yfiw=
cel.dev/expr v0.25.1 h1:1KrZg61W6TWSxuNZ37Xy49ps13NUovb66QLprthtwi4=
cel.dev/expr v0.25.1/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0 h1:fou+2+WFTib47nS+nz/ozhEBnvU96bKHy6LjRsY4E28=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0/go.mod h1:t76Ruy8AHvUAC8GfMWJMa0ElSbuIcO03NLpynfbgsPA=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 h1:Hk5QBxZQC1jb2Fwj6mpzme37xbCDdNTxU7O9eb5+LB4=
Expand Down Expand Up @@ -139,8 +139,8 @@ github.com/golang/mock v1.7.0-rc.1 h1:YojYx61/OLFsiv6Rw1Z96LpldJIy31o+UHmwAUMJ6/
github.com/golang/mock v1.7.0-rc.1/go.mod h1:s42URUywIqd+OcERslBJvOjepvNymP31m3q8d/GkuRs=
github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg=
github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
github.com/google/cel-go v0.26.0 h1:DPGjXackMpJWH680oGY4lZhYjIameYmR+/6RBdDGmaI=
github.com/google/cel-go v0.26.0/go.mod h1:A9O8OU9rdvrK5MQyrqfIxo1a0u4g3sF8KB6PUIaryMM=
github.com/google/cel-go v0.27.0 h1:e7ih85+4qVrBuqQWTW4FKSqZYokVuc3HnhH5keboFTo=
github.com/google/cel-go v0.27.0/go.mod h1:tTJ11FWqnhw5KKpnWpvW9CJC3Y9GK4EIS0WXnBbebzw=
github.com/google/gnostic-models v0.7.1 h1:SisTfuFKJSKM5CPZkffwi6coztzzeYUhc3v4yxLWH8c=
github.com/google/gnostic-models v0.7.1/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
Expand Down Expand Up @@ -216,6 +216,8 @@ github.com/onsi/ginkgo/v2 v2.28.1 h1:S4hj+HbZp40fNKuLUQOYLDgZLwNUVn19N3Atb98NCyI
github.com/onsi/ginkgo/v2 v2.28.1/go.mod h1:CLtbVInNckU3/+gC8LzkGUb9oF+e8W8TdUsxPwvdOgE=
github.com/onsi/gomega v1.39.1 h1:1IJLAad4zjPn2PsnhH70V4DKRFlrCzGBNrNaru+Vf28=
github.com/onsi/gomega v1.39.1/go.mod h1:hL6yVALoTOxeWudERyfppUcZXjMwIMLnuSfruD2lcfg=
github.com/openshift-eng/openshift-tests-extension v0.0.0-20251125140340-13f4631a80b0 h1:d27Tezkhb3zGSuweEeNXYnMK3aJLYgOzVu32cVTfhDE=
github.com/openshift-eng/openshift-tests-extension v0.0.0-20251125140340-13f4631a80b0/go.mod h1:6gkP5f2HL0meusT0Aim8icAspcD1cG055xxBZ9yC68M=
github.com/openshift/api v0.0.0-20260306141135-f595753a3e66 h1:NchDXEQxOEww4DDUNMSDcpSPOMTFmjlWz5bIjd9gLIY=
github.com/openshift/api v0.0.0-20260306141135-f595753a3e66/go.mod h1:pyVjK0nZ4sRs4fuQVQ4rubsJdahI1PB94LnQ8sGdvxo=
github.com/openshift/client-go v0.0.0-20260306160707-3935d929fc7d h1:T+9HFgEEcnu1TDDfsO5JcJC6N0/Kzob5AtG9IpITHJ8=
Expand Down Expand Up @@ -257,8 +259,6 @@ github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU=
github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4=
github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs=
github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.5.3 h1:jmXUvGomnU1o3W/V5h2VEradbpJDwGrzugQQvL0POH4=
github.com/stretchr/objx v0.5.3/go.mod h1:rDQraq+vQZU7Fde9LOZLr8Tax6zZvy4kuNKF+QYS+U0=
Expand Down Expand Up @@ -340,11 +340,10 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gomodules.xyz/jsonpatch/v2 v2.5.0 h1:JELs8RLM12qJGXU4u/TO3V25KW8GreMKl9pdkk14RM0=
gomodules.xyz/jsonpatch/v2 v2.5.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
google.golang.org/genproto v0.0.0-20250603155806-513f23925822 h1:rHWScKit0gvAPuOnu87KpaYtjK5zBMLcULh7gxkCXu4=
google.golang.org/genproto/googleapis/api v0.0.0-20260128011058-8636f8732409 h1:merA0rdPeUV3YIIfHHcH4qBkiQAc1nfCKSI7lB4cV2M=
google.golang.org/genproto/googleapis/api v0.0.0-20260128011058-8636f8732409/go.mod h1:fl8J1IvUjCilwZzQowmw2b7HQB2eAuYBabMXzWurF+I=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409 h1:H86B94AW+VfJWDqFeEbBPhEtHzJwJfTbgE2lZa54ZAQ=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ=
google.golang.org/genproto/googleapis/api v0.0.0-20260209200024-4cfbd4190f57 h1:JLQynH/LBHfCTSbDWl+py8C+Rg/k1OVH3xfcaiANuF0=
google.golang.org/genproto/googleapis/api v0.0.0-20260209200024-4cfbd4190f57/go.mod h1:kSJwQxqmFXeo79zOmbrALdflXQeAYcUbgS7PbpMknCY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260209200024-4cfbd4190f57 h1:mWPCjDEyshlQYzBpMNHaEof6UX1PmHcaUODUywQ0uac=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260209200024-4cfbd4190f57/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ=
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,20 @@ import (

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

ote "github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo"
configv1 "github.com/openshift/api/config/v1"
mapiv1beta1 "github.com/openshift/api/machine/v1beta1"
mapiframework "github.com/openshift/cluster-api-actuator-pkg/pkg/framework"
capiframework "github.com/openshift/cluster-capi-operator/e2e/framework"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

awsv1 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2"
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
)

var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:MachineAPIMigration] Machine Migration CAPI Authoritative Tests", Ordered, func() {
var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:MachineAPIMigration] Machine Migration CAPI Authoritative Tests", Ordered, Label("Platform:aws"), Label("Serial"), Label("Disruptive"), ote.Informing(), func() {
BeforeAll(func() {
InitCommonVariables()
if platform != configv1.AWSPlatformType {
Skip(fmt.Sprintf("Skipping tests on %s, this is only supported on AWS", platform))
}
Expand Down Expand Up @@ -92,7 +94,7 @@ var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:MachineAPIMigration] Ma
cleanupMachineResources(
ctx,
cl,
[]*clusterv1.Machine{},
[]*clusterv1.Machine{newCapiMachine},
[]*mapiv1beta1.Machine{newMapiMachine},
)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

ote "github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo"
configv1 "github.com/openshift/api/config/v1"
mapiv1beta1 "github.com/openshift/api/machine/v1beta1"
mapiframework "github.com/openshift/cluster-api-actuator-pkg/pkg/framework"
Expand All @@ -29,8 +30,9 @@ import (
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
)

var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:MachineAPIMigration] Machine Migration MAPI Authoritative Tests", Ordered, func() {
var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:MachineAPIMigration] Machine Migration MAPI Authoritative Tests", Ordered, Label("Platform:aws"), Label("Serial"), Label("Disruptive"), ote.Informing(), func() {
BeforeAll(func() {
InitCommonVariables()
if platform != configv1.AWSPlatformType {
Skip(fmt.Sprintf("Skipping tests on %s, this is only supported on AWS", platform))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
ote "github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo"
configv1 "github.com/openshift/api/config/v1"
mapiv1beta1 "github.com/openshift/api/machine/v1beta1"
mapiframework "github.com/openshift/cluster-api-actuator-pkg/pkg/framework"
Expand Down Expand Up @@ -52,8 +53,9 @@ const (
vapCAPIForbiddenFieldMessage = "spec.%s is a forbidden field"
)

var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:MachineAPIMigration] MAPI Machine VAP Tests", Ordered, func() {
var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:MachineAPIMigration] MAPI Machine VAP Tests", Ordered, Label("Platform:aws"), Label("Serial"), Label("Disruptive"), ote.Informing(), func() {
BeforeAll(func() {
InitCommonVariables()
if platform != configv1.AWSPlatformType {
Skip(fmt.Sprintf("Skipping tests on %s, this is only supported on AWS", platform))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

ote "github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo"
configv1 "github.com/openshift/api/config/v1"
mapiv1beta1 "github.com/openshift/api/machine/v1beta1"
mapiframework "github.com/openshift/cluster-api-actuator-pkg/pkg/framework"
Expand All @@ -28,8 +29,9 @@ import (
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
)

var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:MachineAPIMigration] MachineSet Migration CAPI Authoritative Tests", Ordered, func() {
var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:MachineAPIMigration] MachineSet Migration CAPI Authoritative Tests", Ordered, Label("Platform:aws"), Label("Serial"), ote.Informing(), func() {
BeforeAll(func() {
InitCommonVariables()
if platform != configv1.AWSPlatformType {
Skip(fmt.Sprintf("Skipping tests on %s, this is only supported on AWS", platform))
}
Expand Down Expand Up @@ -73,8 +75,7 @@ var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:MachineAPIMigration] Ma
verifyMachineSetPausedCondition(mapiMachineSet, mapiv1beta1.MachineAuthorityClusterAPI)
})

// bug https://issues.redhat.com/browse/OCPBUGS-55337
PIt("should verify that the non-authoritative MAPI MachineSet providerSpec has been updated to reflect the authoritative CAPI MachineSet mirror values", func() {
It("should verify that the non-authoritative MAPI MachineSet providerSpec has been updated to reflect the authoritative CAPI MachineSet mirror values", func() {
verifyMAPIMachineSetProviderSpec(mapiMachineSet, HaveField("InstanceType", Equal(instanceType)))
})
})
Expand Down Expand Up @@ -117,7 +118,7 @@ var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:MachineAPIMigration] Ma
})
})

Describe("Scale MAPI MachineSets", Ordered, func() {
Describe("Scale MAPI MachineSets", Ordered, Label("Disruptive"), func() {
var mapiMSAuthCAPIName string

var awsMachineTemplate *awsv1.AWSMachineTemplate
Expand Down Expand Up @@ -183,7 +184,9 @@ var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:MachineAPIMigration] Ma
verifyMAPIMachineSetSynchronizedCondition(mapiMachineSet, mapiv1beta1.MachineAuthorityMachineAPI)

By("Scaling up MAPI MachineSet to 3 replicas")
Expect(mapiframework.ScaleMachineSet(mapiMSAuthCAPIName, 3)).To(Succeed(), "should be able to scale up MAPI MachineSet")
Eventually(func() error {
return mapiframework.ScaleMachineSet(mapiMSAuthCAPIName, 3)
}, capiframework.WaitShort, capiframework.RetryShort).Should(Succeed(), "Should be able to scale up MAPI MachineSet")

By("Verifying MachineSet status.replicas is set to 3")
verifyMachinesetReplicas(mapiMachineSet, 3)
Expand All @@ -205,7 +208,9 @@ var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:MachineAPIMigration] Ma
verifyMachineAuthoritative(secondMAPIMachine, mapiv1beta1.MachineAuthorityClusterAPI)

By("Scaling down MAPI MachineSet to 1 replicas")
Expect(mapiframework.ScaleMachineSet(mapiMSAuthCAPIName, 1)).To(Succeed(), "should be able to scale down MAPI MachineSet")
Eventually(func() error {
return mapiframework.ScaleMachineSet(mapiMSAuthCAPIName, 1)
}, capiframework.WaitShort, capiframework.RetryShort).Should(Succeed(), "Should be able to scale down MAPI MachineSet")
verifyMachinesetReplicas(mapiMachineSet, 1)
verifyMachinesetReplicas(capiMachineSet, 1)

Expand All @@ -225,7 +230,7 @@ var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:MachineAPIMigration] Ma
})
})

Describe("Delete MachineSets", Ordered, func() {
Describe("Delete MachineSets", Ordered, Label("Disruptive"), func() {
var mapiMSAuthMAPIName string
var mapiMachineSet *mapiv1beta1.MachineSet
var capiMachineSet *clusterv1.MachineSet
Expand Down
Loading