Skip to content

Commit 0be8ca7

Browse files
Merge pull request #380 from erhancagirici/crossplane-v2
crossplane v2: namespaced MRs
2 parents f552b24 + af9eab2 commit 0be8ca7

File tree

153 files changed

+8253
-479
lines changed

Some content is hidden

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

153 files changed

+8253
-479
lines changed

.github/workflows/ci.yml

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

1111
env:
1212
# Common versions
13-
GO_VERSION: '1.23.8'
14-
GOLANGCI_VERSION: 'v1.62.0'
13+
GO_VERSION: '1.24.5'
14+
GOLANGCI_VERSION: 'v1.64.8'
1515
DOCKER_BUILDX_VERSION: 'v0.11.2'
1616

1717
jobs:

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# SPDX-License-Identifier: CC0-1.0
44

55
run:
6-
timeout: 2m
6+
timeout: 15m
77

88
output:
99
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"

Makefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ GO_STATIC_PACKAGES = $(GO_PROJECT)/cmd/provider
3131
GO_LDFLAGS += -X $(GO_PROJECT)/internal/version.Version=$(VERSION)
3232
GO_SUBDIRS += cmd internal apis pkg
3333
GO111MODULE = on
34-
GOLANGCILINT_VERSION = 1.62.0
34+
GOLANGCILINT_VERSION = 1.64.8
3535
-include build/makelib/golang.mk
3636

3737
# ====================================================================================
3838
# Setup Kubernetes tools
39-
KIND_VERSION = v0.22.0
40-
UP_VERSION = v0.28.0
41-
UP_CHANNEL = stable
39+
KIND_VERSION = v0.29.0
40+
UP_VERSION = v0.40.0-0.rc.3
41+
UP_CHANNEL = alpha
4242
USE_HELM3 = true
4343
-include build/makelib/k8s_tools.mk
4444

@@ -85,18 +85,18 @@ cobertura:
8585

8686
# ====================================================================================
8787
# End to End Testing
88-
CROSSPLANE_VERSION = 1.19.0
88+
CROSSPLANE_VERSION = 1.20.0
8989
CROSSPLANE_NAMESPACE = crossplane-system
9090
-include build/makelib/local.xpkg.mk
9191
-include build/makelib/controlplane.mk
9292

9393
# TODO(turkenh): Add "examples/object/object-ssa-owner.yaml" to the list to test the SSA functionality as part of the e2e tests.
9494
# The test is disabled for now because uptest clears the package cache when the provider restarted with the SSA flag.
9595
# Enable after https://github.com/crossplane/uptest/issues/17 is fixed.
96-
UPTEST_EXAMPLE_LIST ?= "examples/object/object.yaml,examples/object/object-watching.yaml"
97-
uptest: $(UPTEST) $(KUBECTL) $(KUTTL)
96+
UPTEST_EXAMPLE_LIST ?= "examples/namespaced/object/object.yaml,examples/namespaced/object/object-watching.yaml"
97+
uptest: $(UPTEST) $(KUBECTL) $(KUTTL) $(CHAINSAW)
9898
@$(INFO) running automated tests
99-
@KUBECTL=$(KUBECTL) KUTTL=$(KUTTL) CROSSPLANE_NAMESPACE=${CROSSPLANE_NAMESPACE} $(UPTEST) e2e "$(UPTEST_EXAMPLE_LIST)" --setup-script=cluster/test/setup.sh || $(FAIL)
99+
@KUBECTL=$(KUBECTL) KUTTL=$(KUTTL) CHAINSAW=$(CHAINSAW) CROSSPLANE_NAMESPACE=${CROSSPLANE_NAMESPACE} $(UPTEST) e2e "$(UPTEST_EXAMPLE_LIST)" --setup-script=cluster/test/setup.sh || $(FAIL)
100100
@$(OK) running automated tests
101101

102102
local-dev: controlplane.up
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ limitations under the License.
1515
*/
1616

1717
// Package apis contains Kubernetes API for the Template provider.
18-
package apis
18+
package cluster
1919

2020
import (
2121
"k8s.io/apimachinery/pkg/runtime"
2222

23-
objectv1alpha1 "github.com/crossplane-contrib/provider-kubernetes/apis/object/v1alpha1"
24-
objectv1alhpa2 "github.com/crossplane-contrib/provider-kubernetes/apis/object/v1alpha2"
25-
observedobjectcollectionv1alpha1 "github.com/crossplane-contrib/provider-kubernetes/apis/observedobjectcollection/v1alpha1"
26-
templatev1alpha1 "github.com/crossplane-contrib/provider-kubernetes/apis/v1alpha1"
23+
objectv1alpha1 "github.com/crossplane-contrib/provider-kubernetes/apis/cluster/object/v1alpha1"
24+
objectv1alhpa2 "github.com/crossplane-contrib/provider-kubernetes/apis/cluster/object/v1alpha2"
25+
observedobjectcollectionv1alpha1 "github.com/crossplane-contrib/provider-kubernetes/apis/cluster/observedobjectcollection/v1alpha1"
26+
templatev1alpha1 "github.com/crossplane-contrib/provider-kubernetes/apis/cluster/v1alpha1"
2727
)
2828

2929
func init() {

apis/object/v1alpha1/conversion.go renamed to apis/cluster/object/v1alpha1/conversion.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ import (
2020
"k8s.io/apimachinery/pkg/util/sets"
2121
"sigs.k8s.io/controller-runtime/pkg/conversion"
2222

23-
xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
24-
"github.com/crossplane/crossplane-runtime/pkg/errors"
23+
xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1"
24+
"github.com/crossplane/crossplane-runtime/v2/pkg/errors"
2525

26-
"github.com/crossplane-contrib/provider-kubernetes/apis/object/v1alpha2"
26+
"github.com/crossplane-contrib/provider-kubernetes/apis/cluster/object/v1alpha2"
2727
)
2828

2929
// ConvertTo converts this Object to the Hub version (v1alpha2).
@@ -77,7 +77,6 @@ func (src *Object) ConvertTo(dstRaw conversion.Hub) error { // nolint:golint //
7777
dst.Spec = v1alpha2.ObjectSpec{
7878
ResourceSpec: xpv1.ResourceSpec{
7979
WriteConnectionSecretToReference: src.GetWriteConnectionSecretToReference(),
80-
PublishConnectionDetailsTo: src.GetPublishConnectionDetailsTo(),
8180
ProviderConfigReference: src.GetProviderConfigReference(),
8281
DeletionPolicy: src.GetDeletionPolicy(),
8382
},
@@ -158,7 +157,6 @@ func (dst *Object) ConvertFrom(srcRaw conversion.Hub) error { // nolint:golint,
158157
dst.Spec = ObjectSpec{
159158
ResourceSpec: ResourceSpec{
160159
WriteConnectionSecretToReference: src.GetWriteConnectionSecretToReference(),
161-
PublishConnectionDetailsTo: src.GetPublishConnectionDetailsTo(),
162160
ProviderConfigReference: src.GetProviderConfigReference(),
163161
DeletionPolicy: src.GetDeletionPolicy(),
164162
},

apis/object/v1alpha1/conversion_test.go renamed to apis/cluster/object/v1alpha1/conversion_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ import (
2626
"k8s.io/apimachinery/pkg/runtime"
2727
"k8s.io/utils/ptr"
2828

29-
v1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
30-
"github.com/crossplane/crossplane-runtime/pkg/test"
29+
v1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1"
30+
"github.com/crossplane/crossplane-runtime/v2/pkg/test"
3131

32-
"github.com/crossplane-contrib/provider-kubernetes/apis/object/v1alpha1"
33-
"github.com/crossplane-contrib/provider-kubernetes/apis/object/v1alpha2"
32+
"github.com/crossplane-contrib/provider-kubernetes/apis/cluster/object/v1alpha1"
33+
"github.com/crossplane-contrib/provider-kubernetes/apis/cluster/object/v1alpha2"
3434
)
3535

3636
func TestConvertTo(t *testing.T) {

apis/object/v1alpha1/management_policy_hack.go renamed to apis/cluster/object/v1alpha1/management_policy_hack.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package v1alpha1
22

3-
import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
3+
import xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1"
44

55
// Note(turkenh): Provider Kubernetes Object already has a ManagementPolicy
66
// field and implements the logic in its own controller.
@@ -24,14 +24,6 @@ type ResourceSpec struct {
2424
// +optional
2525
WriteConnectionSecretToReference *xpv1.SecretReference `json:"writeConnectionSecretToRef,omitempty"`
2626

27-
// PublishConnectionDetailsTo specifies the connection secret config which
28-
// contains a name, metadata and a reference to secret store config to
29-
// which any connection details for this managed resource should be written.
30-
// Connection details frequently include the endpoint, username,
31-
// and password required to connect to the managed resource.
32-
// +optional
33-
PublishConnectionDetailsTo *xpv1.PublishConnectionDetailsTo `json:"publishConnectionDetailsTo,omitempty"`
34-
3527
// ProviderConfigReference specifies how the provider that will be used to
3628
// create, observe, update, and delete this managed resource should be
3729
// configured.

0 commit comments

Comments
 (0)