From e456e14e6f859e50ee19604883da1aa261d5211d Mon Sep 17 00:00:00 2001 From: Ken Roberts Date: Wed, 22 Feb 2023 21:13:17 -0600 Subject: [PATCH 1/3] Added subhelp for make help.kube targets --- makefiles/kube.make | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/makefiles/kube.make b/makefiles/kube.make index 31d40e5..7d4eaed 100644 --- a/makefiles/kube.make +++ b/makefiles/kube.make @@ -9,6 +9,28 @@ kube_tools := $(SHIPKIT_BIN)/kube_tools help.kube: $(MAKE) help HELP_REGEX="^kube.+.*" +# ===== SUBHELP TARGETS ========== +# Trying to cut clutter in kube targets by categorizing them. +# Note that the help regex for these targets is not the same as the target! + +## Show the available subhelp categories for help.kube +help.kube.subhelp: + $(MAKE) help HELP_REGEX="^subhelp.kube.+.*" + +# kube.deploy targets apply full deployments or cronjobs to k8s +subhelp.kube.deploy: + $(MAKE) help HELP_REGEX="^kube.deploy.+.*" + +# kube.kustomize targets apply kustomization directories to the cluster. +subhelp.kube.kustomize: + $(MAKE) help HELP_REGEX="^kube.kustomize.+.*" + +# kube.set targets apply secrets and configmaps outside of a deployment. +subhelp.kube.set: + $(MAKE) help HELP_REGEX="^kube.set.+.*" + +# ===== END SUBHELP TARGETS ========== + # removes everything with the app=$(APP_KEY) under $(APP_KUBE_NAMESPACE) kube.clean: | _verify_APP_KUBE_NAMESPACE $(kube_tools) ctl delete deployment,svc,configmap,ingress --selector="app=$(APP_KEY)" --namespace="$(APP_KUBE_NAMESPACE)" From 43ee813b8ca0b18076b94789a4b6b39ad2b75288 Mon Sep 17 00:00:00 2001 From: Ken Roberts Date: Thu, 2 Mar 2023 21:51:28 -0600 Subject: [PATCH 2/3] Fixed outfile conversion regex --- makefiles/vault.make | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/makefiles/vault.make b/makefiles/vault.make index 3936f89..5201fb6 100644 --- a/makefiles/vault.make +++ b/makefiles/vault.make @@ -66,8 +66,7 @@ vault.decrypt: $(VAULT_DIR) $(VAULT_DIR): | $(SOP_SH) vault.gpg.import-private-key vault.clone cd $(VAULT_DIR) for vfile in $(VAULT_FILES); do - outFile="$${vfile/.enc./.}" # remove .enc. - outFile="$${outFile/.encrypted./.}" # remove .encrypted. + outFile="$$(sed -E s/\.\(encrypted\|enc\)\\b//g <<< $$vfile )" $(logr) "$$vfile > $$outFile" $(SOP_SH) -d $$vfile > $$outFile done From 37df7ecec13e25ca9920d1b739d232feaf1dd0a5 Mon Sep 17 00:00:00 2001 From: Ken Roberts Date: Thu, 2 Mar 2023 21:53:20 -0600 Subject: [PATCH 3/3] Added comment --- makefiles/vault.make | 1 + 1 file changed, 1 insertion(+) diff --git a/makefiles/vault.make b/makefiles/vault.make index 5201fb6..7be22df 100644 --- a/makefiles/vault.make +++ b/makefiles/vault.make @@ -66,6 +66,7 @@ vault.decrypt: $(VAULT_DIR) $(VAULT_DIR): | $(SOP_SH) vault.gpg.import-private-key vault.clone cd $(VAULT_DIR) for vfile in $(VAULT_FILES); do + # Remove any .enc or .encrypted limited by literal dot and word boundary at end outFile="$$(sed -E s/\.\(encrypted\|enc\)\\b//g <<< $$vfile )" $(logr) "$$vfile > $$outFile" $(SOP_SH) -d $$vfile > $$outFile