Refactor init container commands to use sh instead of bash

This commit is contained in:
bcmmbaga
2026-02-04 18:04:50 +03:00
parent 5f38ce6c8f
commit cad98f7a59
2 changed files with 7 additions and 10 deletions
@@ -29,10 +29,10 @@ spec:
- name: wait-network-ready
image: "netbirdio/kubectl:latest"
command:
- bash
- sh
- -c
args:
- kubectl wait --for 'jsonpath={.status.networkID}' -n {{ $routerNS }} nbroutingpeer router;
- kubectl wait --for 'jsonpath={.status.networkID}' -n {{ $routerNS }} nbroutingpeer router;
containers:
- name: apply-nbresource
image: "netbirdio/kubectl:latest"
@@ -62,7 +62,7 @@ spec:
tcpPorts:
- 443
command:
- bash
- sh
- -c
args:
- kubectl delete NBResource --ignore-not-found -n default kubernetes; export NETWORK_ID=$(kubectl get NBRoutingPeer -n {{ $routerNS }} router -o 'jsonpath={.status.networkID}'); echo "$NBRESOURCE_VALUE" | envsubst | kubectl apply -f -
@@ -1,4 +1,4 @@
{{- if and .Values.enabled .Values.kubernetesAPI.enabled }}
{{- if .Values.kubernetesAPI.enabled }}
{{- $routerNS := .Release.Namespace }}
{{- if .Values.namespacedNetworks }}
{{- $routerNS = "default" }}
@@ -21,18 +21,15 @@ spec:
labels:
app.kubernetes.io/component: operator
{{- include "netbird-operator-config.labels" . | nindent 8 }}
{{- with .Values.operator.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
initContainers:
- name: wait-network-ready
image: "netbirdio/kubectl:latest"
command:
- bash
- sh
- -c
args:
- kubectl wait --for 'jsonpath={.status.networkID}' -n {{ $routerNS }} nbroutingpeer router;
- kubectl wait --for 'jsonpath={.status.networkID}' -n {{ $routerNS }} nbroutingpeer router;
containers:
- name: apply-nbresource
image: "netbirdio/kubectl:latest"
@@ -62,7 +59,7 @@ spec:
tcpPorts:
- 443
command:
- bash
- sh
- -c
args:
- kubectl delete NBResource --ignore-not-found -n default kubernetes; export NETWORK_ID=$(kubectl get NBRoutingPeer -n {{ $routerNS }} router -o 'jsonpath={.status.networkID}'); echo "$NBRESOURCE_VALUE" | envsubst | kubectl apply -f -