Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ cover.out
# ignore IDE folders
.vscode/
.idea/

/temp
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ View the [upstream changelogs](https://github.com/terraform-provider-openstack/t
- Made it easier to configure authentication by not requiring so many fields.
- Migrated to Upjets new No-Fork/Provider v2 SDK Architecture. The provider now does not ship with Terraform CLI anymore.
- Added many cross resource references (autmatically generated from Terraform provider schema)
- Add native metrics for managed resources (see [Upjet 1.3.0](https://github.com/crossplane/upjet/releases/tag/v1.3.0) for more details)
- Add native metrics for managed resources (see [Upjet 1.3.0](https://github.com/crossplane/upjet/v2/releases/tag/v1.3.0) for more details)

### Changed

Expand Down
59 changes: 59 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Contributing

THis project uses [Makefile](Makefile) to manage common tasks. You can see all available commands by running:

```bash
make help
```

Ensure your environment provides the encessary tools to build and test the project.

- [Go](https://golang.org/dl/) in the version specified in [go.mod](go.mod)
- [Docker](https://www.docker.com/get-started) or a compatible container runtime

```bash

## Developing

Install the required submodules to build and run:

```bash
make submodules
```

Apply the Current CRDs and a providerConfig:

```bash
kubectl apply -f package/crds
kubectl apply -f examples/providerconfig/providerconfig.yaml
```

Run against a Kubernetes cluster: (make sure to apply CRDs and providerConfig)

```bash
make run
```

Run a testbuild with linting:

```bash
make reviewable
```

Build binary:

```bash
make build
```

## Release a new version (Maintainer)

- Update Changelog (Add new Version & Date)
- Create or merge to existing release branch (release-v(major).(minor))
- Run Release pipeline on release branch, using specific version as parameter

## Environment Speicific Notes

### Apple Silicon (ARM64)

- When using Rancher Desktop, use QEMU as the emulator to ensure kind works correctly (see https://github.com/rancher-sandbox/rancher-desktop/issues/9192)
31 changes: 21 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@
PROJECT_NAME := provider-openstack
PROJECT_REPO := github.com/crossplane-contrib/$(PROJECT_NAME)

export TERRAFORM_VERSION := 1.5.5
export TERRAFORM_VERSION := 1.5.7
export TERRAFORM_PROVIDER_SOURCE := terraform-provider-openstack/openstack
export TERRAFORM_DOCS_PATH := docs/resources

# Do not allow a version of terraform greater than 1.5.x, due to versions 1.6+ being
# licensed under BSL, which is not permitted.
TERRAFORM_VERSION_VALID := $(shell [ "$(TERRAFORM_VERSION)" = "`printf "$(TERRAFORM_VERSION)\n1.6" | sort -V | head -n1`" ] && echo 1 || echo 0)

export TERRAFORM_PROVIDER_REPO := https://github.com/terraform-provider-openstack/terraform-provider-openstack
export TERRAFORM_PROVIDER_VERSION := 3.3.2

Expand Down Expand Up @@ -48,15 +53,16 @@ GO_SUBDIRS += cmd internal apis
# ====================================================================================
# Setup Kubernetes tools

KIND_VERSION = v0.21.0
UP_VERSION = v0.28.0
KIND_VERSION = v0.30.0
UP_VERSION = v0.41.0
UP_CHANNEL = stable
UPTEST_VERSION = v0.11.1
UPTEST_VERSION = v2.2.0
UPTEST_LOCAL_VERSION = v0.13.0
UPTEST_LOCAL_CHANNEL = stable
KUSTOMIZE_VERSION = v5.3.0
YQ_VERSION = v4.40.5
CROSSPLANE_VERSION = 1.14.6
CROSSPLANE_VERSION = 2.1.1
CROSSPLANE_CLI_VERSION = v2.1.1
CRDDIFF_VERSION = v0.12.1

-include build/makelib/k8s_tools.mk
Expand Down Expand Up @@ -99,7 +105,7 @@ xpkg.build.provider-openstack: do.build.images

# NOTE(hasheddan): we ensure up is installed prior to running platform-specific
# build steps in parallel to avoid encountering an installation race condition.
build.init: $(UP)
build.init: $(UP) $(CROSSPLANE_CLI)

# ====================================================================================
# Fallthrough
Expand All @@ -121,10 +127,14 @@ TERRAFORM := $(TOOLS_HOST_DIR)/terraform-$(TERRAFORM_VERSION)
TERRAFORM_WORKDIR := $(WORK_DIR)/terraform
TERRAFORM_PROVIDER_SCHEMA := config/schema.json

$(TERRAFORM):
check-terraform-version:
ifneq ($(TERRAFORM_VERSION_VALID),1)
$(error invalid TERRAFORM_VERSION $(TERRAFORM_VERSION), must be less than 1.6.0 since that version introduced a not permitted BSL license))
endif
$(TERRAFORM): check-terraform-version
@$(INFO) installing terraform $(HOSTOS)-$(HOSTARCH)
@mkdir -p $(TOOLS_HOST_DIR)/tmp-terraform
@curl -fsSL https://github.com/upbound/terraform/releases/download/v$(TERRAFORM_VERSION)/terraform_$(TERRAFORM_VERSION)_$(SAFEHOST_PLATFORM).zip -o $(TOOLS_HOST_DIR)/tmp-terraform/terraform.zip
@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
Expand All @@ -133,6 +143,7 @@ $(TERRAFORM):
$(TERRAFORM_PROVIDER_SCHEMA): $(TERRAFORM)
@$(INFO) generating provider schema for $(TERRAFORM_PROVIDER_SOURCE) $(TERRAFORM_PROVIDER_VERSION)
@mkdir -p $(TERRAFORM_WORKDIR)
# Remove lock file to prevent installation issues when changing provider versions
@rm -f ${TERRAFORM_WORKDIR}/.terraform.lock.hcl
@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
Expand Down Expand Up @@ -186,7 +197,7 @@ run: go.build

# ====================================================================================
# End to End Testing
CROSSPLANE_NAMESPACE = upbound-system
CROSSPLANE_NAMESPACE = crossplane-system
-include build/makelib/local.xpkg.mk
-include build/makelib/controlplane.mk

Expand All @@ -202,7 +213,7 @@ uptest: $(UPTEST_LOCAL) $(KUBECTL) $(KUTTL)
local-deploy: build controlplane.up local.xpkg.deploy.provider.$(PROJECT_NAME)
@$(INFO) running locally built provider
@$(KUBECTL) wait provider.pkg $(PROJECT_NAME) --for condition=Healthy --timeout 5m
@$(KUBECTL) -n upbound-system wait --for=condition=Available deployment --all --timeout=5m
@$(KUBECTL) -n $(CROSSPLANE_NAMESPACE) wait --for=condition=Available deployment --all --timeout=5m
@$(OK) running locally built provider

# This target requires the following environment variables to be set:
Expand Down
57 changes: 17 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<div align="center">

[![GitHub release](https://img.shields.io/github/release/crossplane-contrib/provider-openstack/all.svg)](https://github.com/crossplane-contrib/provider-openstack/releases)
![Go Version](https://img.shields.io/github/go-mod/go-version/crossplane-contrib/provider-openstack)

</div>

Expand All @@ -11,6 +12,20 @@ is built using [Upjet](https://github.com/crossplane/upjet) code
generation tools and exposes XRM-conformant managed resources for the
OpenStack API.

## Features

The provider is compatible with Crossplane 1.x and 2.x

| Feature | Status |
|-----------------------------|---------------|
| [Cluster Scoped Managed Resources](./examples-generated/cluster) | ✅ Supported |
| [Namespace Scoped Managed Resources](./examples-generated/namespace) | ✅ Supported (Crossplane 2+) |
| [Management Policies (Beta)](https://docs.crossplane.io/latest/managed-resources/managed-resources/#managementpolicies) | ✅ Supported |
| [Init Providers (Beta)](https://docs.crossplane.io/latest/managed-resources/managed-resources/#initprovider) | ✅ Supported |
| [Safe Start/MRDs (Alpha)](https://docs.crossplane.io/latest/guides/implementing-safe-start/) | ✅ Supported (Crossplane 2+) |
| [Change Logs (Alpha)](https://docs.crossplane.io/latest/guides/change-logs/) | ❌ Planned, see [#141](https://github.com/crossplane-contrib/provider-openstack/issues/141) |
| [External Secret Stores (Alpha)](https://docs.crossplane.io/latest/guides/upgrade-to-crossplane-v2/#external-secret-stores) | ❌ Not Planned |

## Getting Started

### Installation
Expand All @@ -23,10 +38,11 @@ kind: Provider
metadata:
name: provider-openstack
spec:
# Replace by the latest version
package: xpkg.crossplane.io/crossplane-contrib/provider-openstack:vX.Y.Z
```

You can see the API reference [here](https://doc.crds.dev/github.com/crossplane-contrib/provider-openstack).
You can see the API reference [here](https://doc.crds.dev/github.com/crossplane-contrib/provider-openstack) as well as examples of managed resources in the [examples-generated](./examples-generated) folder.

### Configuration

Expand Down Expand Up @@ -118,45 +134,6 @@ spec:
name: provider-openstack
```

## Developing

Install the required submodules to build and run:

```bash
make submodules
```

Apply the Current CRDs and a providerConfig:

```bash
kubectl apply -f package/crds
kubectl apply -f examples/providerconfig/providerconfig.yaml
```

Run against a Kubernetes cluster: (make sure to apply CRDs and providerConfig)

```bash
make run
```

Run a testbuild with linting:

```bash
make reviewable
```

Build binary:

```bash
make build
```

## Release a new version (Maintainer)

- Update Changelog (Add new Version & Date)
- Create or merge to existing release branch (release-v(major).(minor))
- Run Release pipeline on release branch, using specific version as parameter

## Report a Bug

For filing bugs, suggesting improvements, or requesting new features, please
Expand Down
Loading
Loading