Skip to content

Commit 13277b4

Browse files
Duologicclaude
andcommitted
feat: add crossplane provider-upjet-gcp
- Created separate library for crossplane-provider-upjet-gcp - Moved GCP provider (v2.4.0) out of main crossplane library - Added auto-version update via Makefile - Generated GitHub workflow for automated builds Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent a77df79 commit 13277b4

8 files changed

Lines changed: 892 additions & 384 deletions

File tree

.github/workflows/main.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,6 +1091,46 @@
10911091
"SSH_KEY": "${{ secrets.DEPLOY_KEY }}"
10921092
"if": "steps.filter.outputs.workflows == 'true'"
10931093
"run": "make libs/crossplane-provider-upjet-azure"
1094+
"crossplane-provider-upjet-gcp":
1095+
"name": "Generate crossplane-provider-upjet-gcp Jsonnet library and docs"
1096+
"needs":
1097+
- "build"
1098+
- "repos"
1099+
"runs-on": "ubuntu-latest"
1100+
"steps":
1101+
- "uses": "actions/checkout@v4"
1102+
- "id": "filter"
1103+
"uses": "dorny/paths-filter@v3"
1104+
"with":
1105+
"filters": |
1106+
workflows:
1107+
- '.github/**'
1108+
- 'bin/**'
1109+
- 'Dockerfile'
1110+
- 'go.mod'
1111+
- 'go.sum'
1112+
- 'jsonnet/**'
1113+
- 'main.go'
1114+
- 'Makefile'
1115+
- 'pkg/**'
1116+
- 'scripts/**'
1117+
- 'tf/**'
1118+
- 'libs/crossplane-provider-upjet-gcp/**'
1119+
- "if": "steps.filter.outputs.workflows == 'true'"
1120+
"uses": "actions/download-artifact@v4"
1121+
"with":
1122+
"name": "docker-artifact"
1123+
"path": "artifacts"
1124+
- "if": "steps.filter.outputs.workflows == 'true'"
1125+
"run": "make load"
1126+
- "env":
1127+
"DIFF": "true"
1128+
"GEN_COMMIT": "${{ github.ref == 'refs/heads/master' && github.repository == 'jsonnet-libs/k8s' }}"
1129+
"GIT_COMMITTER_EMAIL": "86770550+jsonnet-libs-bot@users.noreply.github.com"
1130+
"GIT_COMMITTER_NAME": "jsonnet-libs-bot"
1131+
"SSH_KEY": "${{ secrets.DEPLOY_KEY }}"
1132+
"if": "steps.filter.outputs.workflows == 'true'"
1133+
"run": "make libs/crossplane-provider-upjet-gcp"
10941134
"dapr":
10951135
"name": "Generate dapr Jsonnet library and docs"
10961136
"needs":
@@ -2925,6 +2965,7 @@
29252965
- "crossplane-core"
29262966
- "crossplane-provider-upjet-aws"
29272967
- "crossplane-provider-upjet-azure"
2968+
- "crossplane-provider-upjet-gcp"
29282969
- "dapr"
29292970
- "datadog-operator"
29302971
- "eck-operator"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
2+
TMP:=$(shell mktemp -d)
3+
4+
all: update-version crds.libsonnet
5+
6+
.PHONY: update-version
7+
update-version:
8+
@NEW_VERSION=$$(gh release view --repo crossplane-contrib/provider-upjet-gcp --json tagName --jq '.tagName'); \
9+
if [ ! -f version ] || [ "$$(cat version)" != "$$NEW_VERSION" ]; then \
10+
echo "$$NEW_VERSION" > version; \
11+
echo "Updated version to $$NEW_VERSION"; \
12+
else \
13+
echo "Version unchanged: $$NEW_VERSION"; \
14+
fi
15+
16+
crds.libsonnet: version
17+
cd $(TMP) && \
18+
jb init && \
19+
jb install github.com/crossplane-contrib/provider-upjet-gcp/package/crds@$(shell cat version) && \
20+
echo '[' > $(ROOT_DIR)/crds.libsonnet && \
21+
cd vendor/github.com/crossplane-contrib/provider-upjet-gcp/package/crds && \
22+
find . -type f -printf "%f\n" | sort | xargs -I {} echo "'{}'," >> $(ROOT_DIR)/crds.libsonnet && \
23+
echo ']' >> $(ROOT_DIR)/crds.libsonnet && \
24+
jsonnetfmt -i $(ROOT_DIR)/crds.libsonnet && \
25+
rm -rf $(TMP) || \
26+
rm -rf $(TMP)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
local config = import 'jsonnet/config.jsonnet';
2+
3+
// Run `make` to get the latest version and regenerate `crds.libsonnet`
4+
local version = std.stripChars(importstr './version', ' \n');
5+
local crds = import './crds.libsonnet';
6+
7+
config.new(
8+
name='crossplane-provider-upjet-gcp',
9+
specs=[
10+
{
11+
output: 'upbound-provider-gcp/namespaced',
12+
prefix: '^io\\.upbound\\.m\\.gcp\\..*',
13+
crds: ['https://raw.githubusercontent.com/crossplane-contrib/provider-upjet-gcp/%s/package/crds/%s' % [version, crd] for crd in crds],
14+
localName: 'gcp',
15+
},
16+
{
17+
output: 'upbound-provider-gcp/cluster',
18+
prefix: '^io\\.upbound\\.gcp\\..*',
19+
crds: ['https://raw.githubusercontent.com/crossplane-contrib/provider-upjet-gcp/%s/package/crds/%s' % [version, crd] for crd in crds],
20+
localName: 'gcp',
21+
},
22+
],
23+
)

libs/crossplane-provider-upjet-gcp/crds.libsonnet

Lines changed: 801 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v2.4.0

libs/crossplane/Makefile

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,2 @@
11
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
22
TMP:=$(shell mktemp -d)
3-
4-
GCP_VERSION?=v1.8.3
5-
6-
.PHONY: upbound_gcp_crds.libsonnet
7-
upbound_gcp_crds.libsonnet:
8-
cd $(TMP) && \
9-
jb init && \
10-
jb install github.com/crossplane-contrib/provider-upjet-gcp/package/crds@$(GCP_VERSION) && \
11-
echo '[' > $(ROOT_DIR)/upbound_gcp_crds.libsonnet && \
12-
cd vendor/github.com/crossplane-contrib/provider-upjet-gcp/package/crds && \
13-
find . -type f -printf "%f\n" | sort | xargs -I {} echo "'{}'," >> $(ROOT_DIR)/upbound_gcp_crds.libsonnet && \
14-
echo ']' >> $(ROOT_DIR)/upbound_gcp_crds.libsonnet && \
15-
jsonnetfmt -i $(ROOT_DIR)/upbound_gcp_crds.libsonnet && \
16-
rm -rf $(TMP) || \
17-
rm -rf $(TMP)

libs/crossplane/config.jsonnet

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
local config = import 'jsonnet/config.jsonnet';
22

3-
local upbound_gcp_crds = import './upbound_gcp_crds.libsonnet';
4-
53
config.new(
64
name='crossplane',
75
specs=[
@@ -71,14 +69,6 @@ config.new(
7169
crds: ['https://doc.crds.dev/raw/github.com/upbound/provider-azuread@v0.11.0'],
7270
localName: 'upbound_azuread',
7371
},
74-
// WARNING: When bumping the version, ensure that you also update the
75-
// version in the Makefile and run `make upbound_gcp_crds.libsonnet` to update the CRDs list.
76-
{
77-
output: 'upbound-provider-gcp/1.8',
78-
prefix: '^io\\.upbound\\.gcp\\..*',
79-
crds: ['https://raw.githubusercontent.com/crossplane-contrib/provider-upjet-gcp/v1.8.3/package/crds/%s' % crd for crd in upbound_gcp_crds],
80-
localName: 'upbound_gcp',
81-
},
8272
{
8373
output: 'provider-terraform/0.10',
8474
prefix: '^io\\.upbound\\.tf\\..*',

0 commit comments

Comments
 (0)