Skip to content

Commit aba4194

Browse files
committed
Add Crossplane v2 support
Signed-off-by: Ty Christensen <[email protected]> Signed-off-by: Nate Gay <[email protected]>
1 parent 9bc3301 commit aba4194

File tree

248 files changed

+25735
-2082
lines changed

Some content is hidden

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

248 files changed

+25735
-2082
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
env:
1212
# Common versions
13-
GO_VERSION: '1.23'
13+
GO_VERSION: '1.24'
1414
GOLANGCI_VERSION: 'v2.1.2'
1515
DOCKER_BUILDX_VERSION: 'v0.23.0'
1616

.github/workflows/publish-provider-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
required: false
1010
go-version:
1111
description: 'Go version to use if building needs to be done'
12-
default: '1.23'
12+
default: '1.24'
1313
required: false
1414

1515
jobs:

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ GO_TEST_PARALLEL := $(shell echo $$(( $(NPROCS) / 2 )))
2626
GOLANGCILINT_VERSION ?= 2.1.2
2727
GO_STATIC_PACKAGES = $(GO_PROJECT)/cmd/provider
2828
GO_LDFLAGS += -X $(GO_PROJECT)/pkg/version.Version=$(VERSION)
29-
GO_SUBDIRS += cmd pkg apis
29+
GO_SUBDIRS += generate cmd pkg apis
3030
GO111MODULE = on
3131
-include build/makelib/golang.mk
3232

@@ -35,7 +35,7 @@ GO111MODULE = on
3535
KIND_NODE_IMAGE_TAG ?= v1.30.13
3636
KIND_VERSION ?= v0.29.0
3737
KUBECTL_VERSION ?= v1.30.13
38-
CROSSPLANE_CLI_VERSION ?= v1.20.0
38+
CROSSPLANE_CLI_VERSION ?= v2.0.2
3939
-include build/makelib/k8s_tools.mk
4040

4141
# ====================================================================================

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,37 @@ Check the example:
7575
4. Run `make` to initialize the "build". Make submodules used for CI/CD.
7676
5. Run `make reviewable` to run code generation, linters, and tests.
7777
6. Commit, push, and PR.
78+
79+
## Developing locally
80+
81+
**Pre-requisite:** A Kubernetes cluster with Crossplane installed
82+
83+
To run the `provider-helm` controller against your existing local cluster,
84+
simply run:
85+
86+
```console
87+
make run
88+
```
89+
90+
Since the controller is running outside of the local cluster, you need to make
91+
the API server accessible (on a separate terminal):
92+
93+
```console
94+
sudo kubectl proxy --port=8081
95+
```
96+
97+
Then we must prepare a `ProviderConfig` for the local cluster (assuming you are
98+
using `kind` for local development):
99+
100+
```console
101+
KUBECONFIG=$(kind get kubeconfig | sed -e 's|server:\s*.*$|server: http://localhost:8081|g')
102+
kubectl -n crossplane-system create secret generic cluster-config --from-literal=kubeconfig="${KUBECONFIG}"
103+
kubectl apply -f examples/provider-config/provider-config-with-secret.yaml
104+
```
105+
106+
Now you can create `Release` resources with this `ProviderConfig`, for example
107+
[sample release.yaml](examples/sample/release.yaml).
108+
109+
```console
110+
kubectl create -f examples/sample/release.yaml
111+
```

apis/mssql/v1alpha1/database_types.go renamed to apis/cluster/mssql/v1alpha1/database_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package v1alpha1
1919
import (
2020
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2121

22-
xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
22+
xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1"
2323
)
2424

2525
// A DatabaseSpec defines the desired state of a Database.
File renamed without changes.

apis/mssql/v1alpha1/grant_types.go renamed to apis/cluster/mssql/v1alpha1/grant_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
package v1alpha1
1818

1919
import (
20-
xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
20+
xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1"
2121
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2222
)
2323

apis/mssql/v1alpha1/provider_types.go renamed to apis/cluster/mssql/v1alpha1/provider_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package v1alpha1
1919
import (
2020
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2121

22-
xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
22+
xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1"
2323
)
2424

2525
// A ProviderConfigSpec defines the desired state of a ProviderConfig.
File renamed without changes.

apis/mssql/v1alpha1/user_types.go renamed to apis/cluster/mssql/v1alpha1/user_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package v1alpha1
1919
import (
2020
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2121

22-
xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
22+
xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1"
2323
)
2424

2525
// A UserSpec defines the desired state of a Database.

0 commit comments

Comments
 (0)