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
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.
5 changes: 5 additions & 0 deletions openshift-hack/images/Dockerfile.openshift
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ RUN CGO_ENABLED=0 GOOS=${GOOS} GOPROXY=${GOPROXY} go build \
-o=gcp-cloud-controller-manager \
./cmd/cloud-controller-manager

RUN cd openshift-tests && \
GOPROXY=${GOPROXY} make build && \
gzip /build/openshift-tests/bin/cloud-controller-manager-gcp-tests-ext

FROM registry.ci.openshift.org/ocp/5.0:base-rhel9

LABEL description="GCP Cloud Controller Manager"

COPY --from=builder /build/gcp-cloud-controller-manager /bin/gcp-cloud-controller-manager
COPY --from=builder /build/openshift-tests/bin/cloud-controller-manager-gcp-tests-ext.gz /usr/bin/cloud-controller-manager-gcp-tests-ext.gz

ENTRYPOINT [ "/bin/gcp-cloud-controller-manager" ]
33 changes: 33 additions & 0 deletions openshift-hack/update-ote.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

# Update vendor dependencies for the OTE (openshift-tests) suite and commit
# the result as a carry patch.
#
# Intended to be run as a rebasebot post-rebase hook:
# --post-rebase-hook git:main:/openshift-hack/update-ote.sh

set -e
set -o pipefail

OTE_DIR="${REBASEBOT_WORKING_DIR}/openshift-tests"

echo "Updating OTE vendor dependencies in ${OTE_DIR}"
pushd "${OTE_DIR}" > /dev/null

make vendor

popd > /dev/null

if [[ -z "$REBASEBOT_GIT_USERNAME" || -z "$REBASEBOT_GIT_EMAIL" ]]; then
author_flag=()
else
author_flag=(--author="${REBASEBOT_GIT_USERNAME} <${REBASEBOT_GIT_EMAIL}>")
fi

if [[ -n $(git status --porcelain openshift-tests/) ]]; then
git add openshift-tests/
git commit "${author_flag[@]}" \
-m "UPSTREAM: <carry>: Update OTE vendor dependencies"
else
echo "No changes to OTE vendor dependencies"
fi
2 changes: 2 additions & 0 deletions openshift-tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/bin/
/__pycache__/
30 changes: 30 additions & 0 deletions openshift-tests/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
GOWORK=off

GOGCFLAGS ?=
LD_FLAGS ?= -w -s

.PHONY: build
build: cloud-controller-manager-gcp-tests-ext

.PHONY: vendor
vendor:
./sync-openshift-tests-k8s-deps.py
GOWORK=$(GOWORK) go mod tidy
GOWORK=$(GOWORK) go mod vendor

.PHONY: check
check:
@diff="$$(find . -not \( -wholename './vendor' -o -wholename './vendor/*' \) -prune -o -name '*.go' -exec gofmt -d -s {} + 2>&1 || true)"; \
if [ -n "$$diff" ]; then \
echo "$$diff" >&2; \
exit 1; \
fi
GOWORK=$(GOWORK) go vet .
python3 -m unittest ./test_sync_openshift_tests_k8s_deps.py

.PHONY: cloud-controller-manager-gcp-tests-ext
cloud-controller-manager-gcp-tests-ext:
mkdir -p bin
GOWORK=$(GOWORK) CGO_ENABLED=0 go build -mod=vendor $(GOGCFLAGS) \
-o bin/cloud-controller-manager-gcp-tests-ext \
-trimpath -ldflags "$(LD_FLAGS)" .
18 changes: 18 additions & 0 deletions openshift-tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# openshift-tests

This is an OTE (OpenShift Tests Extension) suite for the GCP cloud controller manager. It runs the upstream GCP e2es from the parent suite and adds downstream OpenShift-specific tests.
Comment thread
coderabbitai[bot] marked this conversation as resolved.

## Run locally

Build the binary, then run one of the suites against a GCP OpenShift cluster with `KUBECONFIG` set and Google credentials available through `GOOGLE_APPLICATION_CREDENTIALS`:

```sh
make build
KUBECONFIG=/path/to/kubeconfig \
GOOGLE_APPLICATION_CREDENTIALS=/path/to/gce.json \
./bin/cloud-controller-manager-gcp-tests-ext run-suite ccm/gcp/conformance/parallel
```

Use `ccm/gcp/conformance/serial` for the serial suite.

If you have access to a CI or Cluster Bot Prow job for the target cluster, `gce.json` can be obtained from `/var/run/secrets/ci.openshift.io/cluster-profile/..data/gce.json`.
183 changes: 183 additions & 0 deletions openshift-tests/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
module k8s.io/cloud-provider-gcp/openshift-tests

go 1.25.0

// Local imports
require (
k8s.io/cloud-provider-gcp/providers v0.0.0-00010101000000-000000000000
k8s.io/cloud-provider-gcp/test/e2e v0.0.0-00010101000000-000000000000
)

replace (
k8s.io/cloud-provider-gcp/providers => ../providers
k8s.io/cloud-provider-gcp/test/e2e => ../test/e2e
)

// We must use OTE's forked Ginkgo
replace github.com/onsi/ginkgo/v2 => github.com/openshift/onsi-ginkgo/v2 v2.6.1-0.20260424201627-4d4cc33d669d

require (
github.com/openshift-eng/openshift-tests-extension v0.0.0-20250916161632-d81c09058835
github.com/openshift/client-go v0.0.0-20260429123927-c81f86abfa6a
github.com/sirupsen/logrus v1.9.4
github.com/spf13/cobra v1.10.0
golang.org/x/oauth2 v0.34.0
k8s.io/api v0.35.1
k8s.io/apimachinery v0.35.1
k8s.io/client-go v0.35.1
k8s.io/kubernetes v1.35.1
)

require (
cel.dev/expr v0.25.1 // indirect
cloud.google.com/go/auth v0.9.5 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect
cloud.google.com/go/compute/metadata v0.9.0 // indirect
github.com/GoogleCloudPlatform/k8s-cloud-provider v1.27.0 // indirect
github.com/Masterminds/semver/v3 v3.4.0 // indirect
github.com/NYTimes/gziphandler v1.1.1 // indirect
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/coreos/go-semver v0.3.1 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
github.com/felixge/httpsnoop v1.0.4 // 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-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // 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-20260115054156-294ebfa9ad83 // indirect
github.com/google/s2a-go v0.1.8 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
github.com/googleapis/gax-go/v2 v2.13.0 // indirect
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.1 // 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/kylelemons/godebug v1.1.0 // indirect
github.com/mailru/easyjson v0.9.0 // indirect
github.com/moby/spdystream v0.5.1 // 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/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/onsi/ginkgo/v2 v2.27.2 // indirect
github.com/onsi/gomega v1.39.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/openshift/api v0.0.0-20260429122012-1180c0f5c3e9 // 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.23.2 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.66.1 // indirect
github.com/prometheus/procfs v0.16.1 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/spf13/pflag v1.0.10 // indirect
github.com/stoewer/go-strcase v1.3.0 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.etcd.io/etcd/api/v3 v3.6.5 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.6.5 // indirect
go.etcd.io/etcd/client/v3 v3.6.5 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect
go.opentelemetry.io/otel v1.41.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0 // indirect
go.opentelemetry.io/otel/metric v1.41.0 // indirect
go.opentelemetry.io/otel/sdk v1.41.0 // indirect
go.opentelemetry.io/otel/trace v1.41.0 // indirect
go.opentelemetry.io/proto/otlp v1.7.1 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
go.yaml.in/yaml/v2 v2.4.3 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/crypto v0.48.0 // indirect
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect
golang.org/x/mod v0.32.0 // indirect
golang.org/x/net v0.49.0 // indirect
golang.org/x/sync v0.19.0 // indirect
golang.org/x/sys v0.41.0 // indirect
golang.org/x/term v0.40.0 // indirect
golang.org/x/text v0.34.0 // indirect
golang.org/x/time v0.10.0 // indirect
golang.org/x/tools v0.41.0 // indirect
google.golang.org/api v0.199.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect
google.golang.org/grpc v1.79.3 // indirect
google.golang.org/protobuf v1.36.10 // indirect
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
gopkg.in/gcfg.v1 v1.2.3 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.35.1 // indirect
k8s.io/apiserver v0.35.1 // indirect
k8s.io/cloud-provider v0.35.1 // indirect
k8s.io/component-base v0.35.1 // indirect
k8s.io/component-helpers v0.35.1 // indirect
k8s.io/controller-manager v0.35.1 // indirect
k8s.io/klog/v2 v2.140.0 // indirect
k8s.io/kms v0.35.1 // indirect
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect
k8s.io/kubectl v0.0.0 // indirect
k8s.io/kubelet v0.35.1 // indirect
k8s.io/pod-security-admission v0.35.1 // indirect
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 // indirect
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // 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
)

// Pin all k8s.io staging repos to match the rest of the repo
replace (
k8s.io/api => k8s.io/api v0.35.1
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.35.1
k8s.io/apimachinery => k8s.io/apimachinery v0.35.1
k8s.io/apiserver => k8s.io/apiserver v0.35.1
k8s.io/cli-runtime => k8s.io/cli-runtime v0.35.1
k8s.io/client-go => k8s.io/client-go v0.35.1
k8s.io/cloud-provider => k8s.io/cloud-provider v0.35.1
k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.35.1
k8s.io/code-generator => k8s.io/code-generator v0.35.1
k8s.io/component-base => k8s.io/component-base v0.35.1
k8s.io/component-helpers => k8s.io/component-helpers v0.35.1
k8s.io/controller-manager => k8s.io/controller-manager v0.35.1
k8s.io/cri-api => k8s.io/cri-api v0.35.1
k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.35.1
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.35.1
k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.35.1
k8s.io/kube-proxy => k8s.io/kube-proxy v0.35.1
k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.35.1
k8s.io/kubectl => k8s.io/kubectl v0.35.1
k8s.io/kubelet => k8s.io/kubelet v0.35.1
k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.35.1
k8s.io/metrics => k8s.io/metrics v0.35.1
k8s.io/mount-utils => k8s.io/mount-utils v0.35.1
k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.35.1
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.35.1
)
Loading