Skip to content

Commit

Permalink
Merge pull request #5 from crossplane-contrib/jet-equinix-tf1.8.0
Browse files Browse the repository at this point in the history
Rename to Jet, update to Equinix TF 1.8.0
  • Loading branch information
displague authored Sep 19, 2022
2 parents 4575da7 + 4207b01 commit 4a341c9
Show file tree
Hide file tree
Showing 156 changed files with 20,948 additions and 2,251 deletions.
9 changes: 5 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
name: Bug Report
about: Help us diagnose and fix bugs in Crossplane
about: Help us diagnose and fix bugs in Equinix Provider.
labels: bug
---
<!--
Thank you for helping to improve Crossplane!
Thank you for helping to improve Equinix Provider!
Please be sure to search for open issues before raising a new one. We use issues
for bug reports and feature requests. Please find us at https://slack.crossplane.io
Expand All @@ -13,7 +13,7 @@ for questions, support, and discussion.

### What happened?
<!--
Please let us know what behaviour you expected and how Crossplane diverged from
Please let us know what behaviour you expected and how Equinix Provider diverged from
that behaviour.
-->

Expand All @@ -27,9 +27,10 @@ appreciated!

### What environment did it happen in?
Crossplane version:
Provider version:

<!--
Include at least the version or commit of Crossplane you were running. Consider
Include at least the version or commit you were running. Consider
also including your:
* Cloud provider or hardware configuration
Expand Down
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
name: Feature Request
about: Help us make Crossplane more useful
about: Help us make Equinix Provider more useful
labels: enhancement
---
<!--
Thank you for helping to improve Crossplane!
Thank you for helping to improve Equinix Provider!
Please be sure to search for open issues before raising a new one. We use issues
for bug reports and feature requests. Please find us at https://slack.crossplane.io
Expand All @@ -18,7 +18,7 @@ Leading with this context helps frame the feature request so we can ensure we
implement it sensibly.
--->

### How could Crossplane help solve your problem?
### How could Equinix Provider help solve your problem?
<!--
Let us know how you think Crossplane could help with your use case.
Let us know how you think Equinix Provider could help with your use case.
-->
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/new_resource_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,11 @@ Please let us know the name of the resource you need.
Help us for prioritization of the resource support by giving more details about
why you need it.
-->

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

<!--
Please take a look at code generator instructions to see whether you'd like to
contribute the missing parts where Terrajet cannot automate. See
https://github.com/crossplane/terrajet#readme
-->
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
env:
# Common versions
GO_VERSION: '1.17'
GOLANGCI_VERSION: 'v1.39'
GOLANGCI_VERSION: 'v1.31'
DOCKER_BUILDX_VERSION: 'v0.4.2'

# Common users. We can't run a step 'if secrets.AWS_USR != ""' but we can run
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:

- name: Find the Go Build Cache
id: go
run: echo "::set-output name=cache::$(go env GOCACHE)"
run: echo "::set-output name=cache::$(make go.cachedir)"

- name: Cache the Go Build Cache
uses: actions/cache@v2
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
# prefer this action because it leaves 'annotations' (i.e. it comments
# on PRs to point out linter violations).
- name: Lint
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v3
with:
version: ${{ env.GOLANGCI_VERSION }}
skip-go-installation: true
Expand All @@ -105,7 +105,7 @@ jobs:

- name: Find the Go Build Cache
id: go
run: echo "::set-output name=cache::$(go env GOCACHE)"
run: echo "::set-output name=cache::$(make go.cachedir)"

- name: Cache the Go Build Cache
uses: actions/cache@v2
Expand Down Expand Up @@ -148,7 +148,7 @@ jobs:

- name: Find the Go Build Cache
id: go
run: echo "::set-output name=cache::$(go env GOCACHE)"
run: echo "::set-output name=cache::$(make go.cachedir)"

- name: Cache the Go Build Cache
uses: actions/cache@v2
Expand Down Expand Up @@ -208,7 +208,7 @@ jobs:

- name: Find the Go Build Cache
id: go
run: echo "::set-output name=cache::$(go env GOCACHE)"
run: echo "::set-output name=cache::$(make go.cachedir)"

- name: Cache the Go Build Cache
uses: actions/cache@v2
Expand Down Expand Up @@ -270,7 +270,7 @@ jobs:

- name: Find the Go Build Cache
id: go
run: echo "::set-output name=cache::$(go env GOCACHE)"
run: echo "::set-output name=cache::$(make go.cachedir)"

- name: Cache the Go Build Cache
uses: actions/cache@v2
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ linters-settings:
goimports:
# put imports beginning with prefix after 3rd-party packages;
# it's a comma-separated list of prefixes
local-prefixes: github.com/crossplane-contrib/provider-tf-equinix
local-prefixes: github.com/crossplane-contrib/provider-jet-template

gocyclo:
# minimal code complexity to report, 30 by default (but we recommend 10-20)
Expand Down
65 changes: 49 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# ====================================================================================
# Setup Project

PROJECT_NAME := provider-tf-equinix
PROJECT_NAME := provider-jet-equinix
PROJECT_REPO := github.com/crossplane-contrib/$(PROJECT_NAME)
GOLANGCILINT_VERSION ?= 1.48.0

export TERRAFORM_VERSION := 1.2.9

export TERRAFORM_VERSION := 1.0.11
export TERRAFORM_PROVIDER_SOURCE := equinix/equinix
export TERRAFORM_PROVIDER_VERSION := 1.3.0
export TERRAFORM_PROVIDER_VERSION := 1.9.0
export TERRAFORM_PROVIDER_DOWNLOAD_NAME := terraform-provider-equinix
export TERRAFORM_PROVIDER_DOWNLOAD_URL_PREFIX := https://releases.hashicorp.com/terraform-provider-equinix/1.3.0
export TERRAFORM_PROVIDER_DOWNLOAD_URL_PREFIX := https://releases.hashicorp.com/terraform-provider-equinix/1.9.0
#export TERRAFORM_NATIVE_PROVIDER_BINARY := terraform-provider-null_v3.1.0_x5

PLATFORMS ?= linux_amd64 linux_arm64

Expand All @@ -35,7 +38,7 @@ NPROCS ?= 1
# to half the number of CPU cores.
GO_TEST_PARALLEL := $(shell echo $$(( $(NPROCS) / 2 )))

GO_STATIC_PACKAGES = $(GO_PROJECT)/cmd/provider $(GO_PROJECT)/cmd/generator
GO_STATIC_PACKAGES = $(GO_PROJECT)/cmd/provider
GO_LDFLAGS += -X $(GO_PROJECT)/internal/version.Version=$(VERSION)
GO_SUBDIRS += cmd internal apis
GO111MODULE = on
Expand All @@ -49,12 +52,12 @@ GO111MODULE = on
# ====================================================================================
# Setup Images

DOCKER_REGISTRY := crossplane
IMAGES = provider-tf-equinix provider-tf-equinix-controller
DOCKER_REGISTRY ?= crossplane
IMAGES = provider-jet-equinix provider-jet-equinix-controller
-include build/makelib/image.mk

# ====================================================================================
# Targets
# Fallthrough

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

Expand All @@ -67,21 +70,51 @@ fallthrough: submodules
@echo Initial setup complete. Running make again . . .
@make

# ====================================================================================
# Setup Terraform for fetching provider schema
TERRAFORM := $(TOOLS_HOST_DIR)/terraform-$(TERRAFORM_VERSION)
TERRAFORM_WORKDIR := $(WORK_DIR)/terraform
TERRAFORM_PROVIDER_SCHEMA := config/schema.json

$(TERRAFORM):
@$(INFO) installing terraform $(HOSTOS)-$(HOSTARCH)
@mkdir -p $(TOOLS_HOST_DIR)/tmp-terraform
@curl -fsSL https://releases.hashicorp.com/terraform/$(TERRAFORM_VERSION)/terraform_$(TERRAFORM_VERSION)_$(SAFEHOST_PLATFORM).zip -o $(TOOLS_HOST_DIR)/tmp-terraform/terraform.zip
@unzip $(TOOLS_HOST_DIR)/tmp-terraform/terraform.zip -d $(TOOLS_HOST_DIR)/tmp-terraform
@mv $(TOOLS_HOST_DIR)/tmp-terraform/terraform $(TERRAFORM)
@rm -fr $(TOOLS_HOST_DIR)/tmp-terraform
@$(OK) installing terraform $(HOSTOS)-$(HOSTARCH)

$(TERRAFORM_PROVIDER_SCHEMA): $(TERRAFORM)
@$(INFO) generating provider schema for $(TERRAFORM_PROVIDER_SOURCE) $(TERRAFORM_PROVIDER_VERSION)
@mkdir -p $(TERRAFORM_WORKDIR)
@echo '{"terraform":[{"required_providers":[{"provider":{"source":"'"$(TERRAFORM_PROVIDER_SOURCE)"'","version":"'"$(TERRAFORM_PROVIDER_VERSION)"'"}}],"required_version":"'"$(TERRAFORM_VERSION)"'"}]}' > $(TERRAFORM_WORKDIR)/main.tf.json
@$(TERRAFORM) -chdir=$(TERRAFORM_WORKDIR) init > $(TERRAFORM_WORKDIR)/terraform-logs.txt 2>&1
@$(TERRAFORM) -chdir=$(TERRAFORM_WORKDIR) providers schema -json=true > $(TERRAFORM_PROVIDER_SCHEMA) 2>> $(TERRAFORM_WORKDIR)/terraform-logs.txt
@$(OK) generating provider schema for $(TERRAFORM_PROVIDER_SOURCE) $(TERRAFORM_PROVIDER_VERSION)

generate.init: $(TERRAFORM_PROVIDER_SCHEMA)

.PHONY: $(TERRAFORM_PROVIDER_SCHEMA)
# ====================================================================================
# Targets

# NOTE: the build submodule currently overrides XDG_CACHE_HOME in order to
# force the Helm 3 to use the .work/helm directory. This causes Go on Linux
# machines to use that directory as the build cache as well. We should adjust
# this behavior in the build submodule because it is also causing Linux users
# to duplicate their build cache, but for now we just make it easier to identify
# its location in CI so that we cache between builds.
go.cachedir:
@go env GOCACHE

# Generate a coverage report for cobertura applying exclusions on
# - generated file
cobertura:
@cat $(GO_TEST_OUTPUT)/coverage.txt | \
grep -v zz_ | \
$(GOCOVER_COBERTURA) > $(GO_TEST_OUTPUT)/cobertura-coverage.xml

crds.clean:
@$(INFO) cleaning generated CRDs
@find package/crds -name '*.yaml' -exec sed -i.sed -e '1,2d' {} \; || $(FAIL)
@find package/crds -name '*.yaml.sed' -delete || $(FAIL)
@$(OK) cleaned generated CRDs

generate.done: crds.clean

# Update the submodules, such as the common build scripts.
submodules:
@git submodule sync
Expand Down
41 changes: 18 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
# Terrajet Equinix Provider

`provider-tf-equinix` is a [Crossplane](https://crossplane.io/) provider that
is built using [Terrajet](https://github.com/crossplane-contrib/terrajet) code
generation tools and exposes XRM-conformant managed resources for the
`provider-jet-equinix` is a [Crossplane](https://crossplane.io/) provider that
is built using [Terrajet](https://github.com/crossplane/terrajet) code
generation tools and exposes XRM-conformant managed resources for the
Equinix API.

## Getting Started

Install the provider by using the following command after changing the image tag
to the [latest release](https://github.com/crossplane-contrib/provider-tf-equinix/releases):
to the [latest release](https://github.com/crossplane-contrib/provider-jet-equinix/releases):
```
kubectl crossplane install provider crossplane/provider-tf-equinix:v0.1.0
kubectl crossplane install provider crossplane/provider-jet-equinix:v0.1.0
```

You can see the API reference [here](https://doc.crds.dev/github.com/crossplane-contrib/provider-tf-equinix).
Alternatively, you can use declarative installation:
```
kubectl apply -f examples/install.yaml
```

Notice that in this example Provider resource is referencing ControllerConfig with debug enabled.

You can see the API reference [here](https://doc.crds.dev/github.com/crossplane-contrib/provider-jet-equinix).

## Developing

Run code-generation pipeline:
```console
go run cmd/generator/main.go
go run cmd/generator/main.go "$PWD"
```

Run against a Kubernetes cluster:
Expand All @@ -34,18 +41,6 @@ Build, push, and install:
make all
```

Build image:

```console
make image
```

Push image:

```console
make push
```

Build binary:

```console
Expand All @@ -55,7 +50,7 @@ make build
## Report a Bug

For filing bugs, suggesting improvements, or requesting new features, please
open an [issue](https://github.com/crossplane-contrib/provider-tf-equinix/issues).
open an [issue](https://github.com/crossplane-contrib/provider-jet-equinix/issues).

## Contact

Expand All @@ -69,17 +64,17 @@ Please use the following to reach members of the community:

## Governance and Owners

provider-tf-equinix is run according to the same
provider-jet-equinix is run according to the same
[Governance](https://github.com/crossplane/crossplane/blob/master/GOVERNANCE.md)
and [Ownership](https://github.com/crossplane/crossplane/blob/master/OWNERS.md)
structure as the core Crossplane project.

## Code of Conduct

provider-tf-equinix adheres to the same [Code of
provider-jet-equinix adheres to the same [Code of
Conduct](https://github.com/crossplane/crossplane/blob/master/CODE_OF_CONDUCT.md)
as the core Crossplane project.

## Licensing

provider-tf-equinix is under the Apache 2.0 license.
provider-jet-equinix is under the Apache 2.0 license.
Loading

0 comments on commit 4a341c9

Please sign in to comment.