Skip to content

Commit 2c528b0

Browse files
Merge pull request #127 from jparrill/OCPBUGS-63573
OCPBUGS-63573: Fix scheme compatibility issues by updating hypershift/api dependency
2 parents f8f37e2 + c34125b commit 2c528b0

File tree

507 files changed

+19976
-34623
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

507 files changed

+19976
-34623
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ go.work.sum
2828
# build output
2929
dist/
3030
_output/
31+
bin/
3132

3233
# Editors
3334
.vscode/

.goreleaser.ci.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# GoReleaser v2 configuration for CI environments
2+
# This configuration is optimized for CI builds without full Git history
3+
version: 2
4+
5+
project_name: hypershift-oadp-plugin
6+
7+
# Git configuration for CI environments
8+
git:
9+
tag_sort: -version:refname
10+
11+
before:
12+
hooks:
13+
- go mod tidy
14+
- go mod vendor
15+
16+
builds:
17+
- id: default
18+
env:
19+
- CGO_ENABLED=0
20+
goos:
21+
- linux
22+
- darwin
23+
goarch:
24+
- amd64
25+
- arm64
26+
binary: hypershift-oadp-plugin-{{ .Os }}-{{ .Arch }}
27+
main: ./main.go
28+
ldflags:
29+
- -s -w -extldflags "-static"
30+
- -X github.com/openshift/hypershift-oadp-plugin/pkg/version.Version={{.Version}}
31+
- -X github.com/openshift/hypershift-oadp-plugin/pkg/version.Commit={{.Commit}}
32+
- -X github.com/openshift/hypershift-oadp-plugin/pkg/version.Date={{.Date}}
33+
34+
archives:
35+
- id: default
36+
name_template: "{{ .ProjectName }}_{{ .Version }}"
37+
files:
38+
- LICENSE
39+
- README.md
40+
- none*
41+
42+
checksum:
43+
name_template: 'checksums.txt'
44+
algorithm: sha256
45+
46+
# Skip changelog generation in CI to avoid Git history dependencies
47+
changelog:
48+
disable: true
49+
50+
# Configure snapshot mode for CI builds
51+
snapshot:
52+
version_template: "{{ incpatch .Version }}-snapshot"
53+
54+
# Skip release creation in CI
55+
release:
56+
disable: true

.goreleaser.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# GoReleaser v2 configuration
2+
version: 2
3+
14
project_name: hypershift-oadp-plugin
25

36
before:
@@ -6,7 +9,8 @@ before:
69
- go mod vendor
710

811
builds:
9-
- env:
12+
- id: default
13+
env:
1014
- CGO_ENABLED=0
1115
goos:
1216
- linux
@@ -23,7 +27,8 @@ builds:
2327
- -X github.com/openshift/hypershift-oadp-plugin/pkg/version.Date={{.Date}}
2428

2529
archives:
26-
- name_template: "{{ .ProjectName }}_{{ .Version }}"
30+
- id: default
31+
name_template: "{{ .ProjectName }}_{{ .Version }}"
2732
files:
2833
- LICENSE
2934
- README.md

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM registry.ci.openshift.org/openshift/release:rhel-9-release-golang-1.23-openshift-4.19 AS build
15+
FROM registry.ci.openshift.org/openshift/release:rhel-9-release-golang-1.24-openshift-4.20 AS build
1616
WORKDIR /go/src/github.com/openshift/hypershift-oadp-plugin
1717
COPY . .
1818
RUN CGO_ENABLED=0 go build -o /go/bin/hypershift-oadp-plugin .
1919

20-
FROM registry.access.redhat.com/ubi9-minimal
20+
FROM registry.access.redhat.com/ubi9-minimal
2121
RUN mkdir /plugins
2222
COPY --from=build /go/bin/hypershift-oadp-plugin /plugins/
2323
USER 65532:65532

Dockerfile.oadp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#@follow_tag(registry-proxy.engineering.redhat.com/rh-osbs/openshift-golang-builder:rhel_9_golang_1.23)
2-
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_golang_1.23 AS builder
2+
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_golang_1.24 AS builder
33

44
COPY . /workspace
55
WORKDIR /workspace/

Makefile

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,27 @@ GO=GO111MODULE=on GOWORK=off GOFLAGS=-mod=vendor go
2424

2525
.PHONY: install-goreleaser
2626
install-goreleaser:
27-
## Latest version of goreleaser v1. V2 requires go 1.24+
28-
@echo "Installing goreleaser..."
29-
@GOFLAGS= go install github.com/goreleaser/[email protected]
27+
## Using goreleaser v2 compatible with go 1.24
28+
@echo "Installing goreleaser v2..."
29+
@mkdir -p ./bin
30+
@GOBIN=$(PWD)/bin GOFLAGS= go install github.com/goreleaser/goreleaser/v2@latest
3031
@echo "Goreleaser installed successfully!"
3132

3233
.PHONY: local
3334
local: verify install-goreleaser build-dirs
34-
goreleaser build --snapshot --clean
35+
./bin/goreleaser build --snapshot --clean
3536
@mkdir -p dist/$(BIN)_$(VERSION)
36-
@mv dist/$(BIN)_*/* dist/$(BIN)_$(VERSION)/
37-
@rm -rf dist/$(BIN)_darwin_* dist/$(BIN)_linux_*
37+
@find dist/default_*/ -name "$(BIN)-*" -exec cp {} dist/$(BIN)_$(VERSION)/ \;
38+
@echo "Binaries copied to dist/$(BIN)_$(VERSION)/"
39+
@ls -la dist/$(BIN)_$(VERSION)/
3840

3941
.PHONY: release
4042
release: verify install-goreleaser
41-
goreleaser release --clean
43+
./bin/goreleaser release --clean
4244

4345
.PHONY: release-local
4446
release-local: verify install-goreleaser build-dirs
45-
GORELEASER_CURRENT_TAG=$(VERSION) goreleaser build --clean
47+
GORELEASER_CURRENT_TAG=$(VERSION) ./bin/goreleaser build --clean
4648

4749
.PHONY: tests
4850
test:
@@ -56,8 +58,23 @@ cover:
5658
deps:
5759
$(GO) mod tidy && $(GO) mod vendor
5860

61+
.PHONY: update-deps
62+
update-deps:
63+
@echo "Running dependency update script..."
64+
$(GO) run scripts/update-dependencies.go
65+
5966
.PHONY: verify
60-
verify: verify-modules test
67+
verify: verify-modules test verify-goreleaser
68+
69+
.PHONY: verify-goreleaser
70+
verify-goreleaser: install-goreleaser
71+
@echo "Verifying GoReleaser CI configuration..."
72+
./bin/goreleaser check --config .goreleaser.ci.yaml
73+
74+
.PHONY: verify-goreleaser-dev
75+
verify-goreleaser-dev: install-goreleaser
76+
@echo "Verifying GoReleaser development configuration..."
77+
./bin/goreleaser check
6178

6279
.PHONY: docker-build
6380
docker-build:
@@ -82,4 +99,4 @@ build-dirs:
8299
.PHONY: clean
83100
clean:
84101
@echo "cleaning"
85-
rm -rf _output dist
102+
rm -rf _output dist bin

README.md

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,62 @@ For detailed technical documentation and implementation guides, please refer to
2727
- **[AWS Examples](./examples/AWS/)** - Complete examples for AWS platform including backup, restore, and configuration files
2828
- **[BareMetal Examples](./examples/BareMetal/)** - Examples for bare metal deployments
2929
- **[KubeVirt Examples](./examples/kubevirt/)** - Examples for KubeVirt platform
30-
- **[OpenStack Examples](./examples/Openstack/)** - Examples for OpenStack platform
30+
- **[OpenStack Examples](./examples/Openstack/)** - Examples for OpenStack platform
31+
32+
## Development
33+
34+
### Dependency Management
35+
36+
This project includes automated dependency validation to ensure compatibility with upstream dependencies. The validation is performed through integration tests located in `tests/integration/dependencies/`.
37+
38+
#### Dependency Validation Test
39+
40+
The dependency validation test (`dependencies_test.go`) automatically checks that watched dependencies are up-to-date with their respective upstream main branches. This helps prevent:
41+
- Schema-related compatibility issues
42+
- API version mismatches
43+
- Runtime errors due to outdated dependencies
44+
45+
Currently watched dependencies:
46+
- `github.com/openshift/hypershift/api` - Core HyperShift API definitions
47+
48+
#### Updating Dependencies
49+
50+
If the dependency validation test fails, you can update all watched dependencies automatically using:
51+
52+
```bash
53+
make update-deps
54+
```
55+
56+
This command will:
57+
1. Parse the watched dependencies from the test file
58+
2. Update each dependency to the latest commit from the main branch
59+
3. Run `go mod tidy` and `go mod vendor` to clean up the dependency tree
60+
4. Provide detailed output about which dependencies were updated
61+
62+
#### Manual Dependency Updates
63+
64+
For manual dependency updates, you can also run:
65+
66+
```bash
67+
# Update a specific dependency
68+
go get github.com/openshift/hypershift/api@main
69+
70+
# Clean up and vendor dependencies
71+
go mod tidy && go mod vendor
72+
```
73+
74+
#### Adding New Watched Dependencies
75+
76+
To add a new dependency to the validation process:
77+
78+
1. Add the dependency to the `watchedDependencies` map in `tests/integration/dependencies/dependencies_test.go`
79+
2. The format is: `"module-path": "upstream-repo-url"`
80+
3. The update script will automatically discover and update the new dependency
81+
82+
Example:
83+
```go
84+
var watchedDependencies = map[string]string{
85+
"github.com/openshift/hypershift/api": "https://github.com/openshift/hypershift",
86+
"github.com/example/new-module": "https://github.com/example/repo",
87+
}
88+
```

go.mod

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
11
module github.com/openshift/hypershift-oadp-plugin
22

3-
go 1.23.0
4-
5-
toolchain go1.23.6
3+
go 1.24.4
64

75
require (
86
github.com/kubernetes-csi/external-snapshotter/client/v8 v8.2.0
9-
github.com/onsi/gomega v1.35.1
7+
github.com/onsi/gomega v1.38.0
108
github.com/openshift/hive/apis v0.0.0-20241220022629-3f49f26197ff
11-
github.com/openshift/hypershift/api v0.0.0-20250108163049-830af0531d12
9+
github.com/openshift/hypershift/api v0.0.0-20251027193323-9e76b0a736a8
1210
github.com/sirupsen/logrus v1.9.3
1311
github.com/vmware-tanzu/velero v1.14.0
1412
k8s.io/api v0.32.3
15-
k8s.io/apiextensions-apiserver v0.31.3
16-
sigs.k8s.io/controller-runtime v0.19.3
13+
k8s.io/apiextensions-apiserver v0.32.3
14+
sigs.k8s.io/controller-runtime v0.20.4
1715
)
1816

1917
require (
2018
github.com/beorn7/perks v1.0.1 // indirect
2119
github.com/cespare/xxhash/v2 v2.3.0 // indirect
22-
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
20+
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
21+
github.com/fsnotify/fsnotify v1.8.0 // indirect
2322
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
24-
github.com/google/gnostic-models v0.6.8 // indirect
25-
github.com/google/go-cmp v0.6.0 // indirect
23+
github.com/google/btree v1.1.3 // indirect
24+
github.com/google/gnostic-models v0.6.9 // indirect
25+
github.com/google/go-cmp v0.7.0 // indirect
2626
github.com/google/uuid v1.6.0 // indirect
27-
github.com/klauspost/compress v1.17.11 // indirect
2827
github.com/kubernetes-csi/external-snapshotter/client/v7 v7.0.0 // indirect
29-
github.com/openshift/api v0.0.0-20250418132733-f636181788a9 // indirect
28+
github.com/openshift/api v0.0.0-20250609083529-2b129d95495e // indirect
3029
github.com/openshift/custom-resource-status v1.1.3-0.20220503160415-f2fdb4999d87 // indirect
31-
github.com/prometheus/client_golang v1.20.5 // indirect
32-
github.com/prometheus/client_model v0.6.1 // indirect
33-
github.com/prometheus/common v0.62.0 // indirect
34-
github.com/prometheus/procfs v0.15.1 // indirect
30+
github.com/prometheus/client_golang v1.22.0 // indirect
31+
github.com/prometheus/client_model v0.6.2 // indirect
32+
github.com/prometheus/common v0.65.0 // indirect
33+
github.com/prometheus/procfs v0.16.1 // indirect
3534
github.com/x448/float16 v0.8.4 // indirect
36-
golang.org/x/exp v0.0.0-20240213143201-ec583247a57a // indirect
37-
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
35+
golang.org/x/sync v0.16.0 // indirect
36+
gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect
3837
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
38+
sigs.k8s.io/randfill v1.0.0 // indirect
3939
)
4040

4141
require (
4242
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
43-
github.com/emicklei/go-restful/v3 v3.11.2 // indirect
43+
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
4444
github.com/fatih/color v1.18.0 // indirect
45-
github.com/go-logr/logr v1.4.2 // indirect
46-
github.com/go-openapi/jsonpointer v0.21.0 // indirect
47-
github.com/go-openapi/jsonreference v0.20.4 // indirect
48-
github.com/go-openapi/swag v0.23.0 // indirect
45+
github.com/go-logr/logr v1.4.3 // indirect
46+
github.com/go-openapi/jsonpointer v0.21.1 // indirect
47+
github.com/go-openapi/jsonreference v0.21.0 // indirect
48+
github.com/go-openapi/swag v0.23.1 // indirect
4949
github.com/gobwas/glob v0.2.3 // indirect
5050
github.com/gogo/protobuf v1.3.2 // indirect
5151
github.com/golang/protobuf v1.5.4 // indirect
@@ -56,7 +56,7 @@ require (
5656
github.com/inconshreveable/mousetrap v1.1.0 // indirect
5757
github.com/josharian/intern v1.0.0 // indirect
5858
github.com/json-iterator/go v1.1.12 // indirect
59-
github.com/mailru/easyjson v0.7.7 // indirect
59+
github.com/mailru/easyjson v0.9.0 // indirect
6060
github.com/mattn/go-colorable v0.1.14 // indirect
6161
github.com/mattn/go-isatty v0.0.20 // indirect
6262
github.com/mitchellh/go-testing-interface v1.0.0 // indirect
@@ -65,26 +65,26 @@ require (
6565
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
6666
github.com/oklog/run v1.0.0 // indirect
6767
github.com/pkg/errors v0.9.1 // indirect
68-
github.com/spf13/cobra v1.8.1 // indirect
69-
github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace // indirect
70-
golang.org/x/net v0.38.0 // indirect
71-
golang.org/x/oauth2 v0.27.0 // indirect
72-
golang.org/x/sys v0.31.0 // indirect
73-
golang.org/x/term v0.30.0 // indirect
74-
golang.org/x/text v0.23.0 // indirect
75-
golang.org/x/time v0.9.0 // indirect
68+
github.com/spf13/cobra v1.9.1 // indirect
69+
github.com/spf13/pflag v1.0.7 // indirect
70+
golang.org/x/net v0.42.0 // indirect
71+
golang.org/x/oauth2 v0.30.0 // indirect
72+
golang.org/x/sys v0.35.0 // indirect
73+
golang.org/x/term v0.34.0 // indirect
74+
golang.org/x/text v0.28.0 // indirect
75+
golang.org/x/time v0.11.0 // indirect
7676
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect
7777
google.golang.org/grpc v1.69.4 // indirect
78-
google.golang.org/protobuf v1.36.3 // indirect
78+
google.golang.org/protobuf v1.36.6 // indirect
7979
gopkg.in/inf.v0 v0.9.1 // indirect
8080
gopkg.in/yaml.v3 v3.0.1 // indirect
8181
k8s.io/apimachinery v0.32.3
8282
k8s.io/client-go v0.32.3
8383
k8s.io/klog/v2 v2.130.1 // indirect
84-
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect
85-
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738
86-
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
87-
sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect
84+
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect
85+
k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e
86+
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
87+
sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect
8888
sigs.k8s.io/yaml v1.4.0 // indirect
8989
)
9090

0 commit comments

Comments
 (0)