Skip to content

Commit

Permalink
Update project usages of 'make repo-update' and 'make dep-build' to u…
Browse files Browse the repository at this point in the history
…se 'make dep-update’ to avoid maintaining/deleting a stale Chart.lock file locally (signalfx#1009)
  • Loading branch information
jvoravong committed Nov 15, 2023
1 parent 66f438f commit 255b15b
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/functional_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/functional_test_v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update_chart_dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}')
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 4 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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; \
Expand All @@ -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
Expand Down

0 comments on commit 255b15b

Please sign in to comment.