Skip to content
This repository was archived by the owner on Jul 31, 2026. It is now read-only.

Commit 078238a

Browse files
authored
Merge pull request #7 from sboschman/upgrades
Update Terrajet
2 parents 94635c3 + 0ea8dd4 commit 078238a

298 files changed

Lines changed: 11759 additions & 10717 deletions

File tree

Some content is hidden

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

.github/ISSUE_TEMPLATE/new_resource_request.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ Help us for prioritization of the resource support by giving more details about
2323
why you need it.
2424
-->
2525

26-
### Would you be willing to contribute it using [Terrajet](https://github.com/crossplane-contrib/terrajet)?
26+
### Would you be willing to contribute it using [Terrajet](https://github.com/crossplane/terrajet)?
2727

2828
<!--
2929
Please take a look at code generator instructions to see whether you'd like to
3030
contribute the missing parts where Terrajet cannot automate. See
31-
https://github.com/crossplane-contrib/terrajet#readme
31+
https://github.com/crossplane/terrajet#readme
3232
-->

.github/workflows/ci.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
env:
1212
# Common versions
13-
GO_VERSION: '1.16'
13+
GO_VERSION: '1.18'
1414
GOLANGCI_VERSION: 'v1.31'
1515
DOCKER_BUILDX_VERSION: 'v0.4.2'
1616

@@ -78,7 +78,7 @@ jobs:
7878
# prefer this action because it leaves 'annotations' (i.e. it comments
7979
# on PRs to point out linter violations).
8080
- name: Lint
81-
uses: golangci/golangci-lint-action@v2
81+
uses: golangci/golangci-lint-action@v3
8282
with:
8383
version: ${{ env.GOLANGCI_VERSION }}
8484
skip-go-installation: true
@@ -295,28 +295,28 @@ jobs:
295295
# We're using docker buildx, which doesn't actually load the images it
296296
# builds by default. Specifying --load does so.
297297
BUILD_ARGS: "--load"
298-
298+
299299
- name: Publish Artifacts to GitHub
300300
uses: actions/upload-artifact@v2
301301
with:
302302
name: output
303303
path: _output/**
304-
304+
305305
- name: Login to Docker
306306
uses: docker/login-action@v1
307307
if: env.DOCKER_USR != ''
308308
with:
309309
username: ${{ secrets.DOCKER_USR }}
310310
password: ${{ secrets.DOCKER_PSW }}
311-
311+
312312
- name: Publish Artifacts to S3 and Docker Hub
313313
run: make -j2 publish BRANCH_NAME=${GITHUB_REF##*/}
314314
if: env.AWS_USR != '' && env.DOCKER_USR != ''
315315
env:
316316
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_USR }}
317317
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_PSW }}
318318
GIT_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
319-
319+
320320
- name: Promote Artifacts in S3 and Docker Hub
321321
if: github.ref == 'refs/heads/main' && env.AWS_USR != '' && env.DOCKER_USR != ''
322322
run: make -j2 promote
@@ -325,3 +325,4 @@ jobs:
325325
CHANNEL: main
326326
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_USR }}
327327
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_PSW }}
328+

Makefile

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
PROJECT_NAME := provider-jet-rancher
55
PROJECT_REPO := github.com/crossplane-contrib/$(PROJECT_NAME)
66

7-
export TERRAFORM_VERSION := 1.0.11
7+
export TERRAFORM_VERSION := 1.1.6
8+
89
export TERRAFORM_PROVIDER_SOURCE := rancher/rancher2
9-
export TERRAFORM_PROVIDER_VERSION := 1.22.2
10+
export TERRAFORM_PROVIDER_VERSION := 1.24.0
1011
export TERRAFORM_PROVIDER_DOWNLOAD_NAME := terraform-provider-rancher2
1112
export TERRAFORM_PROVIDER_DOWNLOAD_URL_PREFIX := https://github.com/rancher/terraform-provider-rancher2/releases/download/v$(TERRAFORM_PROVIDER_VERSION)
1213

@@ -54,7 +55,7 @@ IMAGES = provider-jet-rancher provider-jet-rancher-controller
5455
-include build/makelib/image.mk
5556

5657
# ====================================================================================
57-
# Targets
58+
# Fallthrough
5859

5960
# run `make help` to see the targets and options
6061

@@ -67,6 +68,35 @@ fallthrough: submodules
6768
@echo Initial setup complete. Running make again . . .
6869
@make
6970

71+
# ====================================================================================
72+
# Setup Terraform for fetching provider schema
73+
TERRAFORM := $(TOOLS_HOST_DIR)/terraform-$(TERRAFORM_VERSION)
74+
TERRAFORM_WORKDIR := $(WORK_DIR)/terraform
75+
TERRAFORM_PROVIDER_SCHEMA := config/schema.json
76+
77+
$(TERRAFORM):
78+
@$(INFO) installing terraform $(HOSTOS)-$(HOSTARCH)
79+
@mkdir -p $(TOOLS_HOST_DIR)/tmp-terraform
80+
@curl -fsSL https://releases.hashicorp.com/terraform/$(TERRAFORM_VERSION)/terraform_$(TERRAFORM_VERSION)_$(SAFEHOST_PLATFORM).zip -o $(TOOLS_HOST_DIR)/tmp-terraform/terraform.zip
81+
@unzip $(TOOLS_HOST_DIR)/tmp-terraform/terraform.zip -d $(TOOLS_HOST_DIR)/tmp-terraform
82+
@mv $(TOOLS_HOST_DIR)/tmp-terraform/terraform $(TERRAFORM)
83+
@rm -fr $(TOOLS_HOST_DIR)/tmp-terraform
84+
@$(OK) installing terraform $(HOSTOS)-$(HOSTARCH)
85+
86+
$(TERRAFORM_PROVIDER_SCHEMA): $(TERRAFORM)
87+
@$(INFO) generating provider schema for $(TERRAFORM_PROVIDER_SOURCE) $(TERRAFORM_PROVIDER_VERSION)
88+
@mkdir -p $(TERRAFORM_WORKDIR)
89+
@echo '{"terraform":[{"required_providers":[{"provider":{"source":"'"$(TERRAFORM_PROVIDER_SOURCE)"'","version":"'"$(TERRAFORM_PROVIDER_VERSION)"'"}}],"required_version":"'"$(TERRAFORM_VERSION)"'"}]}' > $(TERRAFORM_WORKDIR)/main.tf.json
90+
@$(TERRAFORM) -chdir=$(TERRAFORM_WORKDIR) init > $(TERRAFORM_WORKDIR)/terraform-logs.txt 2>&1
91+
@$(TERRAFORM) -chdir=$(TERRAFORM_WORKDIR) providers schema -json=true > $(TERRAFORM_PROVIDER_SCHEMA) 2>> $(TERRAFORM_WORKDIR)/terraform-logs.txt
92+
@$(OK) generating provider schema for $(TERRAFORM_PROVIDER_SOURCE) $(TERRAFORM_PROVIDER_VERSION)
93+
94+
generate.init: $(TERRAFORM_PROVIDER_SCHEMA)
95+
96+
.PHONY: $(TERRAFORM_PROVIDER_SCHEMA)
97+
# ====================================================================================
98+
# Targets
99+
70100
# NOTE: the build submodule currently overrides XDG_CACHE_HOME in order to
71101
# force the Helm 3 to use the .work/helm directory. This causes Go on Linux
72102
# machines to use that directory as the build cache as well. We should adjust
@@ -83,14 +113,6 @@ cobertura:
83113
grep -v zz_ | \
84114
$(GOCOVER_COBERTURA) > $(GO_TEST_OUTPUT)/cobertura-coverage.xml
85115

86-
crds.clean:
87-
@$(INFO) cleaning generated CRDs
88-
@find package/crds -name '*.yaml' -exec sed -i.sed -e '1,2d' {} \; || $(FAIL)
89-
@find package/crds -name '*.yaml.sed' -delete || $(FAIL)
90-
@$(OK) cleaned generated CRDs
91-
92-
generate.done: crds.clean
93-
94116
# Update the submodules, such as the common build scripts.
95117
submodules:
96118
@git submodule sync

README.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Terrajet Rancher Provider
22

33
`provider-jet-rancher` is a [Crossplane](https://crossplane.io/) provider that
4-
is built using [Terrajet](https://github.com/crossplane-contrib/terrajet) code
5-
generation tools and exposes XRM-conformant managed resources for the
4+
is built using [Terrajet](https://github.com/crossplane/terrajet) code
5+
generation tools and exposes XRM-conformant managed resources for the
66
Rancher API.
77

88
## Getting Started
@@ -13,13 +13,26 @@ to the [latest release](https://github.com/crossplane-contrib/provider-jet-ranch
1313
kubectl crossplane install provider crossplane/provider-jet-rancher:v0.1.0
1414
```
1515

16+
Alternatively, you can use declarative installation:
17+
```
18+
kubectl apply -f examples/install.yaml
19+
```
20+
21+
Notice that in this example Provider resource is referencing ControllerConfig with debug enabled.
22+
1623
You can see the API reference [here](https://doc.crds.dev/github.com/crossplane-contrib/provider-jet-rancher).
1724

1825
## Developing
1926

20-
Run code-generation pipeline:
27+
Clone this repository and cd into the repository directory. Fetch the upbound/build submodule by running the following:
28+
2129
```console
22-
go run cmd/generator/main.go
30+
make submodules
31+
```
32+
33+
Run code-generation pipeline:
34+
```
35+
make generate
2336
```
2437

2538
Run against a Kubernetes cluster:
@@ -34,18 +47,6 @@ Build, push, and install:
3447
make all
3548
```
3649

37-
Build image:
38-
39-
```console
40-
make image
41-
```
42-
43-
Push image:
44-
45-
```console
46-
make push
47-
```
48-
4950
Build binary:
5051

5152
```console

apis/app/v1alpha1/zz_generated.deepcopy.go

Lines changed: 21 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/app/v1alpha1/zz_generated.managed.go

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

apis/app/v1alpha1/zz_v2_types.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/auth/v1alpha1/zz_configactivedirectory_terraformed.go

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

0 commit comments

Comments
 (0)