Quote everything inside stdout/contents except regexp (#20306)

Signed-off-by: Carlos Rodríguez Hernández <carlosrh@vmware.com>
This commit is contained in:
Carlos Rodríguez Hernández
2023-10-18 16:32:40 +02:00
committed by GitHub
parent 304ac5ebe0
commit aab0f51196
22 changed files with 38 additions and 38 deletions

View File

@@ -7,9 +7,9 @@ file:
filetype: file
exists: true
contents:
- zookeeper
- remote_servers
- logger
- "zookeeper"
- "remote_servers"
- "logger"
/bitnami/clickhouse/data:
mode: "2750"
filetype: directory

View File

@@ -23,5 +23,5 @@ command:
exit-status: 0
stdout:
{{ range $e, $i := until .Vars.replicaCount }}
- consul-{{ $i }}
- "consul-{{ $i }}"
{{ end }}

View File

@@ -15,8 +15,8 @@ file:
owner: root
group: root
contents:
- hostname = {{ .Vars.host }}
- db_username = {{ .Vars.postgresql.auth.username }}
- "hostname = {{ .Vars.host }}"
- "db_username = {{ .Vars.postgresql.auth.username }}"
command:
discourse-cli:
exec: cd /opt/bitnami/discourse/ && RAILS_ENV=production bundle exec rake -T

View File

@@ -17,7 +17,7 @@ command:
exit-status: 0
stdout:
{{- range $e, $i := until .Vars.replicaCount }}
- etcd-{{ $i }}
- "etcd-{{ $i }}"
{{- end }}
{{- range $e, $i := until .Vars.replicaCount }}
{{- $key := printf "key_%s" (randAlpha 5) }}
@@ -26,7 +26,7 @@ command:
exec: etcdctl {{ $auth }} {{ $svc_endpoint }} put {{ $key }} {{ $value }} && etcdctl {{ $auth }} --endpoints=etcd-{{ $i }}.etcd-headless:{{ $.Vars.containerPorts.client }} get {{ $key }}
exit-status: 0
stdout:
- {{ $key }}
- "{{ $key }}"
{{- end }}
{{- $uid := .Vars.containerSecurityContext.runAsUser }}
{{- $gid := .Vars.podSecurityContext.fsGroup }}

View File

@@ -18,7 +18,7 @@ command:
exec: export INFLUX_TOKEN='{{ $adminToken }}' && influx write --host http://influxdb:{{ $port }} --org {{ $org }} --bucket {{ $bucket }} 'cpu_error,host=bitnami-server value="{{ $msg }}"' && export INFLUX_TOKEN=$(influx auth list | grep {{ $user }} | awk '{print $2}') && influx query --host http://influxdb:{{ $port }} --org {{ $org }} 'from(bucket:"{{ $bucket }}") |> range(start:-2m)'
exit-status: 0
stdout:
- {{ $msg }}
- "{{ $msg }}"
{{- $uid := .Vars.influxdb.containerSecurityContext.runAsUser }}
{{- $gid := .Vars.influxdb.podSecurityContext.fsGroup }}
check-user-info:

View File

@@ -27,7 +27,7 @@ file:
mode: "0777"
owner: root
contents:
- postgresql://{{ .Vars.postgresql.auth.username }}@jupyterhub-postgresql:{{ .Vars.postgresql.service.ports.postgresql }}/{{ .Vars.postgresql.auth.database }}
- "postgresql://{{ .Vars.postgresql.auth.username }}@jupyterhub-postgresql:{{ .Vars.postgresql.service.ports.postgresql }}/{{ .Vars.postgresql.auth.database }}"
- /type.*dynamic/
command:
{{- $uid := .Vars.hub.containerSecurityContext.runAsUser }}

View File

@@ -17,7 +17,7 @@ file:
filetype: file
mode: "0644"
contents:
- listeners=CLIENT://:{{ .Vars.listeners.client.containerPort }},INTERNAL://:{{ .Vars.listeners.interbroker.containerPort }},EXTERNAL://:{{ .Vars.listeners.external.containerPort }},CONTROLLER://:{{ .Vars.listeners.controller.containerPort }}
- "listeners=CLIENT://:{{ .Vars.listeners.client.containerPort }},INTERNAL://:{{ .Vars.listeners.interbroker.containerPort }},EXTERNAL://:{{ .Vars.listeners.external.containerPort }},CONTROLLER://:{{ .Vars.listeners.controller.containerPort }}"
command:
create-kafka-topic:
exec: kafka-topics.sh --create --topic quickstart-events{{randAlpha 5}} --bootstrap-server kafka:{{ .Vars.service.ports.client }}

View File

@@ -25,7 +25,7 @@ command:
exec: echo '{{ $rnd_ip }} - - [18/May/2011:19:35:08 -0700] "GET /css/main.css HTTP/1.1" 200 55 "{{ $rnd_address }}" "Mozilla/5.0"' >> /tmp/test_input && sleep 20 && cat /tmp/test_log
exit-status: 0
stdout:
- {{ $rnd_ip }}
- "{{ $rnd_ip }}"
- /status_code.*200/
- /referrer.*{{ $rnd_address }}/
timeout: 30000

View File

@@ -25,7 +25,7 @@ command:
exec: mariadb -h mariadb-galera {{ $conn_opts }} -e 'DROP TABLE IF EXISTS TEST; create table TEST(test_id int auto_increment, test_value int, primary key(test_id)); INSERT INTO TEST (TEST_VALUE) VALUES ({{ $testValue }});SELECT * FROM TEST'
exit-status: 0
stdout:
- {{ $testValue }}
- "{{ $testValue }}"
{{- $numNodes := .Vars.replicaCount }}
{{- $testValue := "2022" }}
{{- range $e, $i := until $numNodes }}
@@ -34,7 +34,7 @@ command:
exec: mariadb -h mariadb-galera-{{ $i }}.mariadb-galera-headless {{ $conn_opts }} -e 'DROP TABLE IF EXISTS TEST_REP_{{ $i }}; create table TEST_REP_{{ $i }}(test_id int auto_increment, test_value varchar(4), primary key(test_id)); INSERT INTO TEST_REP_{{ $i }} (TEST_VALUE) VALUES ({{ $testValue }})' && sleep 2 {{ range $e, $j := until $numNodes }} && mariadb -h mariadb-galera-{{ $j }}.mariadb-galera-headless {{ $conn_opts }} -e 'SELECT * FROM TEST_REP_{{ $i }}'{{ end }}
exit-status: 0
stdout:
- {{ $testValue }}
- "{{ $testValue }}"
timeout: 9000
{{- end }}
{{- $uid := .Vars.containerSecurityContext.runAsUser }}

View File

@@ -14,8 +14,8 @@ command:
exec: bash -c 'printf "set {{ $key }} 0 300 11\r\n{{ $value }}\r\nquit\n" | {{ $server_connection }} && printf "get {{ $key }}\r\nquit\n" | {{ $server_connection }}'
exit-status: 0
stdout:
- STORED
- {{ $value }}
- "STORED"
- "{{ $value }}"
{{- $uid := .Vars.containerSecurityContext.runAsUser }}
{{- $gid := .Vars.podSecurityContext.fsGroup }}
check-user-info:

View File

@@ -41,5 +41,5 @@ file:
mode: "0600"
filetype: file
contents:
- {{ .Vars.auth.replicaSetKey }}
- "{{ .Vars.auth.replicaSetKey }}"
exists: true

View File

@@ -24,7 +24,7 @@ command:
exec: mongosh {{ $conn_opts }} --eval "db.{{ $testCollection }}.drop(); db.createCollection('{{ $testCollection }}'); db.getCollectionNames()" {{ (index .Vars.auth.databases 0) }}
exit-status: 0
stdout:
- {{ $testCollection }}
- "{{ $testCollection }}"
{{- $uid := .Vars.containerSecurityContext.runAsUser }}
{{- $gid := .Vars.podSecurityContext.fsGroup }}
check-user-info:

View File

@@ -17,7 +17,7 @@ command:
exec: capsh --print
exit-status: 0
stdout:
- Bounding set =cap_{{ index .Vars.containerSecurityContext.capabilities.add 0 | toLower }}
- "Bounding set =cap_{{ index .Vars.containerSecurityContext.capabilities.add 0 | toLower }}"
{{ if .Vars.serviceAccount.automountServiceAccountToken }}
check-sa:
exec: cat /var/run/secrets/kubernetes.io/serviceaccount/token | cut -d '.' -f 2 | xargs -I '{}' echo '{}====' | fold -w 4 | sed '$ d' | tr -d '\n' | base64 -d

View File

@@ -15,5 +15,5 @@ file:
owner: root
group: root
contents:
- db_user = {{ .Vars.postgresql.auth.username }}
- http_port = {{ .Vars.containerPorts.http }}
- "db_user = {{ .Vars.postgresql.auth.username }}"
- "http_port = {{ .Vars.containerPorts.http }}"

View File

@@ -18,11 +18,11 @@ command:
exec: PGPASSWORD={{ $repmgr_password }} psql -U {{ $repmgr_user }} -d {{ $repmgr_database }} {{ $repmgr_endpoint }} -c "SELECT conninfo FROM repmgr.nodes WHERE type = 'primary'"
exit-status: 0
stdout:
- user={{ $repmgr_user }}
- password={{ $repmgr_password }}
- dbname={{ $repmgr_database }}
- port={{ $repmgr_port }}
- connect_timeout={{ .Vars.postgresql.repmgrConnectTimeout }}
- "user={{ $repmgr_user }}"
- "password={{ $repmgr_password }}"
- "dbname={{ $repmgr_database }}"
- "port={{ $repmgr_port }}"
- "connect_timeout={{ .Vars.postgresql.repmgrConnectTimeout }}"
test-replication:
# We need to first obtain the primary's host to perform write operations
{{- $database := printf "db_%s" (randAlpha 5 | lower) }}

View File

@@ -70,7 +70,7 @@ command:
exec: promtool check config /opt/bitnami/prometheus/conf/{{ .Vars.server.existingConfigmapKey }}
exit-status: 0
stdout:
- SUCCESS
- "SUCCESS"
check-metrics:
exec: promtool query instant http://localhost:{{ .Vars.server.containerPorts.http }} prometheus_http_requests_total
exit-status: 0

View File

@@ -37,7 +37,7 @@ command:
exit-status: 0
stdout:
{{ range $plugin := (split " " .Vars.extraPlugins) }}
- {{ $plugin }}
- "{{ $plugin }}"
{{ end }}
{{- $uid := .Vars.containerSecurityContext.runAsUser }}
{{- $gid := .Vars.podSecurityContext.fsGroup }}

View File

@@ -16,21 +16,21 @@ command:
exec: {{ $auth }} redis-cli {{ $master_endpoint }} {{ $command }}
exit-status: 0
stdout:
- ERR unknown command
- "ERR unknown command"
{{ end }}
redis-master-role:
exec: {{ $auth }} redis-cli {{ $master_endpoint }} ROLE
exit-status: 0
stdout:
- master
- "master"
{{ range $e, $i := until $replicas }}
- redis-replicas-{{ $i }}
- "redis-replicas-{{ $i }}"
{{ end }}
redis-replicas-role:
exec: {{ $auth }} redis-cli {{ $replicas_endpoint }} ROLE
exit-status: 0
stdout:
- slave
- "slave"
{{- $uid := .Vars.master.containerSecurityContext.runAsUser }}
{{- $gid := .Vars.master.podSecurityContext.fsGroup }}
check-user-info:

View File

@@ -12,7 +12,7 @@ command:
solr healthcheck -z solr-zookeeper:2181/solr -c {{ $collection }}
exit-status: 0
stdout:
- healthy
- "healthy"
{{ range $e, $i := until $replicas }}
- /solr-{{ $i }}/
{{ end }}
@@ -35,4 +35,4 @@ file:
filetype: file
exists: true
contents:
- SOLR_CLOUD_BOOTSTRAP={{ if .Vars.cloudBootstrap }}yes{{ else }}no{{ end }}
- "SOLR_CLOUD_BOOTSTRAP={{ if .Vars.cloudBootstrap }}yes{{ else }}no{{ end }}"

View File

@@ -11,7 +11,7 @@ file:
mode: "0777"
owner: root
contents:
- {{ .Vars.server.configuration.accountName }}
- "{{ .Vars.server.configuration.accountName }}"
- /url.*jdbc:mariadb.*{{ .Vars.mariadb.auth.database }}/
- /username.*{{ .Vars.mariadb.auth.username }}/
/etc/secrets/database:

View File

@@ -22,7 +22,7 @@ command:
exec: wp option list --search="admin_email"
exit-status: 0
stdout:
- {{ .Vars.wordpressEmail }}
- "{{ .Vars.wordpressEmail }}"
{{- $uid := .Vars.containerSecurityContext.runAsUser }}
{{- $gid := .Vars.podSecurityContext.fsGroup }}
check-user-info:

View File

@@ -10,8 +10,8 @@ file:
filetype: file
mode: "0644"
contents:
- {{ .Vars.containerPorts.client }}
- preAllocSize={{ .Vars.preAllocSize }}
- "{{ .Vars.containerPorts.client }}"
- "preAllocSize={{ .Vars.preAllocSize }}"
command:
zookeeper-create-znode:
exec: zkCli.sh -server zookeeper-0:{{ .Vars.containerPorts.client }} create /my_key_{{randAlpha 5}} my_data