Skip to content

Commit

Permalink
Update tests/upgrade_v2_script/static/prometheus_operator_valid.input…
Browse files Browse the repository at this point in the history
….yaml

Co-authored-by: Dominik Rosiek <58699848+sumo-drosiek@users.noreply.github.com>
  • Loading branch information
2 people authored and pmalek committed Nov 19, 2020
1 parent a70f321 commit 1fad5ff
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
15 changes: 13 additions & 2 deletions deploy/helm/sumologic/upgrade-2.0.0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ prometheus-operator.prometheusOperator.tlsProxy.enabled:kube-prometheus-stack.pr
"

readonly KEY_VALUE_MAPPINGS="
prometheus-operator.prometheus.prometheusSpec.containers.[0].name:prometheus-config-reloader:config-reloader
"

readonly KEYS_TO_DELETE="
Expand Down Expand Up @@ -117,7 +116,19 @@ function create_temp_file() {
}

function migrate_prometheus_operator_to_kube_prometheus_stack() {
info "Migrating from promtheus-operator to kube-prometheus-stack"
info "Migrating prometheus-config-reloader container to config-reloader in prometheusSpec"
yq m -i --arrays append \
"${TEMP_FILE}" \
<(
yq p <(
yq w <(
yq r "${TEMP_FILE}" -- 'prometheus-operator.prometheus.prometheusSpec.containers.(name==prometheus-config-reloader)' \
) name config-reloader \
) 'prometheus-operator.prometheus.prometheusSpec.containers[+]'
)
yq d -i "${TEMP_FILE}" "prometheus-operator.prometheus.prometheusSpec.containers.(name==prometheus-config-reloader)"

info "Migrating from prometheus-operator to kube-prometheus-stack"
yq m -i \
"${TEMP_FILE}" \
<(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ prometheus-operator:
cpu: 1m
memory: 8Mi
containers:
- name: thanos-sidecar
- name: "prometheus-config-reloader"
env:
- name: CHART
Expand All @@ -50,4 +51,4 @@ sumologic:
endpoint: http://dummy.com/
telegraf-operator:
enabled: true
replicaCount: 1
replicaCount: 1
4 changes: 2 additions & 2 deletions tests/upgrade_v2_script/static/prometheus_operator_valid.log
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[INFO] Mapping prometheus-operator.prometheusOperator.tlsProxy.enabled into kube-prometheus-stack.prometheusOperator.tls.enabled
[INFO] Mapping prometheus-operator.prometheus.prometheusSpec.containers.[0].name's value from prometheus-config-reloader into config-reloader

[INFO] Migrating from promtheus-operator to kube-prometheus-stack
[INFO] Migrating prometheus-config-reloader to config-reloader
[INFO] Migrating from prometheus-operator to kube-prometheus-stack
[INFO] falco will be disabled. Change "falco.enabled" to "true" if you want to enable it

Thank you for upgrading to v2.0.0 of the Sumo Logic Kubernetes Collection Helm chart.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ kube-prometheus-stack:
cpu: 1m
memory: 8Mi
containers:
- name: thanos-sidecar
- name: config-reloader
env:
- name: CHART
Expand Down

0 comments on commit 1fad5ff

Please sign in to comment.