Skip to content

Commit 248125b

Browse files
committed
switch from devbox to mise and from docker to ko (at least outside of dev/tilt). Bump go to 1.26.4
1 parent dc240b0 commit 248125b

23 files changed

Lines changed: 276 additions & 1494 deletions

.github/copilot-instructions.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,19 @@ Example: `scope.NewClusterScope()` combines `LinodeCluster` + CAPI `Cluster` res
4949
## Development Workflows
5050

5151
### Build & Test Commands
52-
- `make generate` - Regenerate CRDs and mocks after API changes
53-
- `make test` - Run unit tests with mocked clients
54-
- `make e2e E2E_SELECTOR=quick` - Run specific E2E tests using Chainsaw
55-
- `make lint` - Run golangci-lint with project-specific rules
56-
- `make build` - Build the controller manager binary
52+
- `mise run generate` - Regenerate CRDs and mocks after API changes
53+
- `mise run test` - Run unit tests with mocked clients
54+
- `mise run e2e E2E_SELECTOR=quick` - Run specific E2E tests using Chainsaw
55+
- `mise run lint` - Run golangci-lint with project-specific rules
56+
- `mise run build` - Build the controller manager binary
5757

5858
### Adding New Resources
5959
1. Define API types in `api/v1alpha2/` with proper validation markers
6060
2. Implement controller in `internal/controller/` following the standard pattern
6161
3. Add scope in `cloud/scope/` for client management
6262
4. Add validation webhook in `internal/webhook/v1alpha2/`
6363
5. Add cloud services in `cloud/services/` if needed
64-
6. Run `make generate` to update CRDs and mocks
64+
6. Run `mise run generate` to update CRDs and mocks
6565
7. Add E2E tests in `e2e/<resource>-controller/`
6666

6767
### Testing Patterns
@@ -200,5 +200,5 @@ Standard OpenTelemetry environment variables are supported via `autoexport` pack
200200
- Use `kubectl describe` on resources to see status conditions and events
201201
- E2E test failures often indicate webhook validation or API compatibility issues
202202
- Enable debug logging with `CAPL_DEBUG=true` for detailed tracing
203-
- Validate CRDs are current with `make generate` after API changes
204-
- Generate local-release whenever making changes to the /templates directory. Use command `make local-release` to generate the release files.
203+
- Validate CRDs are current with `mise run generate` after API changes
204+
- Generate local-release whenever making changes to the /templates directory. Use command `mise run local-release` to generate the release files.

.github/workflows/build-push.yml

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,30 +35,28 @@ jobs:
3535
sum.golang.org:443
3636
*.githubusercontent.com:443
3737
storage.googleapis.com:443
38+
mise.jdx.dev:443
39+
mise-versions.jdx.dev:443
40+
tuf-repo-cdn.sigstore.dev:443
41+
3842
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3943
with:
4044
fetch-depth: 0
4145
persist-credentials: false
42-
- name: Set up QEMU
43-
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
44-
- name: Set up Docker Buildx
45-
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
46-
- name: Docker Meta
47-
id: meta
48-
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
46+
47+
- name: Set up Mise
48+
uses: jdx/mise-action@dba19683ed58901619b14f395a24841710cb4925 # v4.1.0
4949
with:
50-
images: linode/cluster-api-provider-linode
50+
install_args: go ko
51+
5152
- name: Login to Docker Hub
5253
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
5354
with:
5455
username: ${{ secrets.DOCKER_USERNAME }}
5556
password: ${{ secrets.DOCKER_PASSWORD }}
56-
- name: Build and Push to Docker Hub
57-
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
58-
with:
59-
context: .
60-
build-args: VERSION=${{ github.ref_name == 'main' && format('main-{0}', github.sha) || github.ref_name }}
61-
platforms: linux/amd64,linux/arm64
62-
push: true
63-
tags: ${{ steps.meta.outputs.tags }}
64-
labels: ${{ steps.meta.outputs.labels }}
57+
58+
- name: Publish image with ko
59+
env:
60+
KO_DOCKER_REPO: docker.io/linode/cluster-api-provider-linode
61+
IMAGE_VERSION: ${{ github.ref_name }}
62+
run: mise run ko-publish

.github/workflows/build_test_ci.yml

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches:
66
- main
7-
pull_request_target:
7+
pull_request: # CHANGE ME BACK WHEN DONE TESTING
88
workflow_dispatch:
99

1010
permissions:
@@ -59,37 +59,27 @@ jobs:
5959
sum.golang.org:443
6060
*.githubusercontent.com:443
6161
storage.googleapis.com:443
62-
get.jetify.com:443
63-
get.jetpack.io:443
64-
releases.jetify.com:443
65-
releases.jetpack.io:443
66-
artifacts.nixos.org:443
67-
cache.nixos.org:443
6862
cli.codecov.io:443
6963
api.codecov.io:443
7064
ingest.codecov.io:443
7165
dl.k8s.io:443
7266
cdn.dl.k8s.io:443
67+
mise.jdx.dev:443
68+
mise-versions.jdx.dev:443
69+
tuf-repo-cdn.sigstore.dev:443
7370
7471
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
7572
with:
7673
persist-credentials: false
7774
ref: ${{ github.event.pull_request.head.sha || github.sha }}
7875

79-
- name: Set up Go
80-
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
76+
- name: Set up Mise
77+
uses: jdx/mise-action@dba19683ed58901619b14f395a24841710cb4925 # v4.1.0
8178
with:
82-
go-version-file: 'go.mod'
83-
check-latest: true
84-
85-
- name: Install devbox
86-
uses: jetify-com/devbox-install-action@8c6a66ed6273138b1915457069de78cb52fe3bd7 # v0.15.0
87-
with:
88-
enable-cache: 'true'
89-
refresh-cli: 'false'
79+
install_args: go
9080

9181
- name: Test
92-
run: devbox run make test
82+
run: mise run test
9383

9484
- name: Upload coverage reports to Codecov
9585
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v6.0.2

.github/workflows/e2e-test.yaml

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -119,34 +119,19 @@ jobs:
119119
*.linodeobjects.com:443
120120
dl.k8s.io:443
121121
cdn.dl.k8s.io:443
122-
get.jetify.com:443
123-
get.jetpack.io:443
124-
releases.jetify.com:443
125-
releases.jetpack.io:443
126-
artifacts.nixos.org:443
127-
cache.nixos.org:443
122+
mise.jdx.dev:443
123+
mise-versions.jdx.dev:443
124+
tuf-repo-cdn.sigstore.dev:443
128125
129126
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
130127
with:
131128
persist-credentials: false
132129
ref: ${{ github.event.pull_request.head.sha || github.sha }}
133130

134-
- name: Set up Go
135-
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
131+
- name: Set up Mise
132+
uses: jdx/mise-action@dba19683ed58901619b14f395a24841710cb4925 # v4.1.0
136133
with:
137-
go-version-file: 'go.mod'
138-
check-latest: true
139-
140-
- name: Docker cache
141-
uses: ScribeMD/docker-cache@fb28c93772363301b8d0a6072ce850224b73f74e # 0.5.0
142-
with:
143-
key: docker-${{ runner.os }}-${{ hashFiles('go.sum') }}
144-
145-
- name: Install devbox
146-
uses: jetify-com/devbox-install-action@8c6a66ed6273138b1915457069de78cb52fe3bd7 # v0.15.0
147-
with:
148-
enable-cache: 'true'
149-
refresh-cli: 'false'
134+
install_args: go golangci-lint
150135

151136
- name: Create IPv4-only kind network
152137
run: |
@@ -170,11 +155,11 @@ jobs:
170155
LINODE_MACHINE_TYPE: g6-standard-2
171156
CLUSTERCTL_CONFIG: /home/runner/work/cluster-api-provider-linode/cluster-api-provider-linode/e2e/gha-clusterctl-config.yaml
172157
LINODE_CLIENT_TIMEOUT: 30
173-
run: devbox run make e2etest
158+
run: mise run e2etest
174159

175160
- name: cleanup stale clusters
176161
if: ${{ always() }}
177-
run: make clean-child-clusters
162+
run: mise run clean-child-clusters
178163

179164
- name: Copy logs
180165
if: ${{ always() }}

.github/workflows/e2e-upgrade-test.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,10 @@ jobs:
8989
fetch-depth: 0
9090
persist-credentials: false
9191

92-
- name: Set up Go
93-
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
92+
- name: Set up Mise
93+
uses: jdx/mise-action@dba19683ed58901619b14f395a24841710cb4925 # v4.1.0
9494
with:
95-
go-version-file: 'go.mod'
96-
check-latest: true
95+
install_args: go
9796

9897
- name: Create IPv4-only kind network
9998
run: |
@@ -113,12 +112,12 @@ jobs:
113112
LINODE_MACHINE_TYPE: g6-standard-2
114113
CLUSTERCTL_CONFIG: /home/runner/work/cluster-api-provider-linode/cluster-api-provider-linode/e2e/gha-clusterctl-config.yaml
115114
E2E_FLAGS: --assert-timeout 20m0s
116-
run: make test-upgrade
115+
run: mise run test-upgrade
117116

118117
- name: cleanup stale clusters
119118
if: ${{ always() }}
120-
run: make clean-child-clusters
119+
run: mise run clean-child-clusters
121120

122121
- name: cleanup kind mgmt cluster
123122
if: ${{ always() }}
124-
run: make clean-kind-cluster
123+
run: mise run clean-kind-cluster

.github/workflows/go-analyze.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,23 +69,22 @@ jobs:
6969
with:
7070
persist-credentials: false
7171

72-
- name: Set up Go
73-
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
72+
- name: Set up Mise
73+
uses: jdx/mise-action@dba19683ed58901619b14f395a24841710cb4925 # v4.1.0
7474
with:
75-
go-version-file: 'go.mod'
76-
check-latest: true
75+
install_args: go
7776

7877
- name: lint
7978
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
8079

8180
- name: lint-api
82-
run: make lint-api
81+
run: mise run lint-api
8382

8483
- name: Nilcheck
85-
run: make nilcheck
84+
run: mise run nilcheck
8685

8786
- name: Vulncheck
88-
run: make vulncheck
87+
run: mise run vulncheck
8988

9089
- name: Gosec
91-
run: make gosec
90+
run: mise run gosec

.github/workflows/pull_request_ci.yaml

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -73,38 +73,28 @@ jobs:
7373
sum.golang.org:443
7474
*.githubusercontent.com:443
7575
storage.googleapis.com:443
76-
get.jetify.com:443
77-
get.jetpack.io:443
78-
releases.jetify.com:443
79-
releases.jetpack.io:443
80-
artifacts.nixos.org:443
81-
cache.nixos.org:443
76+
mise.jdx.dev:443
77+
mise-versions.jdx.dev:443
78+
tuf-repo-cdn.sigstore.dev:443
8279
dl.k8s.io:443
8380
cdn.dl.k8s.io:443
8481
8582
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
8683
with:
8784
persist-credentials: false
8885

89-
- name: Set up Go
90-
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
86+
- name: Set up Mise
87+
uses: jdx/mise-action@dba19683ed58901619b14f395a24841710cb4925 # v4.1.0
9188
with:
92-
go-version-file: 'go.mod'
93-
check-latest: true
94-
95-
- name: Install devbox
96-
uses: jetify-com/devbox-install-action@8c6a66ed6273138b1915457069de78cb52fe3bd7 # v0.15.0
97-
with:
98-
enable-cache: 'true'
99-
refresh-cli: 'false'
89+
install_args: go
10090

10191
- name: Build
102-
run: devbox run make build
92+
run: mise run build
10393

10494
- name: Check for generated diff
105-
run: make check-gen-diff
95+
run: mise run check-gen-diff
10696

107-
docker-build:
97+
image-build:
10898
runs-on: ubuntu-latest
10999
needs: changes
110100
if: ${{ contains(fromJSON(needs.changes.outputs.paths), 'src') }}
@@ -130,15 +120,19 @@ jobs:
130120
production.cloudfront.docker.com:443
131121
gcr.io:443
132122
storage.googleapis.com:443
123+
mise.jdx.dev:443
124+
mise-versions.jdx.dev:443
125+
tuf-repo-cdn.sigstore.dev:443
126+
dl.k8s.io:443
133127
134128
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
135129
with:
136130
persist-credentials: false
137131

138-
- name: Docker cache
139-
uses: ScribeMD/docker-cache@fb28c93772363301b8d0a6072ce850224b73f74e # 0.5.0
132+
- name: Set up Mise
133+
uses: jdx/mise-action@dba19683ed58901619b14f395a24841710cb4925 # v4.1.0
140134
with:
141-
key: docker-${{ runner.os }}-${{ hashFiles('go.sum') }}
135+
install_args: go ko
142136

143-
- name: Build the Docker image
144-
run: make docker-build
137+
- name: Build the image
138+
run: mise run ko-build

.husky/hooks/pre-commit

Lines changed: 0 additions & 3 deletions
This file was deleted.

.husky/hooks/pre-push

Lines changed: 0 additions & 19 deletions
This file was deleted.

.ko.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
defaultBaseImage: gcr.io/distroless/static:nonroot
2+
defaultPlatforms:
3+
- linux/arm64
4+
- linux/amd64

0 commit comments

Comments
 (0)