Skip to content

Commit d758186

Browse files
authored
feat(devenv): set k8sop description to codespace name (#708)
Signed-off-by: Jonathan Stacks <[email protected]>
1 parent f681a05 commit d758186

File tree

8 files changed

+27
-11
lines changed

8 files changed

+27
-11
lines changed

helm/ngrok-operator/templates/agent/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ spec:
7777
- agent-manager
7878
{{- include "ngrok-operator.manager.cliFeatureFlags" . | nindent 8 }}
7979
{{- if .Values.description }}
80-
- --description={{ .Values.description | quote }}
80+
- {{ printf "--description=%s" .Values.description | quote }}
8181
{{- end }}
8282
{{- if .Values.region }}
8383
- --region={{ .Values.region }}

helm/ngrok-operator/templates/bindings-forwarder/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ spec:
7777
- bindings-forwarder-manager
7878
- --release-name={{ .Release.Name }}
7979
{{- if .Values.description }}
80-
- --description={{ .Values.description | quote }}
80+
- {{ printf "--description=%s" .Values.description | quote }}
8181
{{- end }}
8282
- --zap-log-level={{ .Values.log.level }}
8383
- --zap-stacktrace-level={{ .Values.log.stacktraceLevel }}

helm/ngrok-operator/templates/controller-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ spec:
9999
- --bindings-ingress-endpoint={{ .Values.bindings.ingressEndpoint }}
100100
{{- end }}
101101
{{- if .Values.description }}
102-
- --description={{ .Values.description | quote }}
102+
- {{ printf "--description=%s" .Values.description | quote }}
103103
{{- end }}
104104
{{- if .Values.region }}
105105
- --region={{ .Values.region}}

helm/ngrok-operator/tests/__snapshot__/controller-deployment_test.yaml.snap

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

helm/ngrok-operator/tests/agent/__snapshot__/deployment_test.yaml.snap

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

helm/ngrok-operator/tests/bindings-forwarder/__snapshot__/deployment_test.yaml.snap

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

helm/ngrok-operator/tests/controller-deployment_test.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,16 @@ tests:
163163
asserts:
164164
- contains:
165165
path: spec.template.spec.containers[0].args
166-
content: --description="test description"
166+
content: --description=test description
167+
- it: Should pass description when description has special characters
168+
set:
169+
description: 'lets-go: with spaces'
170+
template: controller-deployment.yaml
171+
documentIndex: 0 # Document 0 is the deployment since its the first template
172+
asserts:
173+
- contains:
174+
path: spec.template.spec.containers[0].args
175+
content: '--description=lets-go: with spaces'
167176
- it: Should support deprecated metaData to the deployment
168177
set:
169178
metaData:

tools/make/deploy.mk

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
##@ Deploying
22

3+
ifneq ($(CODESPACE_NAME),)
4+
HELM_DESCRIPTION_FLAG = --set-string description="codespace: $(CODESPACE_NAME)"
5+
endif
6+
37
.PHONY: run
48
run: manifests generate fmt vet ## Run a controller from your host.
59
go run ./cmd/api/main.go
@@ -19,7 +23,8 @@ deploy: _deploy-check-env-vars docker-build manifests _helm_setup kind-load-imag
1923
--set log.format=console \
2024
--set-string log.level="8" \
2125
--set log.stacktraceLevel=panic \
22-
--set metaData.env=local,metaData.from=makefile
26+
--set metaData.env=local,metaData.from=makefile \
27+
$(HELM_DESCRIPTION_FLAG)
2328

2429
.PHONY: deploy_gateway
2530
deploy_gateway: _deploy-check-env-vars docker-build manifests _helm_setup kind-load-image ## Deploy controller to the K8s cluster specified in ~/.kube/config.
@@ -36,7 +41,8 @@ deploy_gateway: _deploy-check-env-vars docker-build manifests _helm_setup kind-l
3641
--set-string log.level="8" \
3742
--set log.stacktraceLevel=panic \
3843
--set metaData.env=local,metaData.from=makefile \
39-
--set useExperimentalGatewayApi=true
44+
--set useExperimentalGatewayApi=true \
45+
$(HELM_DESCRIPTION_FLAG)
4046

4147
.PHONY: deploy_with_bindings
4248
deploy_with_bindings: _deploy-check-env-vars docker-build manifests _helm_setup kind-load-image ## Deploy controller to the K8s cluster specified in ~/.kube/config.
@@ -53,7 +59,8 @@ deploy_with_bindings: _deploy-check-env-vars docker-build manifests _helm_setup
5359
--set log.level=debug \
5460
--set log.stacktraceLevel=panic \
5561
--set metaData.env=local,metaData.from=makefile \
56-
--set bindings.enabled=true
62+
--set bindings.enabled=true \
63+
$(HELM_DESCRIPTION_FLAG)
5764

5865
.PHONY: deploy_for_e2e
5966
deploy_for_e2e: _deploy-check-env-vars docker-build manifests _helm_setup kind-load-image ## Deploy controller to the K8s cluster specified in ~/.kube.config.

0 commit comments

Comments
 (0)