Skip to content

Commit 1169e33

Browse files
authored
Merge pull request #1 from PDOK/PDOK-17553-Atom-crd_converter-v2-v3
Pdok 17553 atom crd converter v2 v3
2 parents aee6788 + 4d1772a commit 1169e33

36 files changed

+2739
-201
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
name: build
3+
env:
4+
image: pdok/atom-operator
5+
on:
6+
push:
7+
tags:
8+
- '*'
9+
jobs:
10+
docker:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Docker meta
14+
id: docker_meta
15+
uses: docker/metadata-action@v3
16+
with:
17+
images: ${{ env.image }}
18+
tags: |
19+
type=semver,pattern={{major}}
20+
type=semver,pattern={{major}}.{{minor}}
21+
type=semver,pattern={{version}}
22+
- name: Login to PDOK Docker Hub
23+
if: startsWith(env.image, 'pdok/')
24+
uses: docker/login-action@v1
25+
with:
26+
username: koalapdok
27+
password: ${{ secrets.DOCKERHUB_PUSH }}
28+
- name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@v1
30+
- name: Cache Docker layers
31+
uses: actions/cache@v3
32+
with:
33+
path: /tmp/.buildx-cache
34+
key: ${{ runner.os }}-buildx-${{ github.sha }}
35+
restore-keys: |
36+
${{ runner.os }}-buildx-
37+
- name: Build and push
38+
id: docker_build
39+
uses: docker/build-push-action@v2
40+
with:
41+
push: true
42+
tags: ${{ steps.docker_meta.outputs.tags }}
43+
labels: ${{ steps.docker_meta.outputs.labels }}
44+
cache-from: type=local,src=/tmp/.buildx-cache
45+
cache-to: type=local,dest=/tmp/.buildx-cache-new
46+
- # Temp fix to cleanup cache
47+
# https://github.com/docker/build-push-action/issues/252
48+
# https://github.com/moby/buildkit/issues/1896
49+
name: Move cache
50+
run: |
51+
rm -rf /tmp/.buildx-cache
52+
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
53+
- name: Build result notification
54+
if: success() || failure()
55+
uses: 8398a7/action-slack@v3
56+
with:
57+
fields: all
58+
status: custom
59+
custom_payload: |
60+
{
61+
attachments: [{
62+
color: '${{ job.status }}' === 'success' ? 'good' : '${{ job.status }}' === 'failure' ? 'danger' : 'warning',
63+
text: `${process.env.AS_WORKFLOW} ${{ job.status }} for ${process.env.AS_REPO}!\n${process.env.AS_JOB} job on ${process.env.AS_REF} (commit: ${process.env.AS_COMMIT}, version: ${{ steps.docker_meta.outputs.version }}) by ${process.env.AS_AUTHOR} took ${process.env.AS_TOOK}`,
64+
}]
65+
}
66+
env:
67+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ help: ## Display this help.
4343

4444
.PHONY: manifests
4545
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
46-
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
46+
$(CONTROLLER_GEN) rbac:roleName=manager-role crd:allowDangerousTypes=true webhook paths="./..." output:crd:artifacts:config=config/crd/bases
4747

4848
.PHONY: generate
4949
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.

PROJECT

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,16 @@ resources:
1616
kind: Atom
1717
path: github.com/pdok/atom-operator/api/v3
1818
version: v3
19+
webhooks:
20+
conversion: true
21+
spoke:
22+
- v2beta1
23+
webhookVersion: v1
24+
- api:
25+
crdVersion: v1
26+
namespaced: true
27+
domain: pdok.nl
28+
kind: Atom
29+
path: github.com/pdok/atom-operator/api/v2beta1
30+
version: v2beta1
1931
version: "3"

0 commit comments

Comments
 (0)