Skip to content

Commit 62ef965

Browse files
author
Rahul Sharma
committed
update helm version, update Makefile
1 parent 6374f4e commit 62ef965

File tree

2 files changed

+60
-11
lines changed

2 files changed

+60
-11
lines changed

.github/workflows/ci.yml

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ on:
66
- main
77
pull_request: null
88

9+
permissions:
10+
contents: read
11+
pull-requests: read
12+
actions: read
13+
14+
concurrency:
15+
group: ci-${{ github.ref }}
16+
cancel-in-progress: true
17+
918
jobs:
1019
changes:
1120
runs-on: ubuntu-latest
@@ -26,25 +35,58 @@ jobs:
2635
with:
2736
base: ${{ github.ref }}
2837
filters: .github/filters.yml
29-
ci:
38+
39+
yamllint:
3040
runs-on: ubuntu-latest
3141
needs: changes
3242
if: ${{ contains(fromJSON(needs.changes.outputs.paths), 'src') }}
3343
steps:
44+
- uses: actions/checkout@v4
45+
- name: Validate YAML file
46+
run: yamllint deploy
47+
48+
build-test:
49+
runs-on: ubuntu-latest
50+
needs: changes
51+
if: ${{ contains(fromJSON(needs.changes.outputs.paths), 'src') }}
52+
steps:
53+
- name: Harden Runner
54+
uses: step-security/harden-runner@v2
55+
with:
56+
disable-sudo: true
57+
egress-policy: block
58+
allowed-endpoints: >
59+
api.github.com:443
60+
github.com:443
61+
golang.org:443
62+
proxy.golang.org:443
63+
sum.golang.org:443
64+
objects.githubusercontent.com:443
65+
storage.googleapis.com:443
66+
cli.codecov.io:443
67+
api.codecov.io:443
68+
raw.githubusercontent.com:443
69+
3470
- uses: actions/checkout@v4
3571
with:
3672
fetch-depth: 0
3773
- uses: actions/setup-go@v5
3874
with:
3975
go-version-file: go.mod
76+
check-latest: true
77+
4078
- name: Vet
4179
run: make vet
80+
4281
- name: Lint
4382
run: make lint
83+
4484
- name: Helm Lint
4585
run: make helm-lint
86+
4687
- name: Test
4788
run: make test
89+
4890
- name: Upload coverage reports to Codecov
4991
uses: codecov/codecov-action@v5
5092
with:
@@ -53,8 +95,10 @@ jobs:
5395
verbose: true
5496
token: ${{ secrets.CODECOV_TOKEN }}
5597
slug: linode/linode-cloud-controller-manager
98+
5699
- name: Build
57100
run: make build
101+
58102
docker-build:
59103
runs-on: ubuntu-latest
60104
steps:

Makefile

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ CACHE_BIN ?= $(CURDIR)/bin
77
LOCALBIN ?= $(CACHE_BIN)
88

99
DEVBOX_BIN ?= $(DEVBOX_PACKAGES_DIR)/bin
10+
HELM ?= $(LOCALBIN)/helm
11+
HELM_VERSION ?= v3.16.3
1012

1113
#####################################################################
1214
# Dev Setup
1315
#####################################################################
1416
CLUSTER_NAME ?= ccm-$(shell git rev-parse --short HEAD)
1517
K8S_VERSION ?= "v1.29.1"
1618
CAPI_VERSION ?= "v1.6.3"
17-
HELM_VERSION ?= "v0.2.1"
19+
CAAPH_VERSION ?= "v0.2.1"
1820
CAPL_VERSION ?= "v0.7.1"
1921
CONTROLPLANE_NODES ?= 1
2022
WORKER_NODES ?= 1
@@ -55,10 +57,15 @@ vet: fmt
5557

5658
.PHONY: lint
5759
lint:
58-
docker run --rm -v "$(shell pwd):/var/work:ro" -w /var/work \
59-
golangci/golangci-lint:v1.57.2 golangci-lint run -v --timeout=5m
60-
docker run --rm -v "$(shell pwd):/var/work:ro" -w /var/work/e2e \
61-
golangci/golangci-lint:v1.57.2 golangci-lint run -v --timeout=5m
60+
docker run --rm -v "$(PWD):/var/work:ro" -w /var/work \
61+
golangci/golangci-lint:latest golangci-lint run -v --timeout=5m
62+
docker run --rm -v "$(PWD):/var/work:ro" -w /var/work/e2e \
63+
golangci/golangci-lint:latest golangci-lint run -v --timeout=5m
64+
65+
.PHONY: gosec
66+
gosec: ## Run gosec against code.
67+
docker run --rm -v "$(PWD):/var/work:ro" -w /var/work securego/gosec:2.19.0 \
68+
-exclude-dir=bin -exclude-generated ./...
6269

6370
.PHONY: fmt
6471
fmt:
@@ -150,13 +157,14 @@ create-capl-cluster:
150157
kubectl wait --for=condition=NodeHealthy=true machines -l cluster.x-k8s.io/cluster-name=$(CLUSTER_NAME) --timeout=900s
151158
clusterctl get kubeconfig $(CLUSTER_NAME) > $(KUBECONFIG_PATH)
152159
KUBECONFIG=$(KUBECONFIG_PATH) kubectl wait --for=condition=Ready nodes --all --timeout=600s
153-
# Remove all taints so that pods can be scheduled anywhere (without this, some tests fail)
160+
# Remove all taints from control plane node so that pods scheduled on it by tests can run (without this, some tests fail)
154161
KUBECONFIG=$(KUBECONFIG_PATH) kubectl taint nodes -l node-role.kubernetes.io/control-plane node-role.kubernetes.io/control-plane-
155162

156163
.PHONY: patch-linode-ccm
157164
patch-linode-ccm:
158165
KUBECONFIG=$(KUBECONFIG_PATH) kubectl patch -n kube-system daemonset ccm-linode --type='json' -p="[{'op': 'replace', 'path': '/spec/template/spec/containers/0/image', 'value': '${IMG}'}]"
159166
KUBECONFIG=$(KUBECONFIG_PATH) kubectl rollout status -n kube-system daemonset/ccm-linode --timeout=600s
167+
KUBECONFIG=$(KUBECONFIG_PATH) kubectl -n kube-system get daemonset/ccm-linode -o yaml
160168

161169
.PHONY: mgmt-cluster
162170
mgmt-cluster:
@@ -166,7 +174,7 @@ mgmt-cluster:
166174
--wait-providers \
167175
--wait-provider-timeout 600 \
168176
--core cluster-api:$(CAPI_VERSION) \
169-
--addon helm:$(HELM_VERSION) \
177+
--addon helm:$(CAAPH_VERSION) \
170178
--infrastructure linode-linode:$(CAPL_VERSION)
171179

172180
.PHONY: cleanup-cluster
@@ -197,9 +205,6 @@ else ifeq ($(ARCH_SHORT),aarch64)
197205
ARCH_SHORT := arm64
198206
endif
199207

200-
HELM ?= $(LOCALBIN)/helm
201-
HELM_VERSION ?= v3.9.1
202-
203208
.PHONY: helm
204209
helm: $(HELM) ## Download helm locally if necessary
205210
$(HELM): $(LOCALBIN)

0 commit comments

Comments
 (0)