Skip to content

Commit aba8e1b

Browse files
committed
Added OTE support and dedicated hosts support
1 parent bcf58df commit aba8e1b

8 files changed

Lines changed: 1723 additions & 3 deletions

File tree

Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ WORKDIR /go/src/github.com/openshift/machine-api-provider-aws
33
COPY . .
44
# VERSION env gets set in the openshift/release image and refers to the golang version, which interfers with our own
55
RUN unset VERSION \
6-
&& GOPROXY=off NO_DOCKER=1 make build
6+
&& GOPROXY=off NO_DOCKER=1 make build && \
7+
mkdir -p /tmp/build && \
8+
cp /go/src/github.com/openshift/machine-api-provider-aws/openshift-tests/bin/machine-api-provider-aws-tests-ext /tmp/build/machine-api-provider-aws-tests-ext && \
9+
gzip /tmp/build/machine-api-provider-aws-tests-ext
710

811
FROM registry.ci.openshift.org/openshift/origin-v4.0:base
912
COPY --from=builder /go/src/github.com/openshift/machine-api-provider-aws/bin/machine-controller-manager /
1013
COPY --from=builder /go/src/github.com/openshift/machine-api-provider-aws/bin/termination-handler /
14+
COPY --from=builder /tmp/build/machine-api-provider-aws-tests-ext.gz .

Dockerfile.rhel

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@ WORKDIR /go/src/github.com/openshift/machine-api-provider-aws
33
COPY . .
44
# VERSION env gets set in the openshift/release image and refers to the golang version, which interfers with our own
55
RUN unset VERSION \
6-
&& GOPROXY=off NO_DOCKER=1 make build
6+
&& GOPROXY=off NO_DOCKER=1 make build && \
7+
mkdir -p /tmp/build && \
8+
cp /go/src/github.com/openshift/machine-api-provider-aws/openshift-tests/bin/machine-api-provider-aws-tests-ext /tmp/build/machine-api-provider-aws-tests-ext && \
9+
gzip /tmp/build/machine-api-provider-aws-tests-ext
710

811
FROM registry.ci.openshift.org/ocp/4.22:base-rhel9
912
COPY --from=builder /go/src/github.com/openshift/machine-api-provider-aws/bin/machine-controller-manager /
1013
COPY --from=builder /go/src/github.com/openshift/machine-api-provider-aws/bin/termination-handler /
14+
COPY --from=builder /tmp/build/machine-api-provider-aws-tests-ext.gz .
1115

1216
LABEL io.openshift.release.operator true

Makefile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,24 @@ bin:
8787
@mkdir $@
8888

8989
.PHONY: build
90-
build: ## build binaries
90+
build: machine-controller-manager terminal-handler machine-api-provider-aws-tests-ext## build binaries
91+
92+
.PHONY: machine-controller-manager
93+
machine-controller-manager:
9194
$(DOCKER_CMD) go build $(GOGCFLAGS) -o "bin/machine-controller-manager" \
9295
-ldflags "$(LD_FLAGS)" "$(REPO_PATH)/cmd/manager"
96+
97+
.PHONY: terminal-handler
98+
terminal-handler:
9399
$(DOCKER_CMD) go build $(GOGCFLAGS) -o "bin/termination-handler" \
94100
-ldflags "$(LD_FLAGS)" "$(REPO_PATH)/cmd/termination-handler"
95101

102+
.PHONY:machine-api-provider-aws-tests-ext
103+
machine-api-provider-aws-tests-ext:
104+
pushd openshift-tests && \
105+
$(DOCKER_CMD) go build $(GOGCFLAGS) -o "bin/machine-api-provider-aws-tests-ext" \
106+
-ldflags "$(LD_FLAGS)" "$(REPO_PATH)/openshift-tests/cmd/mapa-tests"
107+
96108
.PHONY: images
97109
images: ## Create images
98110
ifeq ($(NO_DOCKER), 1)
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
package main
2+
3+
import (
4+
"os"
5+
"regexp"
6+
"strings"
7+
8+
"github.com/openshift-eng/openshift-tests-extension/pkg/cmd"
9+
"github.com/openshift-eng/openshift-tests-extension/pkg/extension"
10+
"github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests"
11+
"github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo"
12+
"github.com/spf13/cobra"
13+
"github.com/spf13/pflag"
14+
utilflag "k8s.io/component-base/cli/flag"
15+
"k8s.io/component-base/logs"
16+
17+
// Import CAPA test suites
18+
_ "github.com/openshift/machine-api-provider-aws/openshift-tests/test/e2e"
19+
)
20+
21+
func main() {
22+
logs.InitLogs()
23+
defer logs.FlushLogs()
24+
pflag.CommandLine.SetNormalizeFunc(utilflag.WordSepNormalizeFunc)
25+
26+
// Create our registry of openshift-tests extensions
27+
extensionRegistry := extension.NewRegistry()
28+
kubeTestsExtension := extension.NewExtension("openshift", "payload", "mapa-tests")
29+
extensionRegistry.Register(kubeTestsExtension)
30+
31+
// Carve up the kube tests into our openshift suites...
32+
kubeTestsExtension.AddSuite(extension.Suite{
33+
Name: "mapa/conformance/parallel",
34+
Parents: []string{
35+
"openshift/conformance/parallel",
36+
},
37+
Qualifiers: []string{`!labels.exists(l, l == "Serial") && labels.exists(l, l == "Conformance")`},
38+
})
39+
40+
kubeTestsExtension.AddSuite(extension.Suite{
41+
Name: "mapa/conformance/serial",
42+
Parents: []string{
43+
"openshift/conformance/serial",
44+
},
45+
Qualifiers: []string{`labels.exists(l, l == "Serial") && labels.exists(l, l == "Conformance")`},
46+
})
47+
48+
// Build our specs from ginkgo
49+
specs, err := ginkgo.BuildExtensionTestSpecsFromOpenShiftGinkgoSuite()
50+
if err != nil {
51+
panic(err)
52+
}
53+
54+
// Let's scan for tests with a platform label and create the rule for them such as [platform:aws]
55+
foundPlatforms := make(map[string]string)
56+
for _, test := range specs.Select(extensiontests.NameContains("[platform:")).Names() {
57+
re := regexp.MustCompile(`\[platform:[a-z]*]`)
58+
match := re.FindStringSubmatch(test)
59+
for _, platformDef := range match {
60+
if _, ok := foundPlatforms[platformDef]; !ok {
61+
platform := platformDef[strings.Index(platformDef, ":")+1 : len(platformDef)-1]
62+
foundPlatforms[platformDef] = platform
63+
specs.Select(extensiontests.NameContains(platformDef)).
64+
Include(extensiontests.PlatformEquals(platform))
65+
}
66+
}
67+
68+
}
69+
70+
kubeTestsExtension.AddSpecs(specs)
71+
72+
// Cobra stuff
73+
root := &cobra.Command{
74+
Long: "Machine API Operator tests extension for OpenShift",
75+
}
76+
77+
root.AddCommand(cmd.DefaultExtensionCommands(extensionRegistry)...)
78+
79+
if err := func() error {
80+
return root.Execute()
81+
}(); err != nil {
82+
os.Exit(1)
83+
}
84+
}

openshift-tests/go.mod

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
module github.com/openshift/machine-api-provider-aws/openshift-tests
2+
3+
go 1.24.0
4+
5+
// These are needed for the OTE tests. Due to how we get the kubeconfig from the command line, there doesn't seem to be
6+
// an API yet we can leverage so that I do not have to copy what openshift/kubernetes/openshift-hack/cmd/k8s-tests-ext did to initialize.
7+
replace (
8+
github.com/onsi/ginkgo/v2 => github.com/openshift/onsi-ginkgo/v2 v2.6.1-0.20251001123353-fd5b1fb35db1
9+
github.com/openshift/machine-api-provider-aws => ../
10+
k8s.io/apiserver => github.com/openshift/kubernetes/staging/src/k8s.io/apiserver v0.0.0-20251015171918-61114aa5a292 // openshift kubernetes has very old copy of k8s.io/kubernetes/pkg/kubelet/server/server.go
11+
k8s.io/kubelet => github.com/openshift/kubernetes/staging/src/k8s.io/kubelet v0.0.0-20251015171918-61114aa5a292 // openshift kubernetes has very old copy of k8s.io/kubernetes/cmd/kubelet/app/options/options.go
12+
k8s.io/kubernetes => github.com/openshift/kubernetes v1.30.1-0.20251027205255-4e0347881cbd
13+
)
14+
15+
require (
16+
github.com/aws/aws-sdk-go-v2/config v1.31.12
17+
github.com/aws/aws-sdk-go-v2/service/ec2 v1.233.0
18+
github.com/onsi/ginkgo/v2 v2.27.2
19+
github.com/onsi/gomega v1.38.2
20+
github.com/openshift-eng/openshift-tests-extension v0.0.0-20260127124016-0fed2b824818
21+
github.com/openshift/api v0.0.0-20260114133223-6ab113cb7368
22+
github.com/openshift/client-go v0.0.0-20251202151200-fb4471581cf8
23+
github.com/openshift/machine-api-operator v0.2.1-0.20260116124544-4610a83ed692
24+
github.com/openshift/machine-api-provider-aws v0.0.0-00010101000000-000000000000
25+
github.com/spf13/cobra v1.10.1
26+
github.com/spf13/pflag v1.0.10
27+
k8s.io/apimachinery v0.34.1
28+
k8s.io/client-go v0.34.1
29+
k8s.io/component-base v0.34.1
30+
)
31+
32+
require (
33+
cel.dev/expr v0.24.0 // indirect
34+
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
35+
github.com/MakeNowJust/heredoc v1.0.0 // indirect
36+
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
37+
github.com/aws/aws-sdk-go v1.55.8 // indirect
38+
github.com/aws/aws-sdk-go-v2 v1.39.2 // indirect
39+
github.com/aws/aws-sdk-go-v2/credentials v1.18.16 // indirect
40+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.9 // indirect
41+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.9 // indirect
42+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.9 // indirect
43+
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect
44+
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.1 // indirect
45+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.9 // indirect
46+
github.com/aws/aws-sdk-go-v2/service/sso v1.29.6 // indirect
47+
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.1 // indirect
48+
github.com/aws/aws-sdk-go-v2/service/sts v1.38.6 // indirect
49+
github.com/aws/smithy-go v1.23.0 // indirect
50+
github.com/beorn7/perks v1.0.1 // indirect
51+
github.com/blang/semver v3.5.1+incompatible // indirect
52+
github.com/blang/semver/v4 v4.0.0 // indirect
53+
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
54+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
55+
github.com/chai2010/gettext-go v1.0.3 // indirect
56+
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
57+
github.com/distribution/reference v0.6.0 // indirect
58+
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
59+
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
60+
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect
61+
github.com/felixge/httpsnoop v1.0.4 // indirect
62+
github.com/fsnotify/fsnotify v1.9.0 // indirect
63+
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
64+
github.com/go-errors/errors v1.5.1 // indirect
65+
github.com/go-logr/logr v1.4.3 // indirect
66+
github.com/go-logr/stdr v1.2.2 // indirect
67+
github.com/go-openapi/jsonpointer v0.21.0 // indirect
68+
github.com/go-openapi/jsonreference v0.21.0 // indirect
69+
github.com/go-openapi/swag v0.23.0 // indirect
70+
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
71+
github.com/gogo/protobuf v1.3.2 // indirect
72+
github.com/google/btree v1.1.3 // indirect
73+
github.com/google/cel-go v0.26.0 // indirect
74+
github.com/google/gnostic-models v0.7.0 // indirect
75+
github.com/google/go-cmp v0.7.0 // indirect
76+
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 // indirect
77+
github.com/google/uuid v1.6.0 // indirect
78+
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
79+
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
80+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect
81+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
82+
github.com/jmespath/go-jmespath v0.4.0 // indirect
83+
github.com/josharian/intern v1.0.0 // indirect
84+
github.com/json-iterator/go v1.1.12 // indirect
85+
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
86+
github.com/mailru/easyjson v0.9.0 // indirect
87+
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
88+
github.com/moby/spdystream v0.5.0 // indirect
89+
github.com/moby/term v0.5.2 // indirect
90+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
91+
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
92+
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
93+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
94+
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
95+
github.com/opencontainers/go-digest v1.0.0 // indirect
96+
github.com/openshift/library-go v0.0.0-20251107090138-0de9712313a5 // indirect
97+
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
98+
github.com/pkg/errors v0.9.1 // indirect
99+
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
100+
github.com/prometheus/client_golang v1.23.2 // indirect
101+
github.com/prometheus/client_model v0.6.2 // indirect
102+
github.com/prometheus/common v0.66.1 // indirect
103+
github.com/prometheus/procfs v0.16.1 // indirect
104+
github.com/russross/blackfriday/v2 v2.1.0 // indirect
105+
github.com/stoewer/go-strcase v1.3.0 // indirect
106+
github.com/x448/float16 v0.8.4 // indirect
107+
github.com/xlab/treeprint v1.2.0 // indirect
108+
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
109+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // indirect
110+
go.opentelemetry.io/otel v1.36.0 // indirect
111+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 // indirect
112+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 // indirect
113+
go.opentelemetry.io/otel/metric v1.36.0 // indirect
114+
go.opentelemetry.io/otel/sdk v1.34.0 // indirect
115+
go.opentelemetry.io/otel/trace v1.36.0 // indirect
116+
go.opentelemetry.io/proto/otlp v1.5.0 // indirect
117+
go.yaml.in/yaml/v2 v2.4.3 // indirect
118+
go.yaml.in/yaml/v3 v3.0.4 // indirect
119+
golang.org/x/crypto v0.44.0 // indirect
120+
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect
121+
golang.org/x/net v0.47.0 // indirect
122+
golang.org/x/oauth2 v0.30.0 // indirect
123+
golang.org/x/sync v0.18.0 // indirect
124+
golang.org/x/sys v0.38.0 // indirect
125+
golang.org/x/term v0.37.0 // indirect
126+
golang.org/x/text v0.31.0 // indirect
127+
golang.org/x/time v0.14.0 // indirect
128+
golang.org/x/tools v0.38.0 // indirect
129+
gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect
130+
google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb // indirect
131+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a // indirect
132+
google.golang.org/grpc v1.72.1 // indirect
133+
google.golang.org/protobuf v1.36.8 // indirect
134+
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
135+
gopkg.in/inf.v0 v0.9.1 // indirect
136+
gopkg.in/yaml.v3 v3.0.1 // indirect
137+
k8s.io/api v0.34.1 // indirect
138+
k8s.io/apiextensions-apiserver v0.34.1 // indirect
139+
k8s.io/apiserver v0.34.1 // indirect
140+
k8s.io/cli-runtime v0.34.1 // indirect
141+
k8s.io/component-helpers v0.34.1 // indirect
142+
k8s.io/controller-manager v0.32.1 // indirect
143+
k8s.io/klog/v2 v2.130.1 // indirect
144+
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect
145+
k8s.io/kubectl v0.34.1 // indirect
146+
k8s.io/kubelet v0.34.1 // indirect
147+
k8s.io/kubernetes v1.34.1 // indirect
148+
k8s.io/pod-security-admission v0.32.2 // indirect
149+
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect
150+
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 // indirect
151+
sigs.k8s.io/controller-runtime v0.22.3 // indirect
152+
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
153+
sigs.k8s.io/kustomize/api v0.20.1 // indirect
154+
sigs.k8s.io/kustomize/kyaml v0.20.1 // indirect
155+
sigs.k8s.io/randfill v1.0.0 // indirect
156+
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
157+
sigs.k8s.io/yaml v1.6.0 // indirect
158+
)
159+
160+
replace github.com/openshift/api => github.com/vr4manta/api v0.0.0-20260126150647-31e7152a2e04

0 commit comments

Comments
 (0)