You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@${BINARY_YQ}'select(document_index != (select(.kind == "CustomResourceDefinition") | document_index))'$(K8S_RESOURCE_TEMP_YAML)>${K8S_HELM_TARGET}/templates/$(ARTIFACT_ID)_$(VERSION).yaml # select all documents without the CRD
helm-reinstall: helm-delete helm-apply ## Uninstalls the current helm chart and reinstalls it.
71
92
72
93
.PHONY: helm-chart-import
73
-
helm-chart-import: check-all-vars check-k8s-artifact-id helm-generate-chart helm-package-release## Imports the currently available chart into the cluster-local registry.
94
+
helm-chart-import: ${CHECK_VAR_TARGETS} helm-generate helm-package ${IMAGE_IMPORT_TARGET}## Imports the currently available chart into the cluster-local registry.
74
95
@if [[ ${STAGE}=="development" ]];then\
75
-
echo"Import ${K8S_HELM_DEV_RELEASE_TGZ} into K8s cluster ${K3CES_REGISTRY_URL_PREFIX}...";\
helm-package-release: ${BINARY_HELM} helm-delete-existing-tgz ${K8S_HELM_RELEASE_TGZ} ## Generates and packages the helm chart with release urls.
110
+
.PHONY: helm-package
111
+
helm-package: helm-delete-existing-tgz ${HELM_RELEASE_TGZ} ## Generates and packages the helm chart with release URLs.
112
+
113
+
${HELM_RELEASE_TGZ}: ${BINARY_HELM} ${HELM_TARGET_DIR}/Chart.yaml ${HELM_POST_GENERATE_TARGETS} ## Generates and packages the helm chart with release URLs.
114
+
@echo "Package generated helm chart"
115
+
@if [[ ${STAGE}=="development" ]];then\
116
+
echo"WARNING: You are using a development environment" ; \
helm-delete-existing-tgz: ## Remove an existing Helm package.
96
-
# remove
97
-
@rm -f ${K8S_HELM_RELEASE_TGZ}*
121
+
helm-delete-existing-tgz: ## Remove an existing Helm package from the target directory.
122
+
@echo "Delete ${HELM_RELEASE_TGZ}*"
123
+
@rm -f ${HELM_TARGET_DIR}/${ARTIFACT_ID}-*.tgz
98
124
99
-
${K8S_HELM_RELEASE_TGZ}: ${BINARY_HELM} ${K8S_HELM_TARGET}/templates/$(ARTIFACT_ID)_$(VERSION).yaml helm-generate-chart $(K8S_POST_GENERATE_TARGETS)## Generates and packages the helm chart with release urls.
sed "s|NAMESPACE|$(HELM_ARTIFACT_NAMESPACE)|g""${K8S_RESOURCE_COMPONENT_CR_TEMPLATE_YAML}"| sed "s|NAME|$(ARTIFACT_ID)|g"| sed "s|VERSION|$(COMPONENT_DEV_VERSION)|g">"${K8S_RESOURCE_COMPONENT}";\
sed "s|NAMESPACE|$(HELM_ARTIFACT_NAMESPACE)|g""${K8S_RESOURCE_COMPONENT_CR_TEMPLATE_YAML}"| sed "s|NAME|$(ARTIFACT_ID)|g"| sed "s|VERSION|$(VERSION)|g">"${K8S_RESOURCE_COMPONENT}";\
122
142
fi
123
143
124
144
.PHONY: component-apply
125
-
component-apply: check-k8s-namespace-env-var $(PRE_APPLY_TARGETS)helm-generate helm-chart-import component-generate$(K8S_POST_GENERATE_TARGETS)## Applies the component yaml resource to the actual defined context.
component-apply: check-k8s-namespace-env-var ${COMPONENT_PRE_APPLY_TARGETS} ${IMAGE_IMPORT_TARGET} helm-generate helm-chart-import component-generate ## Applies the component yaml resource to the actual defined context.
component-delete: check-k8s-namespace-env-var component-generate $(K8S_POST_GENERATE_TARGETS)## Deletes the component yaml resource from the actual defined context.
@@ -50,7 +35,7 @@ build-controller: ${SRC} compile ## Builds the controller Go binary.
50
35
# Allows to perform tasks before locally running the controller
51
36
K8S_RUN_PRE_TARGETS ?=
52
37
.PHONY: run
53
-
run: manifests generate $(K8S_RUN_PRE_TARGETS)## Run a controller from your host.
38
+
run: generate-deepcopy$(K8S_RUN_PRE_TARGETS)## Run a controller from your host.
54
39
go run -ldflags "-X main.Version=$(VERSION)" ./main.go
55
40
56
41
##@ K8s - Integration test with envtest
@@ -59,33 +44,13 @@ $(K8S_INTEGRATION_TEST_DIR):
59
44
@mkdir -p $@
60
45
61
46
.PHONY: k8s-integration-test
62
-
k8s-integration-test: $(K8S_INTEGRATION_TEST_DIR)manifests generate envtest## Run k8s integration tests.
47
+
k8s-integration-test: $(K8S_INTEGRATION_TEST_DIR)${ENVTEST}## Run k8s integration tests.
63
48
@echo "Running K8s integration tests..."
64
49
@KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test -tags=k8s_integration ./... -coverprofile ${K8S_INTEGRATION_TEST_DIR}/report-k8s-integration.out
65
50
66
-
##@ K8s - Controller Resource
67
-
68
-
# The pre generation script creates a K8s resource yaml containing generated manager yaml.
0 commit comments