Skip to content

Commit 88f5c66

Browse files
authored
Merge pull request #2346 from shiftstack/orc
🌱 Remove ORC from CAPO
2 parents 53f3189 + 8f69620 commit 88f5c66

File tree

147 files changed

+89
-30487
lines changed

Some content is hidden

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

147 files changed

+89
-30487
lines changed

Dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,16 @@
1313
# limitations under the License.
1414

1515
# Build the manager binary
16-
FROM golang:1.22.0 AS builder
16+
FROM golang:1.23.0 AS builder
1717
WORKDIR /workspace
1818

1919
# Run this with docker build --build_arg goproxy=$(go env GOPROXY) to override the goproxy
2020
ARG goproxy=https://proxy.golang.org
2121
ENV GOPROXY=$goproxy
2222

2323
# Copy the Go Modules manifests
24-
RUN mkdir orc
2524
COPY go.mod go.mod
2625
COPY go.sum go.sum
27-
COPY orc/go.mod orc/go.mod
28-
COPY orc/go.sum orc/go.sum
2926

3027
# Cache deps before building and copying source so that we don't need to re-download as much
3128
# and so that source changes don't invalidate our downloaded layer

Makefile

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -150,17 +150,13 @@ kubebuilder_assets: $(SETUP_ENVTEST)
150150

151151
.PHONY: test
152152
TEST_PATHS ?= ./...
153-
test: test-capo test-orc
153+
test: test-capo
154154

155155
.PHONY: test-capo
156156
test-capo: $(ARTIFACTS) $(GOTESTSUM) kubebuilder_assets
157157
KUBEBUILDER_ASSETS="$(KUBEBUILDER_ASSETS)" $(GOTESTSUM) --junitfile $(ARTIFACTS)/junit.test.xml --junitfile-hide-empty-pkg --jsonfile $(ARTIFACTS)/test-output.log -- \
158158
-v $(TEST_PATHS) $(TEST_ARGS)
159159

160-
.PHONY: test-orc
161-
test-orc:
162-
$(MAKE) -C $(REPO_ROOT)/orc test
163-
164160
E2E_TEMPLATES_DIR=test/e2e/data/infrastructure-openstack
165161
E2E_KUSTOMIZE_DIR=test/e2e/data/kustomize
166162
# This directory holds the templates that do not require ci-artifacts script injection.
@@ -259,12 +255,10 @@ $(GO_APIDIFF): # Build go-apidiff.
259255
.PHONY: lint
260256
lint: $(GOLANGCI_LINT) ## Lint codebase
261257
$(GOLANGCI_LINT) run -v --fast=false
262-
$(MAKE) -C $(REPO_ROOT)/orc lint
263258

264259
.PHONY: lint-update
265260
lint-update: $(GOLANGCI_LINT) ## Lint codebase
266261
$(GOLANGCI_LINT) run -v --fast=false --fix
267-
$(MAKE) -C $(REPO_ROOT)/orc lint-fix
268262

269263
lint-fast: $(GOLANGCI_LINT) ## Run only faster linters to detect possible issues
270264
$(GOLANGCI_LINT) run -v --fast=true
@@ -275,12 +269,11 @@ lint-fast: $(GOLANGCI_LINT) ## Run only faster linters to detect possible issues
275269

276270
.PHONY: modules
277271
modules: ## Runs go mod to ensure proper vendoring.
278-
$(MAKE) -C $(REPO_ROOT)/orc modules
279272
go mod tidy
280273
cd $(TOOLS_DIR); go mod tidy
281274

282275
.PHONY: generate
283-
generate: templates generate-orc generate-controller-gen generate-codegen generate-conversion-gen generate-go generate-manifests generate-api-docs ## Generate all generated code
276+
generate: templates generate-controller-gen generate-codegen generate-conversion-gen generate-go generate-manifests generate-api-docs ## Generate all generated code
284277

285278
.PHONY: generate-go
286279
generate-go: $(MOCKGEN)
@@ -296,10 +289,6 @@ generate-controller-gen: $(CONTROLLER_GEN)
296289
generate-codegen: generate-controller-gen
297290
./hack/update-codegen.sh
298291

299-
.PHONY: generate-orc
300-
generate-orc:
301-
$(MAKE) -C $(REPO_ROOT)/orc generate
302-
303292
.PHONY: generate-conversion-gen
304293
generate-conversion-gen: $(CONVERSION_GEN)
305294
$(CONVERSION_GEN) \
@@ -323,7 +312,6 @@ generate-manifests: $(CONTROLLER_GEN) ## Generate manifests e.g. CRD, RBAC etc.
323312
$(CONTROLLER_GEN) \
324313
paths=./ \
325314
paths=./controllers/... \
326-
paths=./orc/internal/controllers/... \
327315
output:rbac:dir=$(RBAC_ROOT) \
328316
rbac:roleName=manager-role
329317

@@ -564,7 +552,7 @@ clean-release: ## Remove the release folder
564552
rm -rf $(RELEASE_DIR)
565553

566554
.PHONY: verify
567-
verify: verify-boilerplate verify-modules verify-gen verify-orc
555+
verify: verify-boilerplate verify-modules verify-gen
568556

569557
.PHONY: verify-boilerplate
570558
verify-boilerplate:
@@ -584,10 +572,6 @@ verify-gen: generate
584572
echo "generated files are out of date, run make generate"; exit 1; \
585573
fi
586574

587-
.PHONY: verify-orc
588-
verify-orc:
589-
$(MAKE) -C $(REPO_ROOT)/orc verify-generated
590-
591575
.PHONY: compile-e2e
592576
compile-e2e: ## Test e2e compilation
593577
go test -c -o /dev/null -tags=e2e ./test/e2e/suites/conformance

config/default/kustomization.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ resources:
1313
- ../webhook
1414
- ../certmanager
1515

16-
# ORC
17-
- ../../orc/config/crd
18-
1916
patches:
2017
# Provide customizable hook for make targets.
2118
- path: manager_image_patch.yaml

config/rbac/role.yaml

Lines changed: 0 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

controllers/openstackserver_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ type OpenStackServerReconciler struct {
7777

7878
// +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=openstackservers,verbs=get;list;watch;create;update;patch;delete
7979
// +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=openstackservers/status,verbs=get;update;patch
80+
// +kubebuilder:rbac:groups=openstack.k-orc.cloud,resources=images,verbs=get;list;watch
8081

8182
func (r *OpenStackServerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, reterr error) {
8283
log := ctrl.LoggerFrom(ctx)

docs/book/src/clusteropenstack/configuration.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- [cloud-init based images](#cloud-init-based-images)
99
- [Ignition based images](#ignition-based-images)
1010
- [SSH key pair](#ssh-key-pair)
11+
- [ORC](#orc)
1112
- [OpenStack credential](#openstack-credential)
1213
- [Generate credentials](#generate-credentials)
1314
- [CA certificates](#ca-certificates)
@@ -129,6 +130,27 @@ In order to access cluster nodes via SSH, you must either
129130
[access nodes through the bastion host](#accessing-nodes-through-the-bastion-host-via-ssh)
130131
or [configure custom security groups](#security-groups) with rules allowing ingress for port 22.
131132

133+
## ORC
134+
135+
ORC ([OpenStack Resource Controller](https://github.com/k-orc/openstack-resource-controller)) provides a set of Kubernetes controllers and is required by CAPO to
136+
manage some OpenStack resources. ORC is a separate project and is not part of CAPO, therefore it needs to be installed separately.
137+
138+
To install ORC, run the following command:
139+
140+
```bash
141+
ORC_VERSION=v1.0.0
142+
kubectl apply -f "https://github.com/k-orc/openstack-resource-controller/releases/download/${ORC_VERSION}/install.yaml"
143+
```
144+
145+
We also publish a Kustomize module which can be used to install ORC:
146+
147+
```bash
148+
kubectl apply --server-side -k "https://github.com/k-orc/openstack-resource-controller/dist?ref=${ORC_VERSION}"
149+
```
150+
151+
In most cases, the default configuration should be sufficient.
152+
Check the [ORC documentation](https://k-orc.cloud) for more information.
153+
132154
## OpenStack credential
133155

134156
### Generate credentials

go.mod

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module sigs.k8s.io/cluster-api-provider-openstack
22

3-
go 1.22.0
3+
go 1.23.0
4+
5+
toolchain go1.23.4
46

57
require (
68
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
@@ -9,9 +11,9 @@ require (
911
github.com/google/gofuzz v1.2.0
1012
github.com/google/uuid v1.6.0
1113
github.com/gophercloud/gophercloud/v2 v2.4.0
12-
github.com/gophercloud/utils/v2 v2.0.0-20241008104625-7cbb8fd76bb7
14+
github.com/gophercloud/utils/v2 v2.0.0-20241209100706-e3a3b7c07d26
1315
github.com/hashicorp/go-version v1.7.0
14-
github.com/k-orc/openstack-resource-controller v0.0.0-00010101000000-000000000000
16+
github.com/k-orc/openstack-resource-controller v1.0.0
1517
github.com/onsi/ginkgo/v2 v2.22.2
1618
github.com/onsi/gomega v1.36.2
1719
github.com/prometheus/client_golang v1.20.5
@@ -120,7 +122,6 @@ require (
120122
github.com/spf13/viper v1.19.0 // indirect
121123
github.com/stoewer/go-strcase v1.3.0 // indirect
122124
github.com/subosito/gotenv v1.6.0 // indirect
123-
github.com/ulikunitz/xz v0.5.12 // indirect
124125
github.com/valyala/fastjson v1.6.4 // indirect
125126
github.com/x448/float16 v0.8.4 // indirect
126127
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
@@ -158,5 +159,3 @@ require (
158159
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
159160
sigs.k8s.io/kind v0.25.0 // indirect
160161
)
161-
162-
replace github.com/k-orc/openstack-resource-controller => ./orc

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
135135
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
136136
github.com/gophercloud/gophercloud/v2 v2.4.0 h1:XhP5tVEH3ni66NSNK1+0iSO6kaGPH/6srtx6Cr+8eCg=
137137
github.com/gophercloud/gophercloud/v2 v2.4.0/go.mod h1:uJWNpTgJPSl2gyzJqcU/pIAhFUWvIkp8eE8M15n9rs4=
138-
github.com/gophercloud/utils/v2 v2.0.0-20241008104625-7cbb8fd76bb7 h1:RDFC3+cVfeCQ8zi/PgaKrPzJyUbwzg3Mi2xCWnAW+g4=
139-
github.com/gophercloud/utils/v2 v2.0.0-20241008104625-7cbb8fd76bb7/go.mod h1:hLzf9Ts2fhebZrZAtq6BpbwXQLEZmUqa7ABJMkg/il8=
138+
github.com/gophercloud/utils/v2 v2.0.0-20241209100706-e3a3b7c07d26 h1:N65GYmx5LrMeYdeXcxMESDU+2pDyAOXlFNlHl7siUwM=
139+
github.com/gophercloud/utils/v2 v2.0.0-20241209100706-e3a3b7c07d26/go.mod h1:7SHUbtoiSYINNKgAVxse+PMhIio05IK7shHy8DVRaN0=
140140
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
141141
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
142142
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw=
@@ -163,6 +163,8 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm
163163
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
164164
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
165165
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
166+
github.com/k-orc/openstack-resource-controller v1.0.0 h1:XfwU/uS2ZXldvQkICgZXU/lUoqqzN2kNo5U0s+/wEo0=
167+
github.com/k-orc/openstack-resource-controller v1.0.0/go.mod h1:9Soe+EjuTK7ePrZ5k5mjEO+fAsS8W+6KGyzvbrAUtEc=
166168
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
167169
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
168170
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
@@ -272,8 +274,6 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8
272274
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
273275
github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7otjonDflCTK0BCfls4SPy3NcCVb5dqqmbRknE=
274276
github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk=
275-
github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc=
276-
github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
277277
github.com/valyala/fastjson v1.6.4 h1:uAUNq9Z6ymTgGhcm0UynUAB6tlbakBrz6CQFax3BXVQ=
278278
github.com/valyala/fastjson v1.6.4/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY=
279279
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=

hack/tools/go.mod

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module sigs.k8s.io/cluster-api-provider-openstack/hack/tools
22

3-
go 1.22.7
3+
go 1.23.0
44

55
toolchain go1.23.2
66

@@ -55,15 +55,15 @@ require (
5555
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
5656
github.com/google/uuid v1.6.0 // indirect
5757
github.com/gophercloud/gophercloud/v2 v2.4.0 // indirect
58-
github.com/gophercloud/utils/v2 v2.0.0-20241008104625-7cbb8fd76bb7 // indirect
58+
github.com/gophercloud/utils/v2 v2.0.0-20241209100706-e3a3b7c07d26 // indirect
5959
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect
6060
github.com/hashicorp/go-version v1.7.0 // indirect
6161
github.com/imdario/mergo v0.3.15 // indirect
6262
github.com/inconshreveable/mousetrap v1.1.0 // indirect
6363
github.com/itchyny/timefmt-go v0.1.6 // indirect
6464
github.com/josharian/intern v1.0.0 // indirect
6565
github.com/json-iterator/go v1.1.12 // indirect
66-
github.com/k-orc/openstack-resource-controller v0.0.0-00010101000000-000000000000 // indirect
66+
github.com/k-orc/openstack-resource-controller v1.0.0 // indirect
6767
github.com/klauspost/compress v1.17.9 // indirect
6868
github.com/kylelemons/godebug v1.1.0 // indirect
6969
github.com/mailru/easyjson v0.7.7 // indirect
@@ -88,7 +88,6 @@ require (
8888
github.com/spf13/cobra v1.8.1 // indirect
8989
github.com/spf13/pflag v1.0.5 // indirect
9090
github.com/stoewer/go-strcase v1.3.0 // indirect
91-
github.com/ulikunitz/xz v0.5.12 // indirect
9291
github.com/x448/float16 v0.8.4 // indirect
9392
github.com/xlab/treeprint v1.2.0 // indirect
9493
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
@@ -146,7 +145,4 @@ require (
146145
sigs.k8s.io/yaml v1.4.0 // indirect
147146
)
148147

149-
replace (
150-
github.com/k-orc/openstack-resource-controller => ../../orc
151-
sigs.k8s.io/cluster-api-provider-openstack => ../..
152-
)
148+
replace sigs.k8s.io/cluster-api-provider-openstack => ../..

hack/tools/go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
134134
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
135135
github.com/gophercloud/gophercloud/v2 v2.4.0 h1:XhP5tVEH3ni66NSNK1+0iSO6kaGPH/6srtx6Cr+8eCg=
136136
github.com/gophercloud/gophercloud/v2 v2.4.0/go.mod h1:uJWNpTgJPSl2gyzJqcU/pIAhFUWvIkp8eE8M15n9rs4=
137-
github.com/gophercloud/utils/v2 v2.0.0-20241008104625-7cbb8fd76bb7 h1:RDFC3+cVfeCQ8zi/PgaKrPzJyUbwzg3Mi2xCWnAW+g4=
138-
github.com/gophercloud/utils/v2 v2.0.0-20241008104625-7cbb8fd76bb7/go.mod h1:hLzf9Ts2fhebZrZAtq6BpbwXQLEZmUqa7ABJMkg/il8=
137+
github.com/gophercloud/utils/v2 v2.0.0-20241209100706-e3a3b7c07d26 h1:N65GYmx5LrMeYdeXcxMESDU+2pDyAOXlFNlHl7siUwM=
138+
github.com/gophercloud/utils/v2 v2.0.0-20241209100706-e3a3b7c07d26/go.mod h1:7SHUbtoiSYINNKgAVxse+PMhIio05IK7shHy8DVRaN0=
139139
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
140140
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
141141
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw=
@@ -166,6 +166,8 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm
166166
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
167167
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
168168
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
169+
github.com/k-orc/openstack-resource-controller v1.0.0 h1:XfwU/uS2ZXldvQkICgZXU/lUoqqzN2kNo5U0s+/wEo0=
170+
github.com/k-orc/openstack-resource-controller v1.0.0/go.mod h1:9Soe+EjuTK7ePrZ5k5mjEO+fAsS8W+6KGyzvbrAUtEc=
169171
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
170172
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
171173
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
@@ -292,8 +294,6 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8
292294
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
293295
github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7otjonDflCTK0BCfls4SPy3NcCVb5dqqmbRknE=
294296
github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk=
295-
github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc=
296-
github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
297297
github.com/valyala/fastjson v1.6.4 h1:uAUNq9Z6ymTgGhcm0UynUAB6tlbakBrz6CQFax3BXVQ=
298298
github.com/valyala/fastjson v1.6.4/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY=
299299
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=

0 commit comments

Comments
 (0)