From 255b15bc762c54871fca9d053b6ac75cd2ee7c65 Mon Sep 17 00:00:00 2001 From: jvoravong <47871238+jvoravong@users.noreply.github.com> Date: Wed, 15 Nov 2023 14:56:49 -0700 Subject: [PATCH] =?UTF-8?q?Update=20project=20=20usages=20of=20'make=20rep?= =?UTF-8?q?o-update'=20and=20'make=20dep-build'=20to=20use=20'make=20dep-u?= =?UTF-8?q?pdate=E2=80=99=20to=20avoid=20maintaining/deleting=20a=20stale?= =?UTF-8?q?=20Chart.lock=20file=20locally=20(#1009)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/functional_test.yaml | 2 +- .github/workflows/functional_test_v2.yaml | 2 +- .github/workflows/lint-test.yaml | 2 +- .github/workflows/update_chart_dependencies.yaml | 4 ++-- .pre-commit-config.yaml | 2 +- Makefile | 13 ++++--------- 6 files changed, 10 insertions(+), 15 deletions(-) diff --git a/.github/workflows/functional_test.yaml b/.github/workflows/functional_test.yaml index 7bbbd83e90..1bb9ef7d9b 100644 --- a/.github/workflows/functional_test.yaml +++ b/.github/workflows/functional_test.yaml @@ -77,7 +77,7 @@ jobs: - name: Deploy splunk-otel-collector chart run: | - make repo-update dep-build + make dep-update export CI_SPLUNK_HOST=$(kubectl get pod splunk --template={{.status.podIP}}) ci_scripts/deploy_collector.sh diff --git a/.github/workflows/functional_test_v2.yaml b/.github/workflows/functional_test_v2.yaml index bdb4c90cdc..7f21c2ac42 100644 --- a/.github/workflows/functional_test_v2.yaml +++ b/.github/workflows/functional_test_v2.yaml @@ -51,7 +51,7 @@ jobs: kubectl get csr -o=jsonpath='{range.items[?(@.spec.signerName=="kubernetes.io/kubelet-serving")]}{.metadata.name}{" "}{end}' | xargs kubectl certificate approve - name: Update dependencies run: | - make repo-update dep-build + make dep-update - name: Deploy cert-manager run: | make cert-manager diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml index fa4156e728..4b7c2d3925 100644 --- a/.github/workflows/lint-test.yaml +++ b/.github/workflows/lint-test.yaml @@ -25,7 +25,7 @@ jobs: version: v3.7.1 - name: Set up chart dependencies - run: make repo-update dep-build + run: make dep-update - name: Run chart-testing (list-changed) id: list-changed diff --git a/.github/workflows/update_chart_dependencies.yaml b/.github/workflows/update_chart_dependencies.yaml index 6b6646795b..899a1dcdee 100644 --- a/.github/workflows/update_chart_dependencies.yaml +++ b/.github/workflows/update_chart_dependencies.yaml @@ -42,8 +42,8 @@ jobs: DEBUG_ARG="--debug" fi - # Ensure repositories are up-to-date - make repo-update + # Ensure chart dependencies are up-to-date + make dep-update # Fetch the latest version using helm search repo LATEST_VER=$(helm search repo ${{ matrix.repo }} --versions | awk 'NR==2{print $2}') diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a0d620e983..99ca8731ed 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: hooks: - id: render name: Create the rendered Kubernetes manifest resources for the project examples - entry: make repo-update dep-build render + entry: make render language: system pass_filenames: false - repo: https://github.com/pre-commit/pre-commit-hooks diff --git a/Makefile b/Makefile index 147f0f674b..5bd5c6ef7b 100644 --- a/Makefile +++ b/Makefile @@ -40,8 +40,8 @@ install-tools: ## Install tools (macOS/Linux) ##@ Build # Tasks related to building the Helm chart -.PHONY: repo-update -repo-update: ## Update Helm repositories to latest +.PHONY: dep-update +dep-update: ## Update Helm chart dependencies to latest, build the Helm chart with latest dependencies @{ \ if ! (helm repo list | grep -q open-telemetry) ; then \ helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts || exit 1; \ @@ -50,20 +50,15 @@ repo-update: ## Update Helm repositories to latest helm repo add jetstack https://charts.jetstack.io || exit 1; \ fi ;\ helm repo update open-telemetry jetstack || exit 1; \ - } - -.PHONY: dep-build -dep-build: ## Build the Helm chart with latest dependencies from the current Helm repositories - @{ \ DEP_OK=true ;\ DIR=helm-charts/splunk-otel-collector ;\ if ! helm dependencies list $$DIR | grep open-telemetry | grep -q ok ; then DEP_OK=false ; fi ;\ if ! helm dependencies list $$DIR | grep jetstack | grep -q ok ; then DEP_OK=false ; fi ;\ - if [ "$$DEP_OK" = "false" ] ; then helm dependencies build $$DIR || exit 1; fi ;\ + if [ "$$DEP_OK" = "false" ] ; then helm dependencies update $$DIR || exit 1; fi ;\ } .PHONY: render -render: repo-update dep-build ## Render the Helm chart with the examples as input +render: dep-update ## Render the Helm chart with the examples as input examples/render-examples.sh || exit 1 ##@ Test