Skip to content

Commit

Permalink
Remove ORC from CAPO
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilienM committed Jan 10, 2025
1 parent 8f2cc78 commit d39c163
Show file tree
Hide file tree
Showing 145 changed files with 65 additions and 30,495 deletions.
5 changes: 1 addition & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,16 @@
# limitations under the License.

# Build the manager binary
FROM golang:1.22.0 as builder
FROM golang:1.23.0 as builder
WORKDIR /workspace

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

# Copy the Go Modules manifests
RUN mkdir orc
COPY go.mod go.mod
COPY go.sum go.sum
COPY orc/go.mod orc/go.mod
COPY orc/go.sum orc/go.sum

# Cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
Expand Down
22 changes: 3 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,13 @@ kubebuilder_assets: $(SETUP_ENVTEST)

.PHONY: test
TEST_PATHS ?= ./...
test: test-capo test-orc
test: test-capo

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

.PHONY: test-orc
test-orc:
$(MAKE) -C $(REPO_ROOT)/orc test

E2E_TEMPLATES_DIR=test/e2e/data/infrastructure-openstack
E2E_KUSTOMIZE_DIR=test/e2e/data/kustomize
# This directory holds the templates that do not require ci-artifacts script injection.
Expand Down Expand Up @@ -259,12 +255,10 @@ $(GO_APIDIFF): # Build go-apidiff.
.PHONY: lint
lint: $(GOLANGCI_LINT) ## Lint codebase
$(GOLANGCI_LINT) run -v --fast=false
$(MAKE) -C $(REPO_ROOT)/orc lint

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

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

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

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

.PHONY: generate-go
generate-go: $(MOCKGEN)
Expand All @@ -296,10 +289,6 @@ generate-controller-gen: $(CONTROLLER_GEN)
generate-codegen: generate-controller-gen
./hack/update-codegen.sh

.PHONY: generate-orc
generate-orc:
$(MAKE) -C $(REPO_ROOT)/orc generate

.PHONY: generate-conversion-gen
generate-conversion-gen: $(CONVERSION_GEN)
$(CONVERSION_GEN) \
Expand All @@ -323,7 +312,6 @@ generate-manifests: $(CONTROLLER_GEN) ## Generate manifests e.g. CRD, RBAC etc.
$(CONTROLLER_GEN) \
paths=./ \
paths=./controllers/... \
paths=./orc/internal/controllers/... \
output:rbac:dir=$(RBAC_ROOT) \
rbac:roleName=manager-role

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

.PHONY: verify
verify: verify-boilerplate verify-modules verify-gen verify-orc
verify: verify-boilerplate verify-modules verify-gen

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

.PHONY: verify-orc
verify-orc:
$(MAKE) -C $(REPO_ROOT)/orc verify-generated

.PHONY: compile-e2e
compile-e2e: ## Test e2e compilation
go test -c -o /dev/null -tags=e2e ./test/e2e/suites/conformance
Expand Down
3 changes: 0 additions & 3 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ resources:
- ../webhook
- ../certmanager

# ORC
- ../../orc/config/crd

patches:
# Provide customizable hook for make targets.
- path: manager_image_patch.yaml
Expand Down
20 changes: 0 additions & 20 deletions config/rbac/role.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module sigs.k8s.io/cluster-api-provider-openstack

go 1.22.0
go 1.23.0

toolchain go1.23.4

require (
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
Expand All @@ -9,9 +11,9 @@ require (
github.com/google/gofuzz v1.2.0
github.com/google/uuid v1.6.0
github.com/gophercloud/gophercloud/v2 v2.4.0
github.com/gophercloud/utils/v2 v2.0.0-20241008104625-7cbb8fd76bb7
github.com/gophercloud/utils/v2 v2.0.0-20241209100706-e3a3b7c07d26
github.com/hashicorp/go-version v1.7.0
github.com/k-orc/openstack-resource-controller v0.0.0-00010101000000-000000000000
github.com/k-orc/openstack-resource-controller v1.0.0
github.com/onsi/ginkgo/v2 v2.22.2
github.com/onsi/gomega v1.36.2
github.com/prometheus/client_golang v1.20.5
Expand Down Expand Up @@ -119,7 +121,6 @@ require (
github.com/spf13/viper v1.19.0 // indirect
github.com/stoewer/go-strcase v1.3.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/ulikunitz/xz v0.5.12 // indirect
github.com/valyala/fastjson v1.6.4 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
Expand Down Expand Up @@ -157,5 +158,3 @@ require (
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/kind v0.24.0 // indirect
)

replace github.com/k-orc/openstack-resource-controller => ./orc
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gophercloud/gophercloud/v2 v2.4.0 h1:XhP5tVEH3ni66NSNK1+0iSO6kaGPH/6srtx6Cr+8eCg=
github.com/gophercloud/gophercloud/v2 v2.4.0/go.mod h1:uJWNpTgJPSl2gyzJqcU/pIAhFUWvIkp8eE8M15n9rs4=
github.com/gophercloud/utils/v2 v2.0.0-20241008104625-7cbb8fd76bb7 h1:RDFC3+cVfeCQ8zi/PgaKrPzJyUbwzg3Mi2xCWnAW+g4=
github.com/gophercloud/utils/v2 v2.0.0-20241008104625-7cbb8fd76bb7/go.mod h1:hLzf9Ts2fhebZrZAtq6BpbwXQLEZmUqa7ABJMkg/il8=
github.com/gophercloud/utils/v2 v2.0.0-20241209100706-e3a3b7c07d26 h1:N65GYmx5LrMeYdeXcxMESDU+2pDyAOXlFNlHl7siUwM=
github.com/gophercloud/utils/v2 v2.0.0-20241209100706-e3a3b7c07d26/go.mod h1:7SHUbtoiSYINNKgAVxse+PMhIio05IK7shHy8DVRaN0=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw=
Expand Down Expand Up @@ -163,6 +163,8 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/k-orc/openstack-resource-controller v1.0.0 h1:XfwU/uS2ZXldvQkICgZXU/lUoqqzN2kNo5U0s+/wEo0=
github.com/k-orc/openstack-resource-controller v1.0.0/go.mod h1:9Soe+EjuTK7ePrZ5k5mjEO+fAsS8W+6KGyzvbrAUtEc=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
Expand Down Expand Up @@ -277,8 +279,6 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7otjonDflCTK0BCfls4SPy3NcCVb5dqqmbRknE=
github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk=
github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc=
github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
github.com/valyala/fastjson v1.6.4 h1:uAUNq9Z6ymTgGhcm0UynUAB6tlbakBrz6CQFax3BXVQ=
github.com/valyala/fastjson v1.6.4/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY=
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
Expand Down
12 changes: 4 additions & 8 deletions hack/tools/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module sigs.k8s.io/cluster-api-provider-openstack/hack/tools

go 1.22.7
go 1.23.0

toolchain go1.23.2

Expand Down Expand Up @@ -55,15 +55,15 @@ require (
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gophercloud/gophercloud/v2 v2.4.0 // indirect
github.com/gophercloud/utils/v2 v2.0.0-20241008104625-7cbb8fd76bb7 // indirect
github.com/gophercloud/utils/v2 v2.0.0-20241209100706-e3a3b7c07d26 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/imdario/mergo v0.3.15 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/itchyny/timefmt-go v0.1.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/k-orc/openstack-resource-controller v0.0.0-00010101000000-000000000000 // indirect
github.com/k-orc/openstack-resource-controller v1.0.0 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
Expand All @@ -88,7 +88,6 @@ require (
github.com/spf13/cobra v1.8.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stoewer/go-strcase v1.3.0 // indirect
github.com/ulikunitz/xz v0.5.12 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/xlab/treeprint v1.2.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
Expand Down Expand Up @@ -146,7 +145,4 @@ require (
sigs.k8s.io/yaml v1.4.0 // indirect
)

replace (
github.com/k-orc/openstack-resource-controller => ../../orc
sigs.k8s.io/cluster-api-provider-openstack => ../..
)
replace sigs.k8s.io/cluster-api-provider-openstack => ../..
8 changes: 4 additions & 4 deletions hack/tools/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gophercloud/gophercloud/v2 v2.4.0 h1:XhP5tVEH3ni66NSNK1+0iSO6kaGPH/6srtx6Cr+8eCg=
github.com/gophercloud/gophercloud/v2 v2.4.0/go.mod h1:uJWNpTgJPSl2gyzJqcU/pIAhFUWvIkp8eE8M15n9rs4=
github.com/gophercloud/utils/v2 v2.0.0-20241008104625-7cbb8fd76bb7 h1:RDFC3+cVfeCQ8zi/PgaKrPzJyUbwzg3Mi2xCWnAW+g4=
github.com/gophercloud/utils/v2 v2.0.0-20241008104625-7cbb8fd76bb7/go.mod h1:hLzf9Ts2fhebZrZAtq6BpbwXQLEZmUqa7ABJMkg/il8=
github.com/gophercloud/utils/v2 v2.0.0-20241209100706-e3a3b7c07d26 h1:N65GYmx5LrMeYdeXcxMESDU+2pDyAOXlFNlHl7siUwM=
github.com/gophercloud/utils/v2 v2.0.0-20241209100706-e3a3b7c07d26/go.mod h1:7SHUbtoiSYINNKgAVxse+PMhIio05IK7shHy8DVRaN0=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw=
Expand Down Expand Up @@ -164,6 +164,8 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/k-orc/openstack-resource-controller v1.0.0 h1:XfwU/uS2ZXldvQkICgZXU/lUoqqzN2kNo5U0s+/wEo0=
github.com/k-orc/openstack-resource-controller v1.0.0/go.mod h1:9Soe+EjuTK7ePrZ5k5mjEO+fAsS8W+6KGyzvbrAUtEc=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
Expand Down Expand Up @@ -290,8 +292,6 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7otjonDflCTK0BCfls4SPy3NcCVb5dqqmbRknE=
github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk=
github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc=
github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
github.com/valyala/fastjson v1.6.4 h1:uAUNq9Z6ymTgGhcm0UynUAB6tlbakBrz6CQFax3BXVQ=
github.com/valyala/fastjson v1.6.4/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY=
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
Expand Down
14 changes: 0 additions & 14 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/webhook"

orcv1alpha1 "github.com/k-orc/openstack-resource-controller/api/v1alpha1"
orccontrollers "github.com/k-orc/openstack-resource-controller/pkg/controllers"

infrav1alpha1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha1"
infrav1alpha6 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha6"
Expand Down Expand Up @@ -342,19 +341,6 @@ func setupReconcilers(ctx context.Context, mgr ctrl.Manager, caCerts []byte) {
setupLog.Error(err, "unable to create controller", "controller", "OpenStackServer")
os.Exit(1)
}

orcFactory := orccontrollers.NewScopeFactory(scopeCacheMaxSize)

if err := orccontrollers.ImageController(
mgr.GetClient(),
mgr.GetEventRecorderFor("orc-image-controller"),
watchFilterValue,
orcFactory,
caCerts,
).SetupWithManager(ctx, mgr, concurrency(openStackMachineConcurrency)); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "ORCImage")
os.Exit(1)
}
}

func setupWebhooks(mgr ctrl.Manager) {
Expand Down
3 changes: 0 additions & 3 deletions orc/.dockerignore

This file was deleted.

24 changes: 0 additions & 24 deletions orc/.gitignore

This file was deleted.

47 changes: 0 additions & 47 deletions orc/.golangci.yml

This file was deleted.

Loading

0 comments on commit d39c163

Please sign in to comment.