Skip to content

Commit 22d3f44

Browse files
Feat(provider): New Crossplane v2 supported (#38)
* chore(deps): update actions/setup-go digest to d35c59a * Update Build tooling to latest * feat! migration to V2 * chore(deps): update actions/checkout action to v5 * fix: linter update * fix: makefile to build provider * Fix runtime issue on local-dev * chore(deps): update golangci/golangci-lint-action action to v8 * chore(deps): update tj-actions/changed-files action to v46 * ci: Local push to gcr * ci: uptest version fix * ci: linter config back to v1 * ci: fixed ci cyclo issue * . * feat(package): Added safe-start * . * . * chore(deps): update codecov/codecov-action action to v5 * . * . * . * . * chore: new doc and ci update * tf sdk update * fix: lint error * feat: E2E passing local * chore: go dependancies update * fix: upgrade crossplane cli version to support startsafe * fix: reverted to array types instead of singleton list * ci: adde the publishing back to upbound --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
1 parent d3b87c7 commit 22d3f44

File tree

2,074 files changed

+426241
-160992
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,074 files changed

+426241
-160992
lines changed

.github/workflows/ci.yml

Lines changed: 136 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@ on:
1313

1414
env:
1515
# Common versions
16-
GO_VERSION: '1.21'
17-
GOLANGCI_VERSION: 'v1.54.0'
18-
DOCKER_BUILDX_VERSION: 'v0.8.2'
16+
GO_VERSION: '1.25'
17+
GOLANGCI_VERSION: 'v1.64.4'
18+
DOCKER_BUILDX_VERSION: 'v0.20.1'
19+
20+
CROSSPLANE_REGORG: 'ghcr.io/glalanne' # xpkg.crossplane.io/crossplane-contrib
21+
UPBOUND_REGORG: 'xpkg.upbound.io/glalanne'
1922

2023
# Common users. We can't run a step 'if secrets.XXX != ""' but we can run a
2124
# step 'if env.XXX != ""', so we copy these to succinctly test whether
@@ -24,7 +27,7 @@ env:
2427

2528
jobs:
2629
detect-noop:
27-
runs-on: ubuntu-24.04
30+
runs-on: ubuntu-latest
2831
outputs:
2932
noop: ${{ steps.noop.outputs.should_skip }}
3033
steps:
@@ -37,18 +40,18 @@ jobs:
3740
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
3841

3942
report-breaking-changes:
40-
runs-on: ubuntu-24.04
43+
runs-on: ubuntu-latest
4144
needs: detect-noop
4245
if: needs.detect-noop.outputs.noop != 'true'
4346
steps:
4447
- name: Checkout
45-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
48+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
4649
with:
4750
submodules: true
4851

4952
- name: Get modified CRDs
5053
id: modified-crds
51-
uses: tj-actions/changed-files@v45
54+
uses: tj-actions/changed-files@v46
5255
with:
5356
files: |
5457
package/crds/**
@@ -64,13 +67,13 @@ jobs:
6467
make schema-version-diff
6568
6669
lint:
67-
runs-on: ubuntu-24.04
70+
runs-on: ubuntu-latest
6871
needs: detect-noop
6972
if: needs.detect-noop.outputs.noop != 'true'
7073

7174
steps:
7275
- name: Checkout
73-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
76+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
7477
with:
7578
submodules: true
7679

@@ -108,13 +111,13 @@ jobs:
108111
version: ${{ env.GOLANGCI_VERSION }}
109112

110113
check-diff:
111-
runs-on: ubuntu-24.04
114+
runs-on: ubuntu-latest
112115
needs: detect-noop
113116
if: needs.detect-noop.outputs.noop != 'true'
114117

115118
steps:
116119
- name: Checkout
117-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
120+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
118121
with:
119122
submodules: true
120123

@@ -151,13 +154,13 @@ jobs:
151154
run: make check-diff
152155

153156
unit-tests:
154-
runs-on: ubuntu-24.04
157+
runs-on: ubuntu-latest
155158
needs: detect-noop
156159
if: needs.detect-noop.outputs.noop != 'true'
157160

158161
steps:
159162
- name: Checkout
160-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
163+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
161164
with:
162165
submodules: true
163166

@@ -194,54 +197,57 @@ jobs:
194197
run: make -j2 test
195198

196199
- name: Publish Unit Test Coverage
197-
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4
200+
uses: codecov/codecov-action@fdcc8476540edceab3de004e990f80d881c6cc00 # v5
198201
with:
199202
flags: unittests
200203
file: _output/tests/linux_amd64/coverage.txt
201204

202205
local-deploy:
203-
runs-on: ubuntu-24.04
206+
runs-on: ubuntu-latest
204207
needs: detect-noop
205208
if: needs.detect-noop.outputs.noop != 'true'
206209

207210
steps:
211+
# - name: Cleanup Disk
212+
# uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
213+
# with:
214+
# large-packages: false
215+
# swap-storage: false
216+
208217
- name: Checkout
209-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
218+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
210219
with:
211220
submodules: true
212221

213222
- name: Fetch History
214223
run: git fetch --prune --unshallow
215224

216225
- name: Setup Go
217-
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5
226+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
218227
with:
219228
go-version: ${{ env.GO_VERSION }}
220229

221-
- name: Find the Go Build Cache
222-
id: go
223-
run: echo "cache=$(make go.cachedir)" >> $GITHUB_OUTPUT
224-
225-
- name: Cache the Go Build Cache
226-
uses: actions/cache@v4
227-
with:
228-
path: ${{ steps.go.outputs.cache }}
229-
key: ${{ runner.os }}-build-unit-tests-${{ hashFiles('**/go.sum') }}
230-
restore-keys: ${{ runner.os }}-build-unit-tests-
231-
232-
- name: Cache Go Dependencies
233-
uses: actions/cache@v4
234-
with:
235-
path: .work/pkg
236-
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
237-
restore-keys: ${{ runner.os }}-pkg-
238-
239230
- name: Vendor Dependencies
240231
run: make vendor vendor.check
241232

242233
- name: Deploying locally built provider package
243234
run: make local-deploy
244235

236+
check-examples:
237+
runs-on: ubuntu-latest
238+
needs: detect-noop
239+
if: ${{ needs.detect-noop.outputs.noop != 'true' }}
240+
241+
steps:
242+
- name: Checkout
243+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
244+
with:
245+
submodules: true
246+
247+
- name: Check Example Manifests
248+
run: |
249+
./scripts/check-examples.py package/crds examples
250+
245251
publish-artifacts:
246252
runs-on: ubuntu-24.04
247253
permissions:
@@ -269,13 +275,6 @@ jobs:
269275
version: ${{ env.DOCKER_BUILDX_VERSION }}
270276
install: true
271277

272-
- name: Log in to the Container registry
273-
uses: docker/login-action@v3
274-
with:
275-
registry: ghcr.io
276-
username: ${{ github.actor }}
277-
password: ${{ secrets.GITHUB_TOKEN }}
278-
279278
- name: Login to Upbound
280279
uses: docker/login-action@v3
281280
if: env.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR != ''
@@ -327,7 +326,7 @@ jobs:
327326

328327
- name: Build Artifacts
329328
if: steps.semantic.outputs.new_release_published == 'true'
330-
run: make -j2 build.all
329+
run: make -j2 XPKG_REG_ORGS="${{ env.UPBOUND_REGORG }}" XPKG_REG_ORGS_NO_PROMOTE="${{ env.UPBOUND_REGORG }}" BRANCH_NAME="main" VERSION="${{ steps.version.outputs.VERSION }}" build.all
331330
env:
332331
# We're using docker buildx, which doesn't actually load the images it
333332
# builds by default. Specifying --load does so.
@@ -343,12 +342,98 @@ jobs:
343342
- name: Publish Artifacts to Upbound
344343
if: github.ref == 'refs/heads/main' && env.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR != '' && steps.semantic.outputs.new_release_published == 'true'
345344
run: make publish CHANNEL=main VERSION=v${{ steps.semantic.outputs.new_release_version }}
346-
347-
- name: Publish Artifacts to Github
348-
if: steps.semantic.outputs.new_release_published == 'true'
349-
run: |
350-
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${GITHUB_ACTOR} --password-stdin
351-
image_name=$(docker images | awk '{print $1}' | awk 'NR==2')
352-
docker image tag ${image_name}:latest ghcr.io/glalanne/provider-databricks:latest
353-
docker push ghcr.io/glalanne/provider-databricks:latest
354345

346+
publish-gcr-artifacts:
347+
runs-on: ubuntu-24.04
348+
outputs:
349+
version: ${{ steps.version.outputs.VERSION }}
350+
permissions:
351+
contents: read
352+
packages: write
353+
attestations: write
354+
id-token: write
355+
needs:
356+
- detect-noop
357+
- report-breaking-changes
358+
- lint
359+
- check-diff
360+
- unit-tests
361+
- local-deploy
362+
if: needs.detect-noop.outputs.noop != 'true' && github.ref != 'refs/heads/main'
363+
steps:
364+
- name: Setup QEMU
365+
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3
366+
with:
367+
platforms: all
368+
369+
- name: Setup Docker Buildx
370+
uses: docker/setup-buildx-action@v3
371+
with:
372+
version: ${{ env.DOCKER_BUILDX_VERSION }}
373+
install: true
374+
375+
- name: Log in to the Container registry
376+
uses: docker/login-action@v3
377+
with:
378+
registry: ghcr.io
379+
username: ${{ github.actor }}
380+
password: ${{ secrets.GITHUB_TOKEN }}
381+
382+
- name: Checkout
383+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
384+
with:
385+
submodules: true
386+
persist-credentials: false
387+
388+
- name: Fetch History
389+
run: git fetch --prune
390+
391+
- name: Setup Go
392+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
393+
with:
394+
go-version: ${{ env.GO_VERSION }}
395+
396+
- name: Find the Go Build Cache
397+
id: go
398+
run: echo "cache=$(make go.cachedir)" >> $GITHUB_OUTPUT
399+
400+
- name: Find the version
401+
id: version
402+
run: make common.buildvars >> $GITHUB_OUTPUT
403+
404+
- name: Cache the Go Build Cache
405+
uses: actions/cache@v4
406+
with:
407+
path: ${{ steps.go.outputs.cache }}
408+
key: ${{ runner.os }}-build-publish-artifacts-${{ hashFiles('**/go.sum') }}
409+
restore-keys: ${{ runner.os }}-build-publish-artifacts-
410+
411+
- name: Cache Go Dependencies
412+
uses: actions/cache@v4
413+
with:
414+
path: .work/pkg
415+
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
416+
restore-keys: ${{ runner.os }}-pkg-
417+
418+
- name: Vendor Dependencies
419+
run: make vendor vendor.check
420+
421+
- name: Build Artifacts
422+
run: |-
423+
make -j2 XPKG_REG_ORGS="${{ env.CROSSPLANE_REGORG }}" XPKG_REG_ORGS_NO_PROMOTE="${{ env.CROSSPLANE_REGORG }}" BRANCH_NAME="main" VERSION="${{ steps.version.outputs.VERSION }}" build.all
424+
env:
425+
# We're using docker buildx, which doesn't actually load the images it
426+
# builds by default. Specifying --load does so.
427+
BUILD_ARGS: "--load"
428+
429+
- name: Upload Artifacts to GitHub
430+
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4
431+
with:
432+
name: output
433+
path: _output/**
434+
435+
- name: Publish Artifacts
436+
run: |-
437+
make -j2 XPKG_REG_ORGS="${{ env.CROSSPLANE_REGORG }}" XPKG_REG_ORGS_NO_PROMOTE="${{ env.CROSSPLANE_REGORG }}" BRANCH_NAME="main" VERSION="${{ steps.version.outputs.VERSION }}" publish
438+
439+

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
permissions:
1212
contents: write
1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v5
1515
- run: ./hack/merge-crds.sh
1616
- uses: ncipollo/release-action@v1
1717
with:

.github/workflows/tag.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2020

2121
- name: Create Tag
2222
uses: negz/create-tag@39bae1e0932567a58c20dea5a1a0d18358503320 # v1

.golangci.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44

55
run:
66
timeout: 90m
7-
concurrency: 1
7+
# concurrency: 1
88

99
output:
1010
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
1111
formats:
1212
- format: colored-line-number
1313
print-linter-name: true
14-
show-stats: true
1514

1615
linters-settings:
1716
errcheck:
@@ -28,10 +27,6 @@ linters-settings:
2827
- io/ioutil.ReadDir
2928
- io/ioutil.ReadAll
3029

31-
govet:
32-
# report about shadowed variables
33-
check-shadowing: false
34-
3530
revive:
3631
# confidence for issues, default is 0.8
3732
confidence: 0.8
@@ -43,7 +38,7 @@ linters-settings:
4338
goimports:
4439
# put imports beginning with prefix after 3rd-party packages;
4540
# it's a comma-separated list of prefixes
46-
local-prefixes: github.com/glalanne/provider-databricks
41+
local-prefixes: github.com/upbound/provider-azure
4742

4843
gocyclo:
4944
# minimal code complexity to report, 30 by default (but we recommend 10-20)
@@ -119,8 +114,15 @@ linters:
119114
fast: false
120115

121116
issues:
117+
exclude-files:
118+
- "zz_.*go$"
122119
# Excluding configuration per-path and per-linter
123120
exclude-rules:
121+
# some group names we have (like "hdinsight") make this linter
122+
# unhappy, so just disable the "misspell" linter on generated files.
123+
- path: zz_.+\.go$
124+
linters:
125+
- misspell
124126
# Exclude some linters from running on tests files.
125127
- path: _test(ing)?\.go
126128
linters:

0 commit comments

Comments
 (0)