-
Notifications
You must be signed in to change notification settings - Fork 443
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate controller RBAC from kubebuilder marks
- Loading branch information
Showing
5 changed files
with
112 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
HAS_LINT := $(shell command -v golangci-lint;) | ||
HAS_CONTROLLER_GEN := $(shell command -v controller-gen) | ||
COMMIT := v1beta1-$(shell git rev-parse --short=7 HEAD) | ||
KATIB_REGISTRY := docker.io/kubeflowkatib | ||
CPU_ARCH ?= amd64 | ||
|
@@ -13,7 +14,7 @@ TEST_TENSORFLOW_EVENT_FILE_PATH ?= $(CURDIR)/test/unit/v1beta1/metricscollector/ | |
test: | ||
go test ./pkg/... ./cmd/... -coverprofile coverage.out | ||
|
||
check: generate fmt vet lint | ||
check: generate manifests fmt vet lint | ||
|
||
fmt: | ||
hack/verify-gofmt.sh | ||
|
@@ -53,8 +54,15 @@ endif | |
cd ./pkg/apis/manager/v1beta1 && ./build.sh | ||
cd ./pkg/apis/manager/health && ./build.sh | ||
|
||
manifests: | ||
ifndef | ||
go install sigs.k8s.io/controller-tools/cmd/[email protected] | ||
echo "controller-gen has been installed" | ||
endif | ||
controller-gen +rbac:roleName=katib-controller +paths=./pkg/controller.v1beta1/... +output:dir=./manifests/v1beta1/components/controller | ||
|
||
# Build images for the Katib v1beta1 components. | ||
build: generate | ||
build: generate manifests | ||
ifeq ($(and $(REGISTRY),$(TAG),$(CPU_ARCH)),) | ||
$(error REGISTRY and TAG must be set. Usage: make build REGISTRY=<registry> TAG=<tag> CPU_ARCH=<cpu-architecture>) | ||
endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
creationTimestamp: null | ||
name: katib-controller | ||
rules: | ||
- apiGroups: | ||
- apps | ||
resources: | ||
- deployments | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
- apiGroups: | ||
- apps | ||
resources: | ||
- deployments/status | ||
verbs: | ||
- get | ||
- patch | ||
- update | ||
- apiGroups: | ||
- experiments.kubeflow.org | ||
resources: | ||
- experiments | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
- apiGroups: | ||
- experiments.kubeflow.org | ||
resources: | ||
- experiments/status | ||
verbs: | ||
- get | ||
- patch | ||
- update | ||
- apiGroups: | ||
- katib.kubeflow.org | ||
resources: | ||
- suggestions | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
- apiGroups: | ||
- katib.kubeflow.org | ||
resources: | ||
- suggestions/status | ||
verbs: | ||
- get | ||
- patch | ||
- update | ||
- apiGroups: | ||
- trials.kubeflow.org | ||
resources: | ||
- trials | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
- apiGroups: | ||
- trials.kubeflow.org | ||
resources: | ||
- trials/status | ||
verbs: | ||
- get | ||
- patch | ||
- update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters