Skip to content

Commit

Permalink
feat: v2 mesh-init command (#2941)
Browse files Browse the repository at this point in the history
* feat: v2 mesh-init command

* bugfix mesh-init test

* add mesh-init args to webhook

* fix: remove v2 flags from partition-init

* update telemetry-collector with v2 flags

* Apply suggestions from code review

Co-authored-by: Michael Zalimeni <michael.zalimeni@hashicorp.com>

* PR feedback Part II

* bugfix test

* fix: endpoints v2 selector stability

---------

Co-authored-by: Michael Zalimeni <michael.zalimeni@hashicorp.com>
  • Loading branch information
DanStough and zalimeni authored Sep 14, 2023
1 parent ed61c56 commit 38dc912
Show file tree
Hide file tree
Showing 21 changed files with 2,868 additions and 112 deletions.
3 changes: 0 additions & 3 deletions charts/consul/templates/partition-init-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@ spec:
{{- if .Values.global.cloud.enabled }}
-tls-server-name=server.{{ .Values.global.datacenter}}.{{ .Values.global.domain}} \
{{- end }}
{{- if (mustHas "resource-apis" .Values.global.experiments) }}
-enable-resource-apis=true
{{- end }}
resources:
requests:
memory: "50Mi"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.telemetryCollector.enabled }}
{{- if and .Values.telemetryCollector.enabled (not (mustHas "resource-apis" .Values.global.experiments)) }}
{{- if not .Values.telemetryCollector.image}}{{ fail "telemetryCollector.image must be set to enable consul-telemetry-collector" }}{{ end }}
{{- if not .Values.connectInject.enabled }}{{ fail "connectInject.enabled must be true" }}{{ end -}}
{{- if and .Values.global.adminPartitions.enabled (not .Values.global.enableConsulNamespaces) }}{{ fail "global.enableConsulNamespaces must be true if global.adminPartitions.enabled=true" }}{{ end }}
Expand Down
378 changes: 378 additions & 0 deletions charts/consul/templates/telemetry-collector-v2-deployment.yaml

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions charts/consul/test/unit/telemetry-collector-deployment.bats
Original file line number Diff line number Diff line change
Expand Up @@ -1198,4 +1198,18 @@ MIICFjCCAZsCCQCdwLtdjbzlYzAKBggqhkjOPQQDAjB0MQswCQYDVQQGEwJDQTEL' \
local actual=$(echo "$cmd" |
yq 'any(contains("-log-level=debug"))' | tee /dev/stderr)
[ "${actual}" = "true" ]
}

#--------------------------------------------------------------------
# global.experiments=["resource-apis"]

@test "telemetryCollector/Deployment: disabled when V2 is enabled" {
cd `chart_dir`
assert_empty helm template \
-s templates/telemetry-collector-deployment.yaml \
--set 'telemetryCollector.enabled=true' \
--set 'telemetryCollector.image=bar' \
--set 'ui.enabled=false' \
--set 'global.experiments[0]=resource-apis' \
.
}
Loading

0 comments on commit 38dc912

Please sign in to comment.