Skip to content

Commit 38838ed

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

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
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: 21 additions & 0 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

@@ -253,6 +257,12 @@ check-release-build: release-build
253257
$(info checking for git diff after running 'make release-build')
254258
git diff --quiet ; if [ $$? -eq 1 ] ; then echo "Please, commit templates after running 'make release-build' command"; exit 1 ; fi
255259

260+
.PHONY: check-update-helm-sub-charts
261+
check-update-helm-sub-charts: update-helm-sub-charts
262+
$(info checking for git diff after running 'make release-build')
263+
git diff --quiet ; if [ $$? -eq 1 ] ; then echo "Please, commit Helm Chart after running 'make update-helm-sub-charts' command"; exit 1 ; fi
264+
265+
256266
TEST_TARGETS := test-default test-bench test-short test-verbose test-race
257267
.PHONY: $(TEST_TARGETS) test-xml check test tests
258268
test-bench: ARGS=-run=__absolutelynothing__ -bench=. ## Run benchmarks
@@ -414,6 +424,17 @@ release-build:
414424
cd hack && $(GO) run release.go --templateDir ./templates/values/ --outputDir ../deployment/network-operator/
415425
cd hack && $(GO) run release.go --templateDir ./templates/config/manager --outputDir ../config/manager/
416426

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

419440
MINIKUBE_CLUSTER_NAME = net-op-dev

0 commit comments

Comments
 (0)