Skip to content
Snippets Groups Projects
Unverified Commit 3e8d1ae1 authored by Stefan Prodan's avatar Stefan Prodan Committed by GitHub
Browse files

Merge pull request #1732 from timja/kustomize-substitute-fixes

Avoid substitution issue in kustomize credentials sync
parents 31da3634 08f5ca39
No related branches found
No related tags found
No related merge requests found
...@@ -50,16 +50,16 @@ spec: ...@@ -50,16 +50,16 @@ spec:
$(RECONCILE_SH) $(RECONCILE_SH)
apply-secret() { apply-secret() {
/kbin/kubectl create secret generic "${1}" \ /kbin/kubectl create secret generic "$1" \
--from-literal=token="${2}" \ --from-literal=token="$2" \
--from-literal=address="${3}" \ --from-literal=address="$3" \
--dry-run=client -o=yaml \ --dry-run=client -o=yaml \
| grep -v "creationTimestamp:" \ | grep -v "creationTimestamp:" \
| /kbin/kubectl apply -f - | /kbin/kubectl apply -f -
} }
pause_loop() { pause_loop() {
sleep "${SYNC_PERIOD:-3600}" || true sleep "$SYNC_PERIOD" || true
} }
graceful_exit() { graceful_exit() {
...@@ -71,8 +71,8 @@ spec: ...@@ -71,8 +71,8 @@ spec:
| tr [ % | tr [ %
)" )"
# shellcheck disable=SC2086 # shellcheck disable=SC2086
if [ "${job_ids}" ]; then if [ "$job_ids" ]; then
kill ${job_ids} kill $job_ids
fi fi
wait wait
echo "Graceful exit -- $(date)" echo "Graceful exit -- $(date)"
...@@ -80,7 +80,7 @@ spec: ...@@ -80,7 +80,7 @@ spec:
trap graceful_exit INT TERM trap graceful_exit INT TERM
echo "Loop started (period: ${SYNC_PERIOD} s) -- $(date)" echo "Loop started (period: $SYNC_PERIOD s) -- $(date)"
while true; do while true; do
reconcile & wait $! reconcile & wait $!
pause_loop & wait $! pause_loop & wait $!
......
...@@ -52,9 +52,9 @@ spec: ...@@ -52,9 +52,9 @@ spec:
$(RECONCILE_SH) $(RECONCILE_SH)
apply-secret() { apply-secret() {
/kbin/kubectl create secret generic "${1}" \ /kbin/kubectl create secret generic "$1" \
--from-literal=token="${2}" \ --from-literal=token="$2" \
--from-literal=address="${3}" \ --from-literal=address="$3" \
--dry-run=client -o=yaml \ --dry-run=client -o=yaml \
| grep -v "creationTimestamp:" \ | grep -v "creationTimestamp:" \
| /kbin/kubectl apply -f - | /kbin/kubectl apply -f -
......
...@@ -46,17 +46,17 @@ spec: ...@@ -46,17 +46,17 @@ spec:
$(RECONCILE_SH) $(RECONCILE_SH)
apply-secret() { apply-secret() {
/kbin/kubectl create secret docker-registry "${1}" \ /kbin/kubectl create secret docker-registry "$1" \
--docker-password="${2}" \ --docker-password="$2" \
--docker-username="${3}" \ --docker-username="$3" \
--docker-server="${4}" \ --docker-server="$4" \
--dry-run=client -o=yaml \ --dry-run=client -o=yaml \
| grep -v "creationTimestamp:" \ | grep -v "creationTimestamp:" \
| /kbin/kubectl apply -f - | /kbin/kubectl apply -f -
} }
pause_loop() { pause_loop() {
sleep "${SYNC_PERIOD:-3600}" || true sleep "$SYNC_PERIOD" || true
} }
graceful_exit() { graceful_exit() {
...@@ -68,8 +68,8 @@ spec: ...@@ -68,8 +68,8 @@ spec:
| tr [ % | tr [ %
)" )"
# shellcheck disable=SC2086 # shellcheck disable=SC2086
if [ "${job_ids}" ]; then if [ "$job_ids" ]; then
kill ${job_ids} kill $job_ids
fi fi
wait wait
echo "Graceful exit -- $(date)" echo "Graceful exit -- $(date)"
...@@ -77,7 +77,7 @@ spec: ...@@ -77,7 +77,7 @@ spec:
trap graceful_exit INT TERM trap graceful_exit INT TERM
echo "Loop started (period: ${SYNC_PERIOD} s) -- $(date)" echo "Loop started (period: $SYNC_PERIOD s) -- $(date)"
while true; do while true; do
reconcile & wait $! reconcile & wait $!
pause_loop & wait $! pause_loop & wait $!
......
...@@ -48,10 +48,10 @@ spec: ...@@ -48,10 +48,10 @@ spec:
$(RECONCILE_SH) $(RECONCILE_SH)
apply-secret() { apply-secret() {
/kbin/kubectl create secret docker-registry "${1}" \ /kbin/kubectl create secret docker-registry "$1" \
--docker-password="${2}" \ --docker-password="$2" \
--docker-username="${3}" \ --docker-username="$3" \
--docker-server="${4}" \ --docker-server="$4" \
--dry-run=client -o=yaml \ --dry-run=client -o=yaml \
| grep -v "creationTimestamp:" \ | grep -v "creationTimestamp:" \
| /kbin/kubectl apply -f - | /kbin/kubectl apply -f -
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment