-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CSI 3418 | add the option to developers to do generation in thier loc…
…al env (#216) * add the option to developers to do generation in thier local env Signed-off-by: matancarmeli7 <[email protected]> * add commands to docker Signed-off-by: matancarmeli7 <[email protected]> * remove clean bin function Signed-off-by: matancarmeli7 <[email protected]> * rename update-yamls.sh script Signed-off-by: matancarmeli7 <[email protected]> * change usnit tests make name Signed-off-by: matancarmeli7 <[email protected]> * update kusromiztion.yaml patrh for genrated operator Signed-off-by: matancarmeli7 <[email protected]> * remove make from run_unittests.sh Signed-off-by: matancarmeli7 <[email protected]> * Pr Signed-off-by: matancarmeli7 <[email protected]> * set ginkgo version Signed-off-by: matancarmeli7 <[email protected]> * move go get dependencies in unittests dockerfile Signed-off-by: matancarmeli7 <[email protected]> * use the check-generated-manifests Signed-off-by: matancarmeli7 <[email protected]>
- Loading branch information
1 parent
4151340
commit 3c8d55c
Showing
8 changed files
with
805 additions
and
966 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 |
---|---|---|
|
@@ -39,11 +39,11 @@ manifests: controller-gen kustomize## Generate WebhookConfiguration, ClusterRole | |
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations. | ||
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..." | ||
|
||
CONTROLLER_GEN = $(shell pwd)/bin/controller-gen | ||
CONTROLLER_GEN = controller-gen | ||
controller-gen: ## Download controller-gen locally if necessary. | ||
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/[email protected]) | ||
|
||
KUSTOMIZE = $(shell pwd)/bin/kustomize | ||
KUSTOMIZE = kustomize | ||
kustomize: ## Download kustomize locally if necessary. | ||
$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/[email protected]) | ||
|
||
|
@@ -55,26 +55,43 @@ TMP_DIR=$$(mktemp -d) ;\ | |
cd $$TMP_DIR ;\ | ||
go mod init tmp ;\ | ||
echo "Downloading $(2)" ;\ | ||
GOBIN=$(PROJECT_DIR)/bin go get $(2) ;\ | ||
go get $(2) ;\ | ||
rm -rf $$TMP_DIR ;\ | ||
} | ||
endef | ||
|
||
# custom | ||
run_unit_tests_image=docker run --rm -v $(CURDIR):/go/src/github.com/IBM/ibm-block-csi-operator -t operator-unittests | ||
|
||
.PHONY: olm-validation | ||
olm-validation: | ||
build/ci/olm_validation.sh | ||
|
||
.PHONY: build-unit-tests-image | ||
build-unit-tests-image: | ||
docker build -f build/ci/Dockerfile.unittest -t operator-unittests . | ||
|
||
.PHONY: run-unit-tests | ||
run-unit-tests: | ||
$(run_unit_tests_image) make test | ||
|
||
.PHONY: test | ||
test: update | ||
hack/check-generated-manifests.sh | ||
test: check-generated-manifests update | ||
ginkgo -r -v -skipPackage tests | ||
|
||
.PHONY: update | ||
update: | ||
update: kustomize | ||
hack/update-all.sh | ||
|
||
.PHONY: check-generated-manifests | ||
check-generated-manifests: | ||
hack/check-generated-manifests.sh | ||
|
||
.PHONY: update-generated-yamls | ||
update-generated-yamls: | ||
$(run_unit_tests_image) hack/update-config-yamls.sh | ||
$(run_unit_tests_image) hack/update-installer.sh | ||
|
||
.PHONY: list | ||
list: | ||
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' |
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 |
---|---|---|
|
@@ -19,8 +19,12 @@ ENV GO111MODULE=on \ | |
WORKDIR=/go/src/github.com/IBM/ibm-block-csi-operator | ||
ENV CR_YAML=$WORKDIR/config/samples/csi.ibm.com_v1_ibmblockcsi_cr.yaml | ||
WORKDIR $WORKDIR | ||
COPY Makefile . | ||
|
||
RUN go get github.com/onsi/ginkgo/ginkgo | ||
RUN go get github.com/onsi/ginkgo/[email protected] \ | ||
&& make kustomize \ | ||
&& make controller-gen | ||
|
||
COPY . . | ||
CMD ["make", "test"] | ||
|
||
CMD ["make", "test"] |
Large diffs are not rendered by default.
Oops, something went wrong.
1,375 changes: 511 additions & 864 deletions
1,375
deploy/installer/generated/ibm-block-csi-operator.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
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,9 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
resources: | ||
- config/crd/bases/csi.ibm.com_ibmblockcsis.yaml | ||
- config/rbac/service_account.yaml | ||
- config/rbac/role.yaml | ||
- config/rbac/role_binding.yaml | ||
- config/manager/manager.yaml |
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
File renamed without changes.
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