Skip to content

Commit

Permalink
Implement POST /v3/service_brokers
Browse files Browse the repository at this point in the history
* Globally available brokers are only supported (space-restricted
  brokers are currently out of scope)
* Introduce the `CFServiceBroker` custom resource
* The `CFServiceBroker` controller sets its `Ready` state
* Implement `POST /v3/service_brokers`
* Only allow admin users to create brokers
* The `CFServiceBroker` object is created in the root namespace (as it
  is globally available)
* Implement `GET /v3/jobs/service_broker.create~<broker-guid>` to return
  `COMPLETE` job state once the broker is ready
* Validate broker name uniqueness via a validating webhook

fixes #3263
  • Loading branch information
danail-branekov committed Jun 10, 2024
1 parent 91ecdc6 commit c39ae26
Show file tree
Hide file tree
Showing 42 changed files with 2,541 additions and 59 deletions.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,15 @@ COMPONENTS=api $(CONTROLLERS)
manifests:
@for comp in $(COMPONENTS); do make -C $$comp manifests; done

generate:
generate: install-controller-gen
$(CONTROLLER_GEN) object:headerFile="controllers/hack/boilerplate.go.txt" paths="./model/..."
@for comp in $(CONTROLLERS); do make -C $$comp generate; done
go run ./scripts/helmdoc/main.go > README.helm.md

CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
install-controller-gen:
GOBIN=$(shell pwd)/bin go install sigs.k8s.io/controller-tools/cmd/controller-gen

generate-fakes:
go generate ./...

Expand Down
2 changes: 2 additions & 0 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ COPY go.mod go.sum ./
RUN --mount=type=cache,target=/go/pkg/mod \
go mod download

COPY model model
COPY api/actions api/actions
COPY api/errors api/errors
COPY api/authorization api/authorization
Expand All @@ -26,6 +27,7 @@ COPY controllers/config controllers/config
COPY controllers/controllers/shared controllers/controllers/shared
COPY controllers/controllers/workloads controllers/controllers/workloads
COPY controllers/controllers/services/credentials controllers/controllers/services/credentials
COPY controllers/controllers/services/brokers controllers/controllers/services/brokers
COPY controllers/webhooks controllers/webhooks
COPY tools tools
COPY version version
Expand Down
123 changes: 123 additions & 0 deletions api/handlers/fake/cfservice_broker_repository.go

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

123 changes: 123 additions & 0 deletions api/handlers/fake/state_repository.go

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

Loading

0 comments on commit c39ae26

Please sign in to comment.