Skip to content

Commit 92693a4

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

File tree

2 files changed

+51
-11
lines changed

2 files changed

+51
-11
lines changed

.github/workflows/ci.yml

Lines changed: 36 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,49 @@ jobs:
2635
with:
2736
base: ${{ github.ref }}
2837
filters: .github/filters.yml
29-
ci:
38+
39+
build-test:
3040
runs-on: ubuntu-latest
3141
needs: changes
3242
if: ${{ contains(fromJSON(needs.changes.outputs.paths), 'src') }}
3343
steps:
44+
- name: Harden Runner
45+
uses: step-security/harden-runner@v2
46+
with:
47+
disable-sudo: true
48+
egress-policy: block
49+
allowed-endpoints: >
50+
api.github.com:443
51+
github.com:443
52+
golang.org:443
53+
proxy.golang.org:443
54+
sum.golang.org:443
55+
objects.githubusercontent.com:443
56+
storage.googleapis.com:443
57+
cli.codecov.io:443
58+
api.codecov.io:443
59+
raw.githubusercontent.com:443
60+
3461
- uses: actions/checkout@v4
3562
with:
3663
fetch-depth: 0
3764
- uses: actions/setup-go@v5
3865
with:
3966
go-version-file: go.mod
67+
check-latest: true
68+
4069
- name: Vet
4170
run: make vet
71+
4272
- name: Lint
4373
run: make lint
74+
4475
- name: Helm Lint
4576
run: make helm-lint
77+
4678
- name: Test
4779
run: make test
80+
4881
- name: Upload coverage reports to Codecov
4982
uses: codecov/codecov-action@v5
5083
with:
@@ -53,8 +86,10 @@ jobs:
5386
verbose: true
5487
token: ${{ secrets.CODECOV_TOKEN }}
5588
slug: linode/linode-cloud-controller-manager
89+
5690
- name: Build
5791
run: make build
92+
5893
docker-build:
5994
runs-on: ubuntu-latest
6095
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)