From cd5030e62b9c84b1c3d91ea52e99f8db3e4c6a9d Mon Sep 17 00:00:00 2001 From: Devin Buhl Date: Mon, 2 May 2022 18:15:07 -0400 Subject: [PATCH] fix(cluster): configure script would fail on macos Signed-off-by: Devin Buhl --- cluster/apps/kustomization.yaml | 8 ++++---- configure.sh | 12 +++++------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/cluster/apps/kustomization.yaml b/cluster/apps/kustomization.yaml index 2096237f..945541cf 100644 --- a/cluster/apps/kustomization.yaml +++ b/cluster/apps/kustomization.yaml @@ -2,12 +2,12 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - default - - kube-system - - networking # Be sure to NOT downgrade k3s by keep the value in # ./provision/ansible/inventory/group_vars/kubernetes/k3s.yml # updated if you need to re-run the Ansible playbook. - # To enable automatic Kubernetes upgrades uncomment + # To enable automatic Kubernetes upgrades uncomment # the below line # - system-upgrade + - default + - kube-system + - networking diff --git a/configure.sh b/configure.sh index ec2b1ff2..dd009e5d 100755 --- a/configure.sh +++ b/configure.sh @@ -219,17 +219,15 @@ setup_github_webhook() { export BOOTSTRAP_FLUX_GITHUB_WEBHOOK_SECRET="${WEBHOOK_SECRET}" _log "INFO" "Using GitHub Token '${WEBHOOK_SECRET}' for Flux" - cp -rf "${PROJECT_DIR}/tmpl/cluster/flux-system" "${PROJECT_DIR}/cluster/apps/" + cp -rf "${PROJECT_DIR}/tmpl/cluster/flux-system/" "${PROJECT_DIR}/cluster/apps/" - WEBHOOK_DIR="${PROJECT_DIR}/cluster/apps/flux-system/webhooks/github/" + envsubst < "${PROJECT_DIR}/tmpl/cluster/flux-system/webhooks/github/secret.sops.yaml" \ + > "${PROJECT_DIR}/cluster/apps/flux-system/webhooks/github/secret.sops.yaml" - envsubst < "${WEBHOOK_DIR}/receiver.yaml" | tee "${WEBHOOK_DIR}/receiver.yaml" > /dev/null - envsubst < "${WEBHOOK_DIR}/secret.sops.yaml" | tee "${WEBHOOK_DIR}/secret.sops.yaml" > /dev/null - - sops --encrypt --in-place "${WEBHOOK_DIR}/secret.sops.yaml" + sops --encrypt --in-place "${PROJECT_DIR}/cluster/apps/flux-system/webhooks/github/secret.sops.yaml" if [[ $(yq eval --no-doc 'contains({"resources": ["flux-system"]})' "${PROJECT_DIR}/cluster/apps/kustomization.yaml") == false ]]; then - yq -i '.resources += [ "flux-system" ]' "${PROJECT_DIR}/cluster/apps/kustomization.yaml" + yq --inplace '.resources += [ "flux-system" ]' "${PROJECT_DIR}/cluster/apps/kustomization.yaml" fi fi }