Skip to content

Commit f4bec36

Browse files
committed
chore: check nic conf helm sub chart
Signed-off-by: Fred Rolland <[email protected]>
1 parent 788e837 commit f4bec36

File tree

2 files changed

+39
-3
lines changed

2 files changed

+39
-3
lines changed

.github/workflows/checks.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,20 @@ jobs:
7878
uses: actions/checkout@v4
7979
- name: check release-build
8080
run: make check-release-build
81+
diff-helm-sub-charts:
82+
name: check update-helm-sub-charts
83+
runs-on: ubuntu-22.04
84+
permissions:
85+
contents: read
86+
steps:
87+
- name: Set up Go 1.x
88+
uses: actions/setup-go@v5
89+
with:
90+
go-version: '1.23'
91+
- name: checkout
92+
uses: actions/checkout@v4
93+
- name: check release-build
94+
run: make check-update-helm-sub-charts
8195
unit-tests:
8296
name: Unit-tests
8397
runs-on: ubuntu-22.04

Makefile

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ CHART_PATH=$(CURDIR)/deployment/$(PACKAGE)
2121
TOOLSDIR=$(CURDIR)/hack/tools/bin
2222
MANIFESTDIR=$(CURDIR)/hack/manifests
2323
BUILDDIR=$(CURDIR)/build/_output
24+
HELM_CHART_DEP_CHECKDIR=$(CURDIR)/build/helmcharts
2425
GOFILES=$(shell find . -name "*.go" | grep -vE "(\/vendor\/)|(_test.go)")
2526
TESTPKGS=./...
2627
ENVTEST_K8S_VERSION=1.28
@@ -109,6 +110,9 @@ $(MANIFESTDIR):
109110
$(BUILDDIR): ; $(info Creating build directory...)
110111
mkdir -p $@
111112

113+
$(HELM_CHART_DEP_CHECKDIR):
114+
mkdir -p $@
115+
112116
build: generate $(BUILDDIR)/$(BINARY_NAME) ; $(info Building $(BINARY_NAME)...) @ ## Build executable file
113117
$(info Done!)
114118

@@ -238,11 +242,12 @@ lint-helm: $(HELM) ; $(info running lint for helm charts...) @ ## Run helm lint
238242
.PHONY: check-manifests
239243
check-manifests: generate manifests
240244
$(info checking for git diff after running 'make manifests')
241-
git diff --quiet ; if [ $$? -eq 1 ] ; then echo "Please, commit manifests after running 'make manifests' and 'make generate' commands"; exit 1 ; fi
245+
@git diff --quiet || (echo "Error: Please, commit manifests after running 'make manifests' and 'make generate' commands' command" && exit 1)
242246

243247
.PHONY: check-go-modules
244248
check-go-modules: generate-go-modules
245-
git diff --quiet HEAD go.sum; if [ $$? -eq 1 ] ; then echo "go.sum is out of date. Please commit after running 'make generate-go-modules' command"; exit 1; fi
249+
$(info checking for git diff after running 'make generate-go-modules')
250+
@git diff --quiet || (echo "Error: go.sum is out of date. Please commit after running 'make generate-go-modules' command" && exit 1)
246251

247252
.PHONY: generate-go-modules
248253
generate-go-modules:
@@ -251,7 +256,13 @@ generate-go-modules:
251256
.PHONY: check-release-build
252257
check-release-build: release-build
253258
$(info checking for git diff after running 'make release-build')
254-
git diff --quiet ; if [ $$? -eq 1 ] ; then echo "Please, commit templates after running 'make release-build' command"; exit 1 ; fi
259+
@git diff --quiet || (echo "Error: Please commit templates after running 'make release-build' command" && exit 1)
260+
261+
.PHONY: check-update-helm-sub-charts
262+
check-update-helm-sub-charts: update-helm-sub-charts
263+
$(info checking for git diff after running 'make update-helm-sub-charts')
264+
@git diff --quiet || (echo "Error: Please commit Helm Chart changes after running 'make update-helm-sub-charts' command" && exit 1)
265+
255266

256267
TEST_TARGETS := test-default test-bench test-short test-verbose test-race
257268
.PHONY: $(TEST_TARGETS) test-xml check test tests
@@ -414,6 +425,17 @@ release-build:
414425
cd hack && $(GO) run release.go --templateDir ./templates/values/ --outputDir ../deployment/network-operator/
415426
cd hack && $(GO) run release.go --templateDir ./templates/config/manager --outputDir ../config/manager/
416427

428+
.PHONY: helm-update-nic-configuration
429+
helm-update-nic-configuration: $(HELM) $(HELM_CHART_DEP_CHECKDIR)
430+
rm -rf ./build/helmcharts/nic-configuration-operator-chart
431+
@NIC_CONF_VERSION=$$(yq '.nicConfigurationOperator.version' hack/release.yaml | sed 's/^v//'); \
432+
$(HELM) pull oci://ghcr.io/mellanox/nic-configuration-operator-chart --version $$NIC_CONF_VERSION -d $(HELM_CHART_DEP_CHECKDIR) --untar
433+
rsync -av --exclude='Chart.yaml' $(HELM_CHART_DEP_CHECKDIR)/nic-configuration-operator-chart deployment/network-operator/charts/
434+
435+
.PHONY: update-helm-sub-charts
436+
update-helm-sub-charts: helm-update-nic-configuration
437+
438+
417439
# dev environment
418440

419441
MINIKUBE_CLUSTER_NAME = net-op-dev

0 commit comments

Comments
 (0)