Skip to content

Commit cc826df

Browse files
committed
switch from devbox to mise and from docker to ko. Bump go to 1.26.4
1 parent dc240b0 commit cc826df

21 files changed

Lines changed: 236 additions & 1486 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: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,30 +35,25 @@ jobs:
3535
sum.golang.org:443
3636
*.githubusercontent.com:443
3737
storage.googleapis.com:443
38+
3839
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3940
with:
4041
fetch-depth: 0
4142
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
43+
44+
- name: Set up Mise
45+
uses: jdx/mise-action@dba19683ed58901619b14f395a24841710cb4925 # v4.1.0
4946
with:
50-
images: linode/cluster-api-provider-linode
47+
install_args: go ko
48+
5149
- name: Login to Docker Hub
5250
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
5351
with:
5452
username: ${{ secrets.DOCKER_USERNAME }}
5553
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 }}
54+
55+
- name: Publish image with ko
56+
env:
57+
KO_DOCKER_REPO: docker.io/linode/cluster-api-provider-linode
58+
IMAGE_VERSION: ${{ github.ref_name }}
59+
run: mise run ko-publish

.github/workflows/build_test_ci.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,20 +76,13 @@ jobs:
7676
persist-credentials: false
7777
ref: ${{ github.event.pull_request.head.sha || github.sha }}
7878

79-
- name: Set up Go
80-
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
79+
- name: Set up Mise
80+
uses: jdx/mise-action@dba19683ed58901619b14f395a24841710cb4925 # v4.1.0
8181
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'
82+
install_args: go
9083

9184
- name: Test
92-
run: devbox run make test
85+
run: mise run test
9386

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

.github/workflows/e2e-test.yaml

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -131,22 +131,10 @@ jobs:
131131
persist-credentials: false
132132
ref: ${{ github.event.pull_request.head.sha || github.sha }}
133133

134-
- name: Set up Go
135-
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
134+
- name: Set up Mise
135+
uses: jdx/mise-action@dba19683ed58901619b14f395a24841710cb4925 # v4.1.0
136136
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'
137+
install_args: go golangci-lint
150138

151139
- name: Create IPv4-only kind network
152140
run: |
@@ -170,11 +158,11 @@ jobs:
170158
LINODE_MACHINE_TYPE: g6-standard-2
171159
CLUSTERCTL_CONFIG: /home/runner/work/cluster-api-provider-linode/cluster-api-provider-linode/e2e/gha-clusterctl-config.yaml
172160
LINODE_CLIENT_TIMEOUT: 30
173-
run: devbox run make e2etest
161+
run: mise run e2etest
174162

175163
- name: cleanup stale clusters
176164
if: ${{ always() }}
177-
run: make clean-child-clusters
165+
run: mise run clean-child-clusters
178166

179167
- name: Copy logs
180168
if: ${{ always() }}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@ jobs:
113113
LINODE_MACHINE_TYPE: g6-standard-2
114114
CLUSTERCTL_CONFIG: /home/runner/work/cluster-api-provider-linode/cluster-api-provider-linode/e2e/gha-clusterctl-config.yaml
115115
E2E_FLAGS: --assert-timeout 20m0s
116-
run: make test-upgrade
116+
run: mise run test-upgrade
117117

118118
- name: cleanup stale clusters
119119
if: ${{ always() }}
120-
run: make clean-child-clusters
120+
run: mise run clean-child-clusters
121121

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

.github/workflows/go-analyze.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ jobs:
7979
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
8080

8181
- name: lint-api
82-
run: make lint-api
82+
run: mise run lint-api
8383

8484
- name: Nilcheck
85-
run: make nilcheck
85+
run: mise run nilcheck
8686

8787
- name: Vulncheck
88-
run: make vulncheck
88+
run: mise run vulncheck
8989

9090
- name: Gosec
91-
run: make gosec
91+
run: mise run gosec

.github/workflows/pull_request_ci.yaml

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -86,25 +86,18 @@ jobs:
8686
with:
8787
persist-credentials: false
8888

89-
- name: Set up Go
90-
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
89+
- name: Set up Mise
90+
uses: jdx/mise-action@dba19683ed58901619b14f395a24841710cb4925 # v4.1.0
9191
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'
92+
install_args: go
10093

10194
- name: Build
102-
run: devbox run make build
95+
run: mise run build
10396

10497
- name: Check for generated diff
105-
run: make check-gen-diff
98+
run: mise run check-gen-diff
10699

107-
docker-build:
100+
image-build:
108101
runs-on: ubuntu-latest
109102
needs: changes
110103
if: ${{ contains(fromJSON(needs.changes.outputs.paths), 'src') }}
@@ -135,10 +128,5 @@ jobs:
135128
with:
136129
persist-credentials: false
137130

138-
- name: Docker cache
139-
uses: ScribeMD/docker-cache@fb28c93772363301b8d0a6072ce850224b73f74e # 0.5.0
140-
with:
141-
key: docker-${{ runner.os }}-${{ hashFiles('go.sum') }}
142-
143-
- name: Build the Docker image
144-
run: make docker-build
131+
- name: Build the image
132+
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)