Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
8 changes: 8 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,11 @@ issues:
- gosec
- gochecknoglobals
- goerr113
# Exclude some linters from running within the 'test/e2e/' directory.
- path: test/e2e/.*
linters:
- gocyclo
- dupl
- gosec
- gochecknoglobals
- goerr113
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.24-openshift-4.21 AS builder
WORKDIR /go/src/github.com/openshift/cluster-control-plane-machine-set-operator
COPY . .
RUN make build
RUN make build && \
gzip bin/cluster-control-plane-machine-set-operator-ext

FROM registry.ci.openshift.org/ocp/4.21:base-rhel9
COPY --from=builder /go/src/github.com/openshift/cluster-control-plane-machine-set-operator/bin/manager .
COPY --from=builder /go/src/github.com/openshift/cluster-control-plane-machine-set-operator/manifests manifests
COPY --from=builder /go/src/github.com/openshift/cluster-control-plane-machine-set-operator/bin/cluster-control-plane-machine-set-operator-ext.gz .

LABEL io.openshift.release.operator true
LABEL io.k8s.display-name="OpenShift Cluster Control Plane Machine Set Operator" \
io.openshift.release.operator=true \
io.openshift.tags="openshift,tests,e2e,e2e-extension"
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,18 @@ verify-%: ## Ensure no diff after running some other target
##@ Build

.PHONY: build
build: generate fmt vet ## Build manager binary.
build: generate fmt vet operator tests-ext ## Build all binaries

operator: ## Build main operator binary
go build -o bin/manager ./cmd/control-plane-machine-set-operator

tests-ext: ## Build tests extension binary
cd openshift-tests-extension && GOWORK=off go build -mod=mod -o ../bin/cluster-control-plane-machine-set-operator-ext ./cmd

.PHONY: update-tests-ext-vendor
update-tests-ext-vendor: ## Update tests-ext vendor directory
cd openshift-tests-extension && go mod tidy && go mod vendor && go mod verify

.PHONY: images
images: ## Create images
$(ENGINE) build -t "$(IMAGE):$(VERSION)" -t "$(IMAGE):$(MUTABLE_TAG)" ./
Expand Down
78 changes: 78 additions & 0 deletions openshift-tests-extension/cmd/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/*
Copyright 2025 Red Hat, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package main

import (
"fmt"
"os"

"github.com/openshift-eng/openshift-tests-extension/pkg/cmd"
e "github.com/openshift-eng/openshift-tests-extension/pkg/extension"
g "github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo"
"github.com/spf13/cobra"

"sigs.k8s.io/controller-runtime/pkg/envtest/komega"

// If using ginkgo, import your tests here.
_ "github.com/openshift/cluster-control-plane-machine-set-operator/test/e2e"
"github.com/openshift/cluster-control-plane-machine-set-operator/test/e2e/framework"
)

func main() {
extensionRegistry := e.NewRegistry()
ext := e.NewExtension("openshift", "payload", "cluster-control-plane-machine-set-operator")

ext.AddSuite(e.Suite{
Name: "cpmso/periodic",
Qualifiers: []string{`labels.exists(l, l == "Periodic")`},
})

ext.AddSuite(e.Suite{
Name: "cpmso/presubmit",
Qualifiers: []string{`labels.exists(l, l == "PreSubmit")`},
})

specs, err := g.BuildExtensionTestSpecsFromOpenShiftGinkgoSuite()
if err != nil {
panic(fmt.Sprintf("couldn't build extension test specs from ginkgo: %+v", err.Error()))
}

// Initialize framework before running tests
specs.AddBeforeAll(func() {
if err := framework.InitFramework(); err != nil {
panic(fmt.Sprintf("failed to initialize framework: %v", err))
}

komega.SetClient(framework.GlobalFramework.GetClient())
komega.SetContext(framework.GlobalFramework.GetContext())
})

ext.AddSpecs(specs)
extensionRegistry.Register(ext)

root := &cobra.Command{
Long: "cluster-control-plane-machine-set-operator tests extension for OpenShift",
}

root.AddCommand(cmd.DefaultExtensionCommands(extensionRegistry)...)

if err := func() error {
return root.Execute()
}(); err != nil {
os.Exit(1)
}
}
88 changes: 88 additions & 0 deletions openshift-tests-extension/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
module github.com/openshift/cluster-control-plane-machine-set-operator/openshift-tests-extension

go 1.24.3

require (
github.com/openshift-eng/openshift-tests-extension v0.0.0-20251024155203-c498f9efe478
github.com/openshift/cluster-control-plane-machine-set-operator v0.0.0-20251029084908-344babe6a957
github.com/spf13/cobra v1.10.1
sigs.k8s.io/controller-runtime v0.22.3
)

require (
cel.dev/expr v0.24.0 // indirect
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.20.3 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/go-test/deep v1.1.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/btree v1.1.3 // indirect
github.com/google/cel-go v0.26.0 // indirect
github.com/google/gnostic-models v0.7.0 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/onsi/ginkgo/v2 v2.27.2 // indirect
github.com/onsi/gomega v1.38.2 // indirect
github.com/openshift/api v0.0.0-20251027215121-243758deaab1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.22.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.62.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/spf13/pflag v1.0.9 // indirect
github.com/stoewer/go-strcase v1.3.0 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.yaml.in/yaml/v2 v2.4.2 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/net v0.43.0 // indirect
golang.org/x/oauth2 v0.28.0 // indirect
golang.org/x/sync v0.17.0 // indirect
golang.org/x/sys v0.36.0 // indirect
golang.org/x/term v0.35.0 // indirect
golang.org/x/text v0.29.0 // indirect
golang.org/x/time v0.10.0 // indirect
golang.org/x/tools v0.36.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250303144028-a0af3efb3deb // indirect
google.golang.org/protobuf v1.36.7 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/api v0.34.1 // indirect
k8s.io/apiextensions-apiserver v0.34.1 // indirect
k8s.io/apimachinery v0.34.1 // indirect
k8s.io/client-go v0.34.1 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
sigs.k8s.io/yaml v1.6.0 // indirect
)

replace (
github.com/onsi/ginkgo/v2 => github.com/openshift/onsi-ginkgo/v2 v2.6.1-0.20251001123353-fd5b1fb35db1
github.com/openshift/cluster-control-plane-machine-set-operator => ../
)
Loading