From cfec01e44bd0fe09d3b3fc4fc97acc998eecdebf Mon Sep 17 00:00:00 2001 From: Hannes Leutloff Date: Mon, 17 Aug 2026 09:35:25 +0200 Subject: [PATCH] feat: Upgrade crossplane-runtime to v2.3.3 Signed-off-by: Hannes Leutloff --- apis/cluster/mssql/v1alpha1/database_types.go | 6 +- apis/cluster/mssql/v1alpha1/grant_types.go | 16 +- apis/cluster/mssql/v1alpha1/provider_types.go | 12 +- apis/cluster/mssql/v1alpha1/user_types.go | 20 +-- .../mssql/v1alpha1/zz_generated.deepcopy.go | 34 ++-- .../mssql/v1alpha1/zz_generated.managed.go | 62 +++---- .../cluster/mssql/v1alpha1/zz_generated.pc.go | 6 +- .../mssql/v1alpha1/zz_generated.pcu.go | 10 +- .../mssql/v1alpha1/zz_generated.resolvers.go | 102 ----------- apis/cluster/mysql/v1alpha1/database_types.go | 6 +- apis/cluster/mysql/v1alpha1/grant_types.go | 18 +- apis/cluster/mysql/v1alpha1/provider_types.go | 14 +- apis/cluster/mysql/v1alpha1/user_types.go | 12 +- .../mysql/v1alpha1/zz_generated.deepcopy.go | 36 ++-- .../mysql/v1alpha1/zz_generated.managed.go | 62 +++---- .../cluster/mysql/v1alpha1/zz_generated.pc.go | 6 +- .../mysql/v1alpha1/zz_generated.pcu.go | 10 +- .../mysql/v1alpha1/zz_generated.resolvers.go | 58 ------ .../postgresql/v1alpha1/database_types.go | 12 +- .../v1alpha1/default_privileges_types.go | 16 +- .../postgresql/v1alpha1/extension_types.go | 12 +- .../postgresql/v1alpha1/grant_types.go | 24 +-- .../postgresql/v1alpha1/provider_types.go | 12 +- .../cluster/postgresql/v1alpha1/role_types.go | 12 +- .../postgresql/v1alpha1/schema_types.go | 16 +- .../v1alpha1/zz_generated.deepcopy.go | 70 ++++---- .../v1alpha1/zz_generated.managed.go | 122 ++++++------- .../postgresql/v1alpha1/zz_generated.pc.go | 6 +- .../postgresql/v1alpha1/zz_generated.pcu.go | 10 +- .../v1alpha1/zz_generated.resolvers.go | 156 ---------------- .../mssql/v1alpha1/cluster_provider_types.go | 6 +- .../mssql/v1alpha1/database_types.go | 5 +- apis/namespaced/mssql/v1alpha1/grant_types.go | 13 +- .../mssql/v1alpha1/provider_types.go | 7 +- apis/namespaced/mssql/v1alpha1/user_types.go | 17 +- .../mssql/v1alpha1/zz_generated.deepcopy.go | 32 ++-- .../mssql/v1alpha1/zz_generated.managed.go | 50 +++--- .../mssql/v1alpha1/zz_generated.pc.go | 10 +- .../mssql/v1alpha1/zz_generated.pcu.go | 10 +- .../mssql/v1alpha1/zz_generated.resolvers.go | 102 ----------- .../mysql/v1alpha1/cluster_provider_types.go | 6 +- .../mysql/v1alpha1/database_types.go | 5 +- apis/namespaced/mysql/v1alpha1/grant_types.go | 15 +- .../mysql/v1alpha1/provider_types.go | 9 +- apis/namespaced/mysql/v1alpha1/user_types.go | 9 +- .../mysql/v1alpha1/zz_generated.deepcopy.go | 36 ++-- .../mysql/v1alpha1/zz_generated.managed.go | 50 +++--- .../mysql/v1alpha1/zz_generated.pc.go | 10 +- .../mysql/v1alpha1/zz_generated.pcu.go | 10 +- .../mysql/v1alpha1/zz_generated.resolvers.go | 58 ------ .../v1alpha1/cluster_provider_types.go | 6 +- .../postgresql/v1alpha1/database_types.go | 9 +- .../v1alpha1/default_privileges_types.go | 13 +- .../postgresql/v1alpha1/extension_types.go | 9 +- .../postgresql/v1alpha1/grant_types.go | 22 ++- .../postgresql/v1alpha1/provider_types.go | 7 +- .../postgresql/v1alpha1/role_types.go | 9 +- .../postgresql/v1alpha1/schema_types.go | 13 +- .../v1alpha1/zz_generated.deepcopy.go | 62 +++---- .../v1alpha1/zz_generated.managed.go | 98 +++++----- .../postgresql/v1alpha1/zz_generated.pc.go | 10 +- .../postgresql/v1alpha1/zz_generated.pcu.go | 10 +- .../v1alpha1/zz_generated.resolvers.go | 156 ---------------- go.mod | 66 +++---- go.sum | 158 ++++++++-------- .../mssql.sql.crossplane.io_databases.yaml | 7 + .../crds/mssql.sql.crossplane.io_grants.yaml | 7 + .../crds/mssql.sql.crossplane.io_users.yaml | 7 + .../mssql.sql.m.crossplane.io_databases.yaml | 7 + .../mssql.sql.m.crossplane.io_grants.yaml | 7 + .../crds/mssql.sql.m.crossplane.io_users.yaml | 7 + .../mysql.sql.crossplane.io_databases.yaml | 7 + .../crds/mysql.sql.crossplane.io_grants.yaml | 7 + .../crds/mysql.sql.crossplane.io_users.yaml | 7 + .../mysql.sql.m.crossplane.io_databases.yaml | 7 + .../mysql.sql.m.crossplane.io_grants.yaml | 7 + .../crds/mysql.sql.m.crossplane.io_users.yaml | 7 + ...ostgresql.sql.crossplane.io_databases.yaml | 7 + ...l.sql.crossplane.io_defaultprivileges.yaml | 7 + ...stgresql.sql.crossplane.io_extensions.yaml | 7 + .../postgresql.sql.crossplane.io_grants.yaml | 7 + .../postgresql.sql.crossplane.io_roles.yaml | 7 + .../postgresql.sql.crossplane.io_schemas.yaml | 7 + ...tgresql.sql.m.crossplane.io_databases.yaml | 7 + ...sql.m.crossplane.io_defaultprivileges.yaml | 7 + ...gresql.sql.m.crossplane.io_extensions.yaml | 7 + ...postgresql.sql.m.crossplane.io_grants.yaml | 7 + .../postgresql.sql.m.crossplane.io_roles.yaml | 7 + ...ostgresql.sql.m.crossplane.io_schemas.yaml | 7 + pkg/clients/mssql/mssql.go | 16 +- pkg/clients/mysql/mysql.go | 18 +- pkg/clients/postgresql/postgresql.go | 18 +- .../cluster/mssql/database/reconciler.go | 4 +- .../cluster/mssql/database/reconciler_test.go | 20 +-- .../cluster/mssql/grant/reconciler.go | 4 +- .../cluster/mssql/grant/reconciler_test.go | 16 +- .../cluster/mssql/user/reconciler.go | 4 +- .../cluster/mssql/user/reconciler_test.go | 116 ++++++------ pkg/controller/cluster/mssql/user/utils.go | 4 +- .../cluster/mysql/database/reconciler.go | 4 +- .../cluster/mysql/database/reconciler_test.go | 16 +- .../cluster/mysql/grant/reconciler.go | 4 +- .../cluster/mysql/grant/reconciler_test.go | 16 +- pkg/controller/cluster/mysql/tls/tls.go | 4 +- .../cluster/mysql/user/reconciler.go | 8 +- .../cluster/mysql/user/reconciler_test.go | 144 +++++++-------- pkg/controller/cluster/mysql/user/utils.go | 4 +- .../cluster/postgresql/database/reconciler.go | 4 +- .../postgresql/database/reconciler_test.go | 16 +- .../default_privileges/reconciler.go | 8 +- .../default_privileges/reconciler_test.go | 26 +-- .../postgresql/extension/reconciler.go | 4 +- .../postgresql/extension/reconciler_test.go | 16 +- .../cluster/postgresql/grant/connect_test.go | 8 +- .../cluster/postgresql/grant/reconciler.go | 8 +- .../postgresql/grant/reconciler_test.go | 16 +- .../cluster/postgresql/role/reconciler.go | 8 +- .../postgresql/role/reconciler_test.go | 170 +++++++++--------- .../cluster/postgresql/role/utils.go | 6 +- .../cluster/postgresql/schema/reconciler.go | 6 +- .../postgresql/schema/reconciler_test.go | 16 +- .../namespaced/mssql/database/reconciler.go | 4 +- .../mssql/database/reconciler_test.go | 15 +- .../namespaced/mssql/grant/reconciler.go | 4 +- .../namespaced/mssql/grant/reconciler_test.go | 15 +- .../namespaced/mssql/user/reconciler.go | 4 +- .../namespaced/mssql/user/reconciler_test.go | 104 ++++++----- pkg/controller/namespaced/mssql/user/utils.go | 4 +- .../namespaced/mysql/database/reconciler.go | 4 +- .../mysql/database/reconciler_test.go | 15 +- .../namespaced/mysql/grant/reconciler.go | 4 +- .../namespaced/mysql/grant/reconciler_test.go | 15 +- pkg/controller/namespaced/mysql/tls/tls.go | 4 +- .../namespaced/mysql/user/reconciler.go | 8 +- .../namespaced/mysql/user/reconciler_test.go | 136 +++++++------- pkg/controller/namespaced/mysql/user/utils.go | 4 +- .../postgresql/database/reconciler.go | 4 +- .../postgresql/database/reconciler_test.go | 15 +- .../default_privileges/reconciler.go | 8 +- .../default_privileges/reconciler_test.go | 20 +-- .../postgresql/extension/reconciler.go | 4 +- .../postgresql/extension/reconciler_test.go | 15 +- .../postgresql/grant/connect_test.go | 7 +- .../namespaced/postgresql/grant/reconciler.go | 8 +- .../postgresql/grant/reconciler_test.go | 15 +- .../namespaced/postgresql/role/reconciler.go | 8 +- .../postgresql/role/reconciler_test.go | 142 ++++++++------- .../namespaced/postgresql/role/utils.go | 6 +- .../postgresql/schema/reconciler.go | 6 +- .../postgresql/schema/reconciler_test.go | 15 +- 150 files changed, 1543 insertions(+), 2036 deletions(-) delete mode 100644 apis/cluster/mssql/v1alpha1/zz_generated.resolvers.go delete mode 100644 apis/cluster/mysql/v1alpha1/zz_generated.resolvers.go delete mode 100644 apis/cluster/postgresql/v1alpha1/zz_generated.resolvers.go delete mode 100644 apis/namespaced/mssql/v1alpha1/zz_generated.resolvers.go delete mode 100644 apis/namespaced/mysql/v1alpha1/zz_generated.resolvers.go delete mode 100644 apis/namespaced/postgresql/v1alpha1/zz_generated.resolvers.go diff --git a/apis/cluster/mssql/v1alpha1/database_types.go b/apis/cluster/mssql/v1alpha1/database_types.go index 0186319e..6ca9cd8b 100644 --- a/apis/cluster/mssql/v1alpha1/database_types.go +++ b/apis/cluster/mssql/v1alpha1/database_types.go @@ -19,17 +19,17 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" ) // A DatabaseSpec defines the desired state of a Database. type DatabaseSpec struct { - xpv1.ResourceSpec `json:",inline"` + xpv2.ClusterManagedResourceSpec `json:",inline"` } // A DatabaseStatus represents the observed state of a Database. type DatabaseStatus struct { - xpv1.ResourceStatus `json:",inline"` + xpv2.ManagedResourceStatus `json:",inline"` } // +kubebuilder:object:root=true diff --git a/apis/cluster/mssql/v1alpha1/grant_types.go b/apis/cluster/mssql/v1alpha1/grant_types.go index 967d896f..00e6b5c3 100644 --- a/apis/cluster/mssql/v1alpha1/grant_types.go +++ b/apis/cluster/mssql/v1alpha1/grant_types.go @@ -17,14 +17,14 @@ limitations under the License. package v1alpha1 import ( - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // A GrantSpec defines the desired state of a Grant. type GrantSpec struct { - xpv1.ResourceSpec `json:",inline"` - ForProvider GrantParameters `json:"forProvider"` + xpv2.ClusterManagedResourceSpec `json:",inline"` + ForProvider GrantParameters `json:"forProvider"` } // GrantPermission represents a permission to be granted @@ -68,12 +68,12 @@ type GrantParameters struct { // UserRef references the user object this grant is for. // +immutable // +optional - UserRef *xpv1.Reference `json:"userRef,omitempty"` + UserRef *xpv2.Reference `json:"userRef,omitempty"` // UserSelector selects a reference to a User this grant is for. // +immutable // +optional - UserSelector *xpv1.Selector `json:"userSelector,omitempty"` + UserSelector *xpv2.Selector `json:"userSelector,omitempty"` // Database this grant is for. // +optional @@ -83,17 +83,17 @@ type GrantParameters struct { // DatabaseRef references the database object this grant it for. // +immutable // +optional - DatabaseRef *xpv1.Reference `json:"databaseRef,omitempty"` + DatabaseRef *xpv2.Reference `json:"databaseRef,omitempty"` // DatabaseSelector selects a reference to a Database this grant is for. // +immutable // +optional - DatabaseSelector *xpv1.Selector `json:"databaseSelector,omitempty"` + DatabaseSelector *xpv2.Selector `json:"databaseSelector,omitempty"` } // A GrantStatus represents the observed state of a Grant. type GrantStatus struct { - xpv1.ResourceStatus `json:",inline"` + xpv2.ManagedResourceStatus `json:",inline"` } // +kubebuilder:object:root=true diff --git a/apis/cluster/mssql/v1alpha1/provider_types.go b/apis/cluster/mssql/v1alpha1/provider_types.go index 86045974..b90fbe78 100644 --- a/apis/cluster/mssql/v1alpha1/provider_types.go +++ b/apis/cluster/mssql/v1alpha1/provider_types.go @@ -19,7 +19,7 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" ) // A ProviderConfigSpec defines the desired state of a ProviderConfig. @@ -32,20 +32,20 @@ const ( // CredentialsSourceMSSQLConnectionSecret indicates that a provider // should acquire credentials from a connection secret written by a managed // resource that represents a MSSQL server. - CredentialsSourceMSSQLConnectionSecret xpv1.CredentialsSource = "MSSQLConnectionSecret" + CredentialsSourceMSSQLConnectionSecret xpv2.CredentialsSource = "MSSQLConnectionSecret" ) // ProviderCredentials required to authenticate. type ProviderCredentials struct { // Source of the provider credentials. // +kubebuilder:validation:Enum=MSSQLConnectionSecret - Source xpv1.CredentialsSource `json:"source"` + Source xpv2.CredentialsSource `json:"source"` // A CredentialsSecretRef is a reference to a MSSQL connection secret // that contains the credentials that must be used to connect to the // provider. // +optional - ConnectionSecretRef *xpv1.SecretReference `json:"connectionSecretRef,omitempty"` + ConnectionSecretRef *xpv2.SecretReference `json:"connectionSecretRef,omitempty"` // SecretKeyMapping allows overriding the default secret key names used // to read credentials from the connection secret. When not specified, @@ -95,7 +95,7 @@ func (m *SecretKeyMapping) ToMap() map[string]string { // A ProviderConfigStatus reflects the observed state of a ProviderConfig. type ProviderConfigStatus struct { - xpv1.ProviderConfigStatus `json:",inline"` + xpv2.ProviderConfigStatus `json:",inline"` } // +kubebuilder:object:root=true @@ -134,7 +134,7 @@ type ProviderConfigUsage struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - xpv1.ProviderConfigUsage `json:",inline"` + xpv2.ProviderConfigUsage `json:",inline"` } // +kubebuilder:object:root=true diff --git a/apis/cluster/mssql/v1alpha1/user_types.go b/apis/cluster/mssql/v1alpha1/user_types.go index baf4883e..ff5a5e83 100644 --- a/apis/cluster/mssql/v1alpha1/user_types.go +++ b/apis/cluster/mssql/v1alpha1/user_types.go @@ -19,19 +19,19 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" ) // A UserSpec defines the desired state of a Database. type UserSpec struct { - xpv1.ResourceSpec `json:",inline"` - ForProvider UserParameters `json:"forProvider"` + xpv2.ClusterManagedResourceSpec `json:",inline"` + ForProvider UserParameters `json:"forProvider"` } // A UserStatus represents the observed state of a User. type UserStatus struct { - xpv1.ResourceStatus `json:",inline"` - AtProvider UserObservation `json:"atProvider,omitempty"` + xpv2.ManagedResourceStatus `json:",inline"` + AtProvider UserObservation `json:"atProvider,omitempty"` } // UserParameters define the desired state of a MSSQL user instance. @@ -43,21 +43,21 @@ type UserParameters struct { Database *string `json:"database,omitempty"` // DatabaseRef allows you to specify custom resource name of the Database the USER is created for. // to fill Database field. - DatabaseRef *xpv1.Reference `json:"databaseRef,omitempty"` + DatabaseRef *xpv2.Reference `json:"databaseRef,omitempty"` // DatabaseSelector allows you to use selector constraints to select a Database the USER is created for. - DatabaseSelector *xpv1.Selector `json:"databaseSelector,omitempty"` + DatabaseSelector *xpv2.Selector `json:"databaseSelector,omitempty"` // PasswordSecretRef references the secret that contains the password used // for this user. If no reference is given, a password will be auto-generated. // +optional - PasswordSecretRef *xpv1.SecretKeySelector `json:"passwordSecretRef,omitempty"` + PasswordSecretRef *xpv2.SecretKeySelector `json:"passwordSecretRef,omitempty"` // LoginDatabase allows you to specify the name of the Database to be used to create the user LOGIN in (normally master). // +crossplane:generate:reference:type=Database LoginDatabase *string `json:"loginDatabase,omitempty"` // DatabaseRef allows you to specify custom resource name of the Database to be used to create the user LOGIN in (normally master). // to fill Database field. - LoginDatabaseRef *xpv1.Reference `json:"loginDatabaseRef,omitempty"` + LoginDatabaseRef *xpv2.Reference `json:"loginDatabaseRef,omitempty"` // DatabaseSelector allows you to use selector constraints to select a Database to be used to create the user LOGIN in (normally master). - LoginDatabaseSelector *xpv1.Selector `json:"loginDatabaseSelector,omitempty"` + LoginDatabaseSelector *xpv2.Selector `json:"loginDatabaseSelector,omitempty"` // Contained specifies whether to create a contained database user (without server-level login). // When true, the user will be created directly in the specified database using CREATE USER WITH PASSWORD. // When false (default), a server-level LOGIN will be created first, then a database user mapped to that login. diff --git a/apis/cluster/mssql/v1alpha1/zz_generated.deepcopy.go b/apis/cluster/mssql/v1alpha1/zz_generated.deepcopy.go index 338ce776..1457f364 100644 --- a/apis/cluster/mssql/v1alpha1/zz_generated.deepcopy.go +++ b/apis/cluster/mssql/v1alpha1/zz_generated.deepcopy.go @@ -9,7 +9,7 @@ package v1alpha1 import ( - "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" + "github.com/crossplane/crossplane/apis/v2/core/v2" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -75,7 +75,7 @@ func (in *DatabaseList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DatabaseSpec) DeepCopyInto(out *DatabaseSpec) { *out = *in - in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ClusterManagedResourceSpec.DeepCopyInto(&out.ClusterManagedResourceSpec) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseSpec. @@ -91,7 +91,7 @@ func (in *DatabaseSpec) DeepCopy() *DatabaseSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DatabaseStatus) DeepCopyInto(out *DatabaseStatus) { *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.ManagedResourceStatus.DeepCopyInto(&out.ManagedResourceStatus) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseStatus. @@ -183,12 +183,12 @@ func (in *GrantParameters) DeepCopyInto(out *GrantParameters) { } if in.UserRef != nil { in, out := &in.UserRef, &out.UserRef - *out = new(v1.Reference) + *out = new(v2.Reference) (*in).DeepCopyInto(*out) } if in.UserSelector != nil { in, out := &in.UserSelector, &out.UserSelector - *out = new(v1.Selector) + *out = new(v2.Selector) (*in).DeepCopyInto(*out) } if in.Database != nil { @@ -198,12 +198,12 @@ func (in *GrantParameters) DeepCopyInto(out *GrantParameters) { } if in.DatabaseRef != nil { in, out := &in.DatabaseRef, &out.DatabaseRef - *out = new(v1.Reference) + *out = new(v2.Reference) (*in).DeepCopyInto(*out) } if in.DatabaseSelector != nil { in, out := &in.DatabaseSelector, &out.DatabaseSelector - *out = new(v1.Selector) + *out = new(v2.Selector) (*in).DeepCopyInto(*out) } } @@ -240,7 +240,7 @@ func (in GrantPermissions) DeepCopy() GrantPermissions { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GrantSpec) DeepCopyInto(out *GrantSpec) { *out = *in - in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ClusterManagedResourceSpec.DeepCopyInto(&out.ClusterManagedResourceSpec) in.ForProvider.DeepCopyInto(&out.ForProvider) } @@ -257,7 +257,7 @@ func (in *GrantSpec) DeepCopy() *GrantSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GrantStatus) DeepCopyInto(out *GrantStatus) { *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.ManagedResourceStatus.DeepCopyInto(&out.ManagedResourceStatus) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GrantStatus. @@ -424,7 +424,7 @@ func (in *ProviderCredentials) DeepCopyInto(out *ProviderCredentials) { *out = *in if in.ConnectionSecretRef != nil { in, out := &in.ConnectionSecretRef, &out.ConnectionSecretRef - *out = new(v1.SecretReference) + *out = new(v2.SecretReference) **out = **in } if in.SecretKeyMapping != nil { @@ -543,17 +543,17 @@ func (in *UserParameters) DeepCopyInto(out *UserParameters) { } if in.DatabaseRef != nil { in, out := &in.DatabaseRef, &out.DatabaseRef - *out = new(v1.Reference) + *out = new(v2.Reference) (*in).DeepCopyInto(*out) } if in.DatabaseSelector != nil { in, out := &in.DatabaseSelector, &out.DatabaseSelector - *out = new(v1.Selector) + *out = new(v2.Selector) (*in).DeepCopyInto(*out) } if in.PasswordSecretRef != nil { in, out := &in.PasswordSecretRef, &out.PasswordSecretRef - *out = new(v1.SecretKeySelector) + *out = new(v2.SecretKeySelector) **out = **in } if in.LoginDatabase != nil { @@ -563,12 +563,12 @@ func (in *UserParameters) DeepCopyInto(out *UserParameters) { } if in.LoginDatabaseRef != nil { in, out := &in.LoginDatabaseRef, &out.LoginDatabaseRef - *out = new(v1.Reference) + *out = new(v2.Reference) (*in).DeepCopyInto(*out) } if in.LoginDatabaseSelector != nil { in, out := &in.LoginDatabaseSelector, &out.LoginDatabaseSelector - *out = new(v1.Selector) + *out = new(v2.Selector) (*in).DeepCopyInto(*out) } if in.Contained != nil { @@ -591,7 +591,7 @@ func (in *UserParameters) DeepCopy() *UserParameters { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *UserSpec) DeepCopyInto(out *UserSpec) { *out = *in - in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ClusterManagedResourceSpec.DeepCopyInto(&out.ClusterManagedResourceSpec) in.ForProvider.DeepCopyInto(&out.ForProvider) } @@ -608,7 +608,7 @@ func (in *UserSpec) DeepCopy() *UserSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *UserStatus) DeepCopyInto(out *UserStatus) { *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.ManagedResourceStatus.DeepCopyInto(&out.ManagedResourceStatus) out.AtProvider = in.AtProvider } diff --git a/apis/cluster/mssql/v1alpha1/zz_generated.managed.go b/apis/cluster/mssql/v1alpha1/zz_generated.managed.go index 2793acae..88c67a4e 100644 --- a/apis/cluster/mssql/v1alpha1/zz_generated.managed.go +++ b/apis/cluster/mssql/v1alpha1/zz_generated.managed.go @@ -6,154 +6,154 @@ package v1alpha1 -import xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" +import xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" // GetCondition of this Database. -func (mg *Database) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (mg *Database) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return mg.Status.GetCondition(ct) } // GetDeletionPolicy of this Database. -func (mg *Database) GetDeletionPolicy() xpv1.DeletionPolicy { +func (mg *Database) GetDeletionPolicy() xpv2.DeletionPolicy { return mg.Spec.DeletionPolicy } // GetManagementPolicies of this Database. -func (mg *Database) GetManagementPolicies() xpv1.ManagementPolicies { +func (mg *Database) GetManagementPolicies() xpv2.ManagementPolicies { return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Database. -func (mg *Database) GetProviderConfigReference() *xpv1.Reference { +func (mg *Database) GetProviderConfigReference() *xpv2.Reference { return mg.Spec.ProviderConfigReference } // GetWriteConnectionSecretToReference of this Database. -func (mg *Database) GetWriteConnectionSecretToReference() *xpv1.SecretReference { +func (mg *Database) GetWriteConnectionSecretToReference() *xpv2.SecretReference { return mg.Spec.WriteConnectionSecretToReference } // SetConditions of this Database. -func (mg *Database) SetConditions(c ...xpv1.Condition) { +func (mg *Database) SetConditions(c ...xpv2.Condition) { mg.Status.SetConditions(c...) } // SetDeletionPolicy of this Database. -func (mg *Database) SetDeletionPolicy(r xpv1.DeletionPolicy) { +func (mg *Database) SetDeletionPolicy(r xpv2.DeletionPolicy) { mg.Spec.DeletionPolicy = r } // SetManagementPolicies of this Database. -func (mg *Database) SetManagementPolicies(r xpv1.ManagementPolicies) { +func (mg *Database) SetManagementPolicies(r xpv2.ManagementPolicies) { mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Database. -func (mg *Database) SetProviderConfigReference(r *xpv1.Reference) { +func (mg *Database) SetProviderConfigReference(r *xpv2.Reference) { mg.Spec.ProviderConfigReference = r } // SetWriteConnectionSecretToReference of this Database. -func (mg *Database) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { +func (mg *Database) SetWriteConnectionSecretToReference(r *xpv2.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } // GetCondition of this Grant. -func (mg *Grant) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (mg *Grant) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return mg.Status.GetCondition(ct) } // GetDeletionPolicy of this Grant. -func (mg *Grant) GetDeletionPolicy() xpv1.DeletionPolicy { +func (mg *Grant) GetDeletionPolicy() xpv2.DeletionPolicy { return mg.Spec.DeletionPolicy } // GetManagementPolicies of this Grant. -func (mg *Grant) GetManagementPolicies() xpv1.ManagementPolicies { +func (mg *Grant) GetManagementPolicies() xpv2.ManagementPolicies { return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Grant. -func (mg *Grant) GetProviderConfigReference() *xpv1.Reference { +func (mg *Grant) GetProviderConfigReference() *xpv2.Reference { return mg.Spec.ProviderConfigReference } // GetWriteConnectionSecretToReference of this Grant. -func (mg *Grant) GetWriteConnectionSecretToReference() *xpv1.SecretReference { +func (mg *Grant) GetWriteConnectionSecretToReference() *xpv2.SecretReference { return mg.Spec.WriteConnectionSecretToReference } // SetConditions of this Grant. -func (mg *Grant) SetConditions(c ...xpv1.Condition) { +func (mg *Grant) SetConditions(c ...xpv2.Condition) { mg.Status.SetConditions(c...) } // SetDeletionPolicy of this Grant. -func (mg *Grant) SetDeletionPolicy(r xpv1.DeletionPolicy) { +func (mg *Grant) SetDeletionPolicy(r xpv2.DeletionPolicy) { mg.Spec.DeletionPolicy = r } // SetManagementPolicies of this Grant. -func (mg *Grant) SetManagementPolicies(r xpv1.ManagementPolicies) { +func (mg *Grant) SetManagementPolicies(r xpv2.ManagementPolicies) { mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Grant. -func (mg *Grant) SetProviderConfigReference(r *xpv1.Reference) { +func (mg *Grant) SetProviderConfigReference(r *xpv2.Reference) { mg.Spec.ProviderConfigReference = r } // SetWriteConnectionSecretToReference of this Grant. -func (mg *Grant) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { +func (mg *Grant) SetWriteConnectionSecretToReference(r *xpv2.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } // GetCondition of this User. -func (mg *User) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (mg *User) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return mg.Status.GetCondition(ct) } // GetDeletionPolicy of this User. -func (mg *User) GetDeletionPolicy() xpv1.DeletionPolicy { +func (mg *User) GetDeletionPolicy() xpv2.DeletionPolicy { return mg.Spec.DeletionPolicy } // GetManagementPolicies of this User. -func (mg *User) GetManagementPolicies() xpv1.ManagementPolicies { +func (mg *User) GetManagementPolicies() xpv2.ManagementPolicies { return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this User. -func (mg *User) GetProviderConfigReference() *xpv1.Reference { +func (mg *User) GetProviderConfigReference() *xpv2.Reference { return mg.Spec.ProviderConfigReference } // GetWriteConnectionSecretToReference of this User. -func (mg *User) GetWriteConnectionSecretToReference() *xpv1.SecretReference { +func (mg *User) GetWriteConnectionSecretToReference() *xpv2.SecretReference { return mg.Spec.WriteConnectionSecretToReference } // SetConditions of this User. -func (mg *User) SetConditions(c ...xpv1.Condition) { +func (mg *User) SetConditions(c ...xpv2.Condition) { mg.Status.SetConditions(c...) } // SetDeletionPolicy of this User. -func (mg *User) SetDeletionPolicy(r xpv1.DeletionPolicy) { +func (mg *User) SetDeletionPolicy(r xpv2.DeletionPolicy) { mg.Spec.DeletionPolicy = r } // SetManagementPolicies of this User. -func (mg *User) SetManagementPolicies(r xpv1.ManagementPolicies) { +func (mg *User) SetManagementPolicies(r xpv2.ManagementPolicies) { mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this User. -func (mg *User) SetProviderConfigReference(r *xpv1.Reference) { +func (mg *User) SetProviderConfigReference(r *xpv2.Reference) { mg.Spec.ProviderConfigReference = r } // SetWriteConnectionSecretToReference of this User. -func (mg *User) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { +func (mg *User) SetWriteConnectionSecretToReference(r *xpv2.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } diff --git a/apis/cluster/mssql/v1alpha1/zz_generated.pc.go b/apis/cluster/mssql/v1alpha1/zz_generated.pc.go index 436a0353..13503fc4 100644 --- a/apis/cluster/mssql/v1alpha1/zz_generated.pc.go +++ b/apis/cluster/mssql/v1alpha1/zz_generated.pc.go @@ -6,10 +6,10 @@ package v1alpha1 -import xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" +import xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" // GetCondition of this ProviderConfig. -func (p *ProviderConfig) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (p *ProviderConfig) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return p.Status.GetCondition(ct) } @@ -19,7 +19,7 @@ func (p *ProviderConfig) GetUsers() int64 { } // SetConditions of this ProviderConfig. -func (p *ProviderConfig) SetConditions(c ...xpv1.Condition) { +func (p *ProviderConfig) SetConditions(c ...xpv2.Condition) { p.Status.SetConditions(c...) } diff --git a/apis/cluster/mssql/v1alpha1/zz_generated.pcu.go b/apis/cluster/mssql/v1alpha1/zz_generated.pcu.go index 50035883..909fa454 100644 --- a/apis/cluster/mssql/v1alpha1/zz_generated.pcu.go +++ b/apis/cluster/mssql/v1alpha1/zz_generated.pcu.go @@ -6,24 +6,24 @@ package v1alpha1 -import xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" +import xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" // GetProviderConfigReference of this ProviderConfigUsage. -func (p *ProviderConfigUsage) GetProviderConfigReference() xpv1.Reference { +func (p *ProviderConfigUsage) GetProviderConfigReference() xpv2.Reference { return p.ProviderConfigReference } // GetResourceReference of this ProviderConfigUsage. -func (p *ProviderConfigUsage) GetResourceReference() xpv1.TypedReference { +func (p *ProviderConfigUsage) GetResourceReference() xpv2.TypedReference { return p.ResourceReference } // SetProviderConfigReference of this ProviderConfigUsage. -func (p *ProviderConfigUsage) SetProviderConfigReference(r xpv1.Reference) { +func (p *ProviderConfigUsage) SetProviderConfigReference(r xpv2.Reference) { p.ProviderConfigReference = r } // SetResourceReference of this ProviderConfigUsage. -func (p *ProviderConfigUsage) SetResourceReference(r xpv1.TypedReference) { +func (p *ProviderConfigUsage) SetResourceReference(r xpv2.TypedReference) { p.ResourceReference = r } diff --git a/apis/cluster/mssql/v1alpha1/zz_generated.resolvers.go b/apis/cluster/mssql/v1alpha1/zz_generated.resolvers.go deleted file mode 100644 index 8041d819..00000000 --- a/apis/cluster/mssql/v1alpha1/zz_generated.resolvers.go +++ /dev/null @@ -1,102 +0,0 @@ -// SPDX-FileCopyrightText: 2026 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by angryjet. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - reference "github.com/crossplane/crossplane-runtime/v2/pkg/reference" - errors "github.com/pkg/errors" - client "sigs.k8s.io/controller-runtime/pkg/client" -) - -// ResolveReferences of this Grant. -func (mg *Grant) ResolveReferences(ctx context.Context, c client.Reader) error { - r := reference.NewAPIResolver(c, mg) - - var rsp reference.ResolutionResponse - var err error - - rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.User), - Extract: reference.ExternalName(), - Namespace: mg.GetNamespace(), - Reference: mg.Spec.ForProvider.UserRef, - Selector: mg.Spec.ForProvider.UserSelector, - To: reference.To{ - List: &UserList{}, - Managed: &User{}, - }, - }) - if err != nil { - return errors.Wrap(err, "mg.Spec.ForProvider.User") - } - mg.Spec.ForProvider.User = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.ForProvider.UserRef = rsp.ResolvedReference - - rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.Database), - Extract: reference.ExternalName(), - Namespace: mg.GetNamespace(), - Reference: mg.Spec.ForProvider.DatabaseRef, - Selector: mg.Spec.ForProvider.DatabaseSelector, - To: reference.To{ - List: &DatabaseList{}, - Managed: &Database{}, - }, - }) - if err != nil { - return errors.Wrap(err, "mg.Spec.ForProvider.Database") - } - mg.Spec.ForProvider.Database = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.ForProvider.DatabaseRef = rsp.ResolvedReference - - return nil -} - -// ResolveReferences of this User. -func (mg *User) ResolveReferences(ctx context.Context, c client.Reader) error { - r := reference.NewAPIResolver(c, mg) - - var rsp reference.ResolutionResponse - var err error - - rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.Database), - Extract: reference.ExternalName(), - Namespace: mg.GetNamespace(), - Reference: mg.Spec.ForProvider.DatabaseRef, - Selector: mg.Spec.ForProvider.DatabaseSelector, - To: reference.To{ - List: &DatabaseList{}, - Managed: &Database{}, - }, - }) - if err != nil { - return errors.Wrap(err, "mg.Spec.ForProvider.Database") - } - mg.Spec.ForProvider.Database = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.ForProvider.DatabaseRef = rsp.ResolvedReference - - rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.LoginDatabase), - Extract: reference.ExternalName(), - Namespace: mg.GetNamespace(), - Reference: mg.Spec.ForProvider.LoginDatabaseRef, - Selector: mg.Spec.ForProvider.LoginDatabaseSelector, - To: reference.To{ - List: &DatabaseList{}, - Managed: &Database{}, - }, - }) - if err != nil { - return errors.Wrap(err, "mg.Spec.ForProvider.LoginDatabase") - } - mg.Spec.ForProvider.LoginDatabase = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.ForProvider.LoginDatabaseRef = rsp.ResolvedReference - - return nil -} diff --git a/apis/cluster/mysql/v1alpha1/database_types.go b/apis/cluster/mysql/v1alpha1/database_types.go index 41dd82c9..3f0081ce 100644 --- a/apis/cluster/mysql/v1alpha1/database_types.go +++ b/apis/cluster/mysql/v1alpha1/database_types.go @@ -19,19 +19,19 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" ) // A DatabaseSpec defines the desired state of a Database. type DatabaseSpec struct { - xpv1.ResourceSpec `json:",inline"` + xpv2.ClusterManagedResourceSpec `json:",inline"` // +optional ForProvider DatabaseParameters `json:"forProvider"` } // A DatabaseStatus represents the observed state of a Database. type DatabaseStatus struct { - xpv1.ResourceStatus `json:",inline"` + xpv2.ManagedResourceStatus `json:",inline"` } // DatabaseParameters define the desired state of a MySQL database instance. diff --git a/apis/cluster/mysql/v1alpha1/grant_types.go b/apis/cluster/mysql/v1alpha1/grant_types.go index 843e6e16..2c0c4a34 100644 --- a/apis/cluster/mysql/v1alpha1/grant_types.go +++ b/apis/cluster/mysql/v1alpha1/grant_types.go @@ -19,13 +19,13 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" ) // A GrantSpec defines the desired state of a Grant. type GrantSpec struct { - xpv1.ResourceSpec `json:",inline"` - ForProvider GrantParameters `json:"forProvider"` + xpv2.ClusterManagedResourceSpec `json:",inline"` + ForProvider GrantParameters `json:"forProvider"` } // GrantPrivilege represents a privilege to be granted @@ -64,12 +64,12 @@ type GrantParameters struct { // UserRef references the user object this grant is for. // +immutable // +optional - UserRef *xpv1.Reference `json:"userRef,omitempty"` + UserRef *xpv2.Reference `json:"userRef,omitempty"` // UserSelector selects a reference to a User this grant is for. // +immutable // +optional - UserSelector *xpv1.Selector `json:"userSelector,omitempty"` + UserSelector *xpv2.Selector `json:"userSelector,omitempty"` // Tables this grant is for, default *. // +optional @@ -83,12 +83,12 @@ type GrantParameters struct { // DatabaseRef references the database object this grant it for. // +immutable // +optional - DatabaseRef *xpv1.Reference `json:"databaseRef,omitempty"` + DatabaseRef *xpv2.Reference `json:"databaseRef,omitempty"` // DatabaseSelector selects a reference to a Database this grant is for. // +immutable // +optional - DatabaseSelector *xpv1.Selector `json:"databaseSelector,omitempty"` + DatabaseSelector *xpv2.Selector `json:"databaseSelector,omitempty"` // BinLog defines whether the create, delete, update operations of this grant are propagated to replicas. Defaults to true // +optional @@ -97,8 +97,8 @@ type GrantParameters struct { // A GrantStatus represents the observed state of a Grant. type GrantStatus struct { - xpv1.ResourceStatus `json:",inline"` - AtProvider GrantObservation `json:"atProvider,omitempty"` + xpv2.ManagedResourceStatus `json:",inline"` + AtProvider GrantObservation `json:"atProvider,omitempty"` } // A GrantObservation represents the observed state of a MySQL grant. diff --git a/apis/cluster/mysql/v1alpha1/provider_types.go b/apis/cluster/mysql/v1alpha1/provider_types.go index 4762126b..a6dc93fa 100644 --- a/apis/cluster/mysql/v1alpha1/provider_types.go +++ b/apis/cluster/mysql/v1alpha1/provider_types.go @@ -19,7 +19,7 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" ) // A ProviderConfigSpec defines the desired state of a ProviderConfig. @@ -51,26 +51,26 @@ type TLSConfig struct { // TLSSecret defines a reference to a K8s secret and its specific internal key that contains the TLS cert/keys in PEM format. type TLSSecret struct { - SecretRef xpv1.SecretKeySelector `json:"secretRef,omitempty"` + SecretRef xpv2.SecretKeySelector `json:"secretRef,omitempty"` } const ( // CredentialsSourceMySQLConnectionSecret indicates that a provider // should acquire credentials from a connection secret written by a managed // resource that represents a MySQL server. - CredentialsSourceMySQLConnectionSecret xpv1.CredentialsSource = "MySQLConnectionSecret" + CredentialsSourceMySQLConnectionSecret xpv2.CredentialsSource = "MySQLConnectionSecret" ) // ProviderCredentials required to authenticate. type ProviderCredentials struct { // Source of the provider credentials. // +kubebuilder:validation:Enum=MySQLConnectionSecret - Source xpv1.CredentialsSource `json:"source"` + Source xpv2.CredentialsSource `json:"source"` // A CredentialsSecretRef is a reference to a MySQL connection secret // that contains the credentials that must be used to connect to the // provider. +optional - ConnectionSecretRef *xpv1.SecretReference `json:"connectionSecretRef,omitempty"` + ConnectionSecretRef *xpv2.SecretReference `json:"connectionSecretRef,omitempty"` // SecretKeyMapping allows overriding the default secret key names used // to read credentials from the connection secret. When not specified, @@ -120,7 +120,7 @@ func (m *SecretKeyMapping) ToMap() map[string]string { // A ProviderConfigStatus reflects the observed state of a ProviderConfig. type ProviderConfigStatus struct { - xpv1.ProviderConfigStatus `json:",inline"` + xpv2.ProviderConfigStatus `json:",inline"` } // +kubebuilder:object:root=true @@ -159,7 +159,7 @@ type ProviderConfigUsage struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - xpv1.ProviderConfigUsage `json:",inline"` + xpv2.ProviderConfigUsage `json:",inline"` } // +kubebuilder:object:root=true diff --git a/apis/cluster/mysql/v1alpha1/user_types.go b/apis/cluster/mysql/v1alpha1/user_types.go index cae393f8..8eefc256 100644 --- a/apis/cluster/mysql/v1alpha1/user_types.go +++ b/apis/cluster/mysql/v1alpha1/user_types.go @@ -19,19 +19,19 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" ) // A UserSpec defines the desired state of a Database. type UserSpec struct { - xpv1.ResourceSpec `json:",inline"` - ForProvider UserParameters `json:"forProvider"` + xpv2.ClusterManagedResourceSpec `json:",inline"` + ForProvider UserParameters `json:"forProvider"` } // A UserStatus represents the observed state of a User. type UserStatus struct { - xpv1.ResourceStatus `json:",inline"` - AtProvider UserObservation `json:"atProvider,omitempty"` + xpv2.ManagedResourceStatus `json:",inline"` + AtProvider UserObservation `json:"atProvider,omitempty"` } // UserParameters define the desired state of a MySQL user instance. @@ -41,7 +41,7 @@ type UserParameters struct { // for this user. If no reference is given, a password will be auto-generated. // Cannot be set together with AuthenticationPlugin. // +optional - PasswordSecretRef *xpv1.SecretKeySelector `json:"passwordSecretRef,omitempty"` + PasswordSecretRef *xpv2.SecretKeySelector `json:"passwordSecretRef,omitempty"` // AuthenticationPlugin selects a non-default MySQL authentication plugin // for the user. When set, the user is created with diff --git a/apis/cluster/mysql/v1alpha1/zz_generated.deepcopy.go b/apis/cluster/mysql/v1alpha1/zz_generated.deepcopy.go index 965fffd8..49c34100 100644 --- a/apis/cluster/mysql/v1alpha1/zz_generated.deepcopy.go +++ b/apis/cluster/mysql/v1alpha1/zz_generated.deepcopy.go @@ -9,7 +9,7 @@ package v1alpha1 import ( - "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" + "github.com/crossplane/crossplane/apis/v2/core/v2" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -125,7 +125,7 @@ func (in *DatabaseParameters) DeepCopy() *DatabaseParameters { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DatabaseSpec) DeepCopyInto(out *DatabaseSpec) { *out = *in - in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ClusterManagedResourceSpec.DeepCopyInto(&out.ClusterManagedResourceSpec) in.ForProvider.DeepCopyInto(&out.ForProvider) } @@ -142,7 +142,7 @@ func (in *DatabaseSpec) DeepCopy() *DatabaseSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DatabaseStatus) DeepCopyInto(out *DatabaseStatus) { *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.ManagedResourceStatus.DeepCopyInto(&out.ManagedResourceStatus) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseStatus. @@ -249,12 +249,12 @@ func (in *GrantParameters) DeepCopyInto(out *GrantParameters) { } if in.UserRef != nil { in, out := &in.UserRef, &out.UserRef - *out = new(v1.Reference) + *out = new(v2.Reference) (*in).DeepCopyInto(*out) } if in.UserSelector != nil { in, out := &in.UserSelector, &out.UserSelector - *out = new(v1.Selector) + *out = new(v2.Selector) (*in).DeepCopyInto(*out) } if in.Table != nil { @@ -269,12 +269,12 @@ func (in *GrantParameters) DeepCopyInto(out *GrantParameters) { } if in.DatabaseRef != nil { in, out := &in.DatabaseRef, &out.DatabaseRef - *out = new(v1.Reference) + *out = new(v2.Reference) (*in).DeepCopyInto(*out) } if in.DatabaseSelector != nil { in, out := &in.DatabaseSelector, &out.DatabaseSelector - *out = new(v1.Selector) + *out = new(v2.Selector) (*in).DeepCopyInto(*out) } if in.BinLog != nil { @@ -316,7 +316,7 @@ func (in GrantPrivileges) DeepCopy() GrantPrivileges { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GrantSpec) DeepCopyInto(out *GrantSpec) { *out = *in - in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ClusterManagedResourceSpec.DeepCopyInto(&out.ClusterManagedResourceSpec) in.ForProvider.DeepCopyInto(&out.ForProvider) } @@ -333,7 +333,7 @@ func (in *GrantSpec) DeepCopy() *GrantSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GrantStatus) DeepCopyInto(out *GrantStatus) { *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.ManagedResourceStatus.DeepCopyInto(&out.ManagedResourceStatus) in.AtProvider.DeepCopyInto(&out.AtProvider) } @@ -418,7 +418,7 @@ func (in *ProviderConfigSpec) DeepCopyInto(out *ProviderConfigSpec) { if in.TLSConfig != nil { in, out := &in.TLSConfig, &out.TLSConfig *out = new(TLSConfig) - (*in).DeepCopyInto(*out) + **out = **in } } @@ -511,7 +511,7 @@ func (in *ProviderCredentials) DeepCopyInto(out *ProviderCredentials) { *out = *in if in.ConnectionSecretRef != nil { in, out := &in.ConnectionSecretRef, &out.ConnectionSecretRef - *out = new(v1.SecretReference) + *out = new(v2.SecretReference) **out = **in } if in.SecretKeyMapping != nil { @@ -584,9 +584,9 @@ func (in *SecretKeyMapping) DeepCopy() *SecretKeyMapping { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TLSConfig) DeepCopyInto(out *TLSConfig) { *out = *in - in.CACert.DeepCopyInto(&out.CACert) - in.ClientCert.DeepCopyInto(&out.ClientCert) - in.ClientKey.DeepCopyInto(&out.ClientKey) + out.CACert = in.CACert + out.ClientCert = in.ClientCert + out.ClientKey = in.ClientKey } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSConfig. @@ -602,7 +602,7 @@ func (in *TLSConfig) DeepCopy() *TLSConfig { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TLSSecret) DeepCopyInto(out *TLSSecret) { *out = *in - in.SecretRef.DeepCopyInto(&out.SecretRef) + out.SecretRef = in.SecretRef } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSSecret. @@ -704,7 +704,7 @@ func (in *UserParameters) DeepCopyInto(out *UserParameters) { *out = *in if in.PasswordSecretRef != nil { in, out := &in.PasswordSecretRef, &out.PasswordSecretRef - *out = new(v1.SecretKeySelector) + *out = new(v2.SecretKeySelector) **out = **in } if in.AuthenticationPlugin != nil { @@ -737,7 +737,7 @@ func (in *UserParameters) DeepCopy() *UserParameters { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *UserSpec) DeepCopyInto(out *UserSpec) { *out = *in - in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ClusterManagedResourceSpec.DeepCopyInto(&out.ClusterManagedResourceSpec) in.ForProvider.DeepCopyInto(&out.ForProvider) } @@ -754,7 +754,7 @@ func (in *UserSpec) DeepCopy() *UserSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *UserStatus) DeepCopyInto(out *UserStatus) { *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.ManagedResourceStatus.DeepCopyInto(&out.ManagedResourceStatus) in.AtProvider.DeepCopyInto(&out.AtProvider) } diff --git a/apis/cluster/mysql/v1alpha1/zz_generated.managed.go b/apis/cluster/mysql/v1alpha1/zz_generated.managed.go index 2793acae..88c67a4e 100644 --- a/apis/cluster/mysql/v1alpha1/zz_generated.managed.go +++ b/apis/cluster/mysql/v1alpha1/zz_generated.managed.go @@ -6,154 +6,154 @@ package v1alpha1 -import xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" +import xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" // GetCondition of this Database. -func (mg *Database) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (mg *Database) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return mg.Status.GetCondition(ct) } // GetDeletionPolicy of this Database. -func (mg *Database) GetDeletionPolicy() xpv1.DeletionPolicy { +func (mg *Database) GetDeletionPolicy() xpv2.DeletionPolicy { return mg.Spec.DeletionPolicy } // GetManagementPolicies of this Database. -func (mg *Database) GetManagementPolicies() xpv1.ManagementPolicies { +func (mg *Database) GetManagementPolicies() xpv2.ManagementPolicies { return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Database. -func (mg *Database) GetProviderConfigReference() *xpv1.Reference { +func (mg *Database) GetProviderConfigReference() *xpv2.Reference { return mg.Spec.ProviderConfigReference } // GetWriteConnectionSecretToReference of this Database. -func (mg *Database) GetWriteConnectionSecretToReference() *xpv1.SecretReference { +func (mg *Database) GetWriteConnectionSecretToReference() *xpv2.SecretReference { return mg.Spec.WriteConnectionSecretToReference } // SetConditions of this Database. -func (mg *Database) SetConditions(c ...xpv1.Condition) { +func (mg *Database) SetConditions(c ...xpv2.Condition) { mg.Status.SetConditions(c...) } // SetDeletionPolicy of this Database. -func (mg *Database) SetDeletionPolicy(r xpv1.DeletionPolicy) { +func (mg *Database) SetDeletionPolicy(r xpv2.DeletionPolicy) { mg.Spec.DeletionPolicy = r } // SetManagementPolicies of this Database. -func (mg *Database) SetManagementPolicies(r xpv1.ManagementPolicies) { +func (mg *Database) SetManagementPolicies(r xpv2.ManagementPolicies) { mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Database. -func (mg *Database) SetProviderConfigReference(r *xpv1.Reference) { +func (mg *Database) SetProviderConfigReference(r *xpv2.Reference) { mg.Spec.ProviderConfigReference = r } // SetWriteConnectionSecretToReference of this Database. -func (mg *Database) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { +func (mg *Database) SetWriteConnectionSecretToReference(r *xpv2.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } // GetCondition of this Grant. -func (mg *Grant) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (mg *Grant) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return mg.Status.GetCondition(ct) } // GetDeletionPolicy of this Grant. -func (mg *Grant) GetDeletionPolicy() xpv1.DeletionPolicy { +func (mg *Grant) GetDeletionPolicy() xpv2.DeletionPolicy { return mg.Spec.DeletionPolicy } // GetManagementPolicies of this Grant. -func (mg *Grant) GetManagementPolicies() xpv1.ManagementPolicies { +func (mg *Grant) GetManagementPolicies() xpv2.ManagementPolicies { return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Grant. -func (mg *Grant) GetProviderConfigReference() *xpv1.Reference { +func (mg *Grant) GetProviderConfigReference() *xpv2.Reference { return mg.Spec.ProviderConfigReference } // GetWriteConnectionSecretToReference of this Grant. -func (mg *Grant) GetWriteConnectionSecretToReference() *xpv1.SecretReference { +func (mg *Grant) GetWriteConnectionSecretToReference() *xpv2.SecretReference { return mg.Spec.WriteConnectionSecretToReference } // SetConditions of this Grant. -func (mg *Grant) SetConditions(c ...xpv1.Condition) { +func (mg *Grant) SetConditions(c ...xpv2.Condition) { mg.Status.SetConditions(c...) } // SetDeletionPolicy of this Grant. -func (mg *Grant) SetDeletionPolicy(r xpv1.DeletionPolicy) { +func (mg *Grant) SetDeletionPolicy(r xpv2.DeletionPolicy) { mg.Spec.DeletionPolicy = r } // SetManagementPolicies of this Grant. -func (mg *Grant) SetManagementPolicies(r xpv1.ManagementPolicies) { +func (mg *Grant) SetManagementPolicies(r xpv2.ManagementPolicies) { mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Grant. -func (mg *Grant) SetProviderConfigReference(r *xpv1.Reference) { +func (mg *Grant) SetProviderConfigReference(r *xpv2.Reference) { mg.Spec.ProviderConfigReference = r } // SetWriteConnectionSecretToReference of this Grant. -func (mg *Grant) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { +func (mg *Grant) SetWriteConnectionSecretToReference(r *xpv2.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } // GetCondition of this User. -func (mg *User) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (mg *User) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return mg.Status.GetCondition(ct) } // GetDeletionPolicy of this User. -func (mg *User) GetDeletionPolicy() xpv1.DeletionPolicy { +func (mg *User) GetDeletionPolicy() xpv2.DeletionPolicy { return mg.Spec.DeletionPolicy } // GetManagementPolicies of this User. -func (mg *User) GetManagementPolicies() xpv1.ManagementPolicies { +func (mg *User) GetManagementPolicies() xpv2.ManagementPolicies { return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this User. -func (mg *User) GetProviderConfigReference() *xpv1.Reference { +func (mg *User) GetProviderConfigReference() *xpv2.Reference { return mg.Spec.ProviderConfigReference } // GetWriteConnectionSecretToReference of this User. -func (mg *User) GetWriteConnectionSecretToReference() *xpv1.SecretReference { +func (mg *User) GetWriteConnectionSecretToReference() *xpv2.SecretReference { return mg.Spec.WriteConnectionSecretToReference } // SetConditions of this User. -func (mg *User) SetConditions(c ...xpv1.Condition) { +func (mg *User) SetConditions(c ...xpv2.Condition) { mg.Status.SetConditions(c...) } // SetDeletionPolicy of this User. -func (mg *User) SetDeletionPolicy(r xpv1.DeletionPolicy) { +func (mg *User) SetDeletionPolicy(r xpv2.DeletionPolicy) { mg.Spec.DeletionPolicy = r } // SetManagementPolicies of this User. -func (mg *User) SetManagementPolicies(r xpv1.ManagementPolicies) { +func (mg *User) SetManagementPolicies(r xpv2.ManagementPolicies) { mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this User. -func (mg *User) SetProviderConfigReference(r *xpv1.Reference) { +func (mg *User) SetProviderConfigReference(r *xpv2.Reference) { mg.Spec.ProviderConfigReference = r } // SetWriteConnectionSecretToReference of this User. -func (mg *User) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { +func (mg *User) SetWriteConnectionSecretToReference(r *xpv2.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } diff --git a/apis/cluster/mysql/v1alpha1/zz_generated.pc.go b/apis/cluster/mysql/v1alpha1/zz_generated.pc.go index 436a0353..13503fc4 100644 --- a/apis/cluster/mysql/v1alpha1/zz_generated.pc.go +++ b/apis/cluster/mysql/v1alpha1/zz_generated.pc.go @@ -6,10 +6,10 @@ package v1alpha1 -import xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" +import xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" // GetCondition of this ProviderConfig. -func (p *ProviderConfig) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (p *ProviderConfig) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return p.Status.GetCondition(ct) } @@ -19,7 +19,7 @@ func (p *ProviderConfig) GetUsers() int64 { } // SetConditions of this ProviderConfig. -func (p *ProviderConfig) SetConditions(c ...xpv1.Condition) { +func (p *ProviderConfig) SetConditions(c ...xpv2.Condition) { p.Status.SetConditions(c...) } diff --git a/apis/cluster/mysql/v1alpha1/zz_generated.pcu.go b/apis/cluster/mysql/v1alpha1/zz_generated.pcu.go index 50035883..909fa454 100644 --- a/apis/cluster/mysql/v1alpha1/zz_generated.pcu.go +++ b/apis/cluster/mysql/v1alpha1/zz_generated.pcu.go @@ -6,24 +6,24 @@ package v1alpha1 -import xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" +import xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" // GetProviderConfigReference of this ProviderConfigUsage. -func (p *ProviderConfigUsage) GetProviderConfigReference() xpv1.Reference { +func (p *ProviderConfigUsage) GetProviderConfigReference() xpv2.Reference { return p.ProviderConfigReference } // GetResourceReference of this ProviderConfigUsage. -func (p *ProviderConfigUsage) GetResourceReference() xpv1.TypedReference { +func (p *ProviderConfigUsage) GetResourceReference() xpv2.TypedReference { return p.ResourceReference } // SetProviderConfigReference of this ProviderConfigUsage. -func (p *ProviderConfigUsage) SetProviderConfigReference(r xpv1.Reference) { +func (p *ProviderConfigUsage) SetProviderConfigReference(r xpv2.Reference) { p.ProviderConfigReference = r } // SetResourceReference of this ProviderConfigUsage. -func (p *ProviderConfigUsage) SetResourceReference(r xpv1.TypedReference) { +func (p *ProviderConfigUsage) SetResourceReference(r xpv2.TypedReference) { p.ResourceReference = r } diff --git a/apis/cluster/mysql/v1alpha1/zz_generated.resolvers.go b/apis/cluster/mysql/v1alpha1/zz_generated.resolvers.go deleted file mode 100644 index 4509319d..00000000 --- a/apis/cluster/mysql/v1alpha1/zz_generated.resolvers.go +++ /dev/null @@ -1,58 +0,0 @@ -// SPDX-FileCopyrightText: 2026 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by angryjet. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - reference "github.com/crossplane/crossplane-runtime/v2/pkg/reference" - errors "github.com/pkg/errors" - client "sigs.k8s.io/controller-runtime/pkg/client" -) - -// ResolveReferences of this Grant. -func (mg *Grant) ResolveReferences(ctx context.Context, c client.Reader) error { - r := reference.NewAPIResolver(c, mg) - - var rsp reference.ResolutionResponse - var err error - - rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.User), - Extract: reference.ExternalName(), - Namespace: mg.GetNamespace(), - Reference: mg.Spec.ForProvider.UserRef, - Selector: mg.Spec.ForProvider.UserSelector, - To: reference.To{ - List: &UserList{}, - Managed: &User{}, - }, - }) - if err != nil { - return errors.Wrap(err, "mg.Spec.ForProvider.User") - } - mg.Spec.ForProvider.User = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.ForProvider.UserRef = rsp.ResolvedReference - - rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.Database), - Extract: reference.ExternalName(), - Namespace: mg.GetNamespace(), - Reference: mg.Spec.ForProvider.DatabaseRef, - Selector: mg.Spec.ForProvider.DatabaseSelector, - To: reference.To{ - List: &DatabaseList{}, - Managed: &Database{}, - }, - }) - if err != nil { - return errors.Wrap(err, "mg.Spec.ForProvider.Database") - } - mg.Spec.ForProvider.Database = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.ForProvider.DatabaseRef = rsp.ResolvedReference - - return nil -} diff --git a/apis/cluster/postgresql/v1alpha1/database_types.go b/apis/cluster/postgresql/v1alpha1/database_types.go index 462fcb4a..0454eb9d 100644 --- a/apis/cluster/postgresql/v1alpha1/database_types.go +++ b/apis/cluster/postgresql/v1alpha1/database_types.go @@ -19,7 +19,7 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" ) // DatabaseStrategy sets the method that is used to create a database. @@ -45,11 +45,11 @@ type DatabaseParameters struct { // OwnerRef references the role object that will own this database. // +optional - OwnerRef *xpv1.Reference `json:"ownerRef,omitempty"` + OwnerRef *xpv2.Reference `json:"ownerRef,omitempty"` // OwnerSelector selects a reference to a Role that will own this database. // +optional - OwnerSelector *xpv1.Selector `json:"ownerSelector,omitempty"` + OwnerSelector *xpv2.Selector `json:"ownerSelector,omitempty"` // The name of the template from which to create the new database, or // DEFAULT to use the default template (template1). @@ -105,13 +105,13 @@ type DatabaseParameters struct { // A DatabaseSpec defines the desired state of a Database. type DatabaseSpec struct { - xpv1.ResourceSpec `json:",inline"` - ForProvider DatabaseParameters `json:"forProvider"` + xpv2.ClusterManagedResourceSpec `json:",inline"` + ForProvider DatabaseParameters `json:"forProvider"` } // A DatabaseStatus represents the observed state of a Database. type DatabaseStatus struct { - xpv1.ResourceStatus `json:",inline"` + xpv2.ManagedResourceStatus `json:",inline"` } // +kubebuilder:object:root=true diff --git a/apis/cluster/postgresql/v1alpha1/default_privileges_types.go b/apis/cluster/postgresql/v1alpha1/default_privileges_types.go index 90e7e486..f51af42b 100644 --- a/apis/cluster/postgresql/v1alpha1/default_privileges_types.go +++ b/apis/cluster/postgresql/v1alpha1/default_privileges_types.go @@ -1,7 +1,7 @@ package v1alpha1 import ( - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -28,13 +28,13 @@ type DefaultPrivileges struct { // A DefaultPrivilegesSpec defines the desired state of a Default Grant. type DefaultPrivilegesSpec struct { - xpv1.ResourceSpec `json:",inline"` - ForProvider DefaultPrivilegesParameters `json:"forProvider"` + xpv2.ClusterManagedResourceSpec `json:",inline"` + ForProvider DefaultPrivilegesParameters `json:"forProvider"` } // A DefaultPrivilegesStatus represents the observed state of a Grant. type DefaultPrivilegesStatus struct { - xpv1.ResourceStatus `json:",inline"` + xpv2.ManagedResourceStatus `json:",inline"` } // DefaultPrivilegesParameters defines the desired state of a Default Grant. @@ -74,12 +74,12 @@ type DefaultPrivilegesParameters struct { // RoleRef to which default privileges are granted. // +immutable // +optional - RoleRef *xpv1.Reference `json:"roleRef,omitempty"` + RoleRef *xpv2.Reference `json:"roleRef,omitempty"` // RoleSelector selects a reference to a Role this default grant is for. // +immutable // +optional - RoleSelector *xpv1.Selector `json:"roleSelector,omitempty"` + RoleSelector *xpv2.Selector `json:"roleSelector,omitempty"` // Database in which the default privileges are applied // +optional @@ -89,12 +89,12 @@ type DefaultPrivilegesParameters struct { // DatabaseRef references the database object this default grant it for. // +immutable // +optional - DatabaseRef *xpv1.Reference `json:"databaseRef,omitempty"` + DatabaseRef *xpv2.Reference `json:"databaseRef,omitempty"` // DatabaseSelector selects a reference to a Database this grant is for. // +immutable // +optional - DatabaseSelector *xpv1.Selector `json:"databaseSelector,omitempty"` + DatabaseSelector *xpv2.Selector `json:"databaseSelector,omitempty"` // Schema in which the default privileges are applied. // Not applicable when objectType is schema. diff --git a/apis/cluster/postgresql/v1alpha1/extension_types.go b/apis/cluster/postgresql/v1alpha1/extension_types.go index b9c68d98..3b2bd745 100644 --- a/apis/cluster/postgresql/v1alpha1/extension_types.go +++ b/apis/cluster/postgresql/v1alpha1/extension_types.go @@ -19,7 +19,7 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" ) // ExtensionParameters are the configurable fields of a Extension. @@ -44,23 +44,23 @@ type ExtensionParameters struct { // DatabaseRef references the database object this extension is for. // +immutable // +optional - DatabaseRef *xpv1.Reference `json:"databaseRef,omitempty"` + DatabaseRef *xpv2.Reference `json:"databaseRef,omitempty"` // DatabaseSelector selects a reference to a Database this extension is for. // +immutable // +optional - DatabaseSelector *xpv1.Selector `json:"databaseSelector,omitempty"` + DatabaseSelector *xpv2.Selector `json:"databaseSelector,omitempty"` } // ExtensionSpec defines the desired state of an Extension. type ExtensionSpec struct { - xpv1.ResourceSpec `json:",inline"` - ForProvider ExtensionParameters `json:"forProvider"` + xpv2.ClusterManagedResourceSpec `json:",inline"` + ForProvider ExtensionParameters `json:"forProvider"` } // A ExtensionStatus represents the observed state of a Extension. type ExtensionStatus struct { - xpv1.ResourceStatus `json:",inline"` + xpv2.ManagedResourceStatus `json:",inline"` } // +kubebuilder:object:root=true diff --git a/apis/cluster/postgresql/v1alpha1/grant_types.go b/apis/cluster/postgresql/v1alpha1/grant_types.go index 21f542e6..aa6fd08c 100644 --- a/apis/cluster/postgresql/v1alpha1/grant_types.go +++ b/apis/cluster/postgresql/v1alpha1/grant_types.go @@ -23,8 +23,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" client "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" "github.com/crossplane/crossplane-runtime/v2/pkg/reference" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/pkg/errors" ) @@ -36,8 +36,8 @@ const ( // A GrantSpec defines the desired state of a Grant. type GrantSpec struct { - xpv1.ResourceSpec `json:",inline"` - ForProvider GrantParameters `json:"forProvider"` + xpv2.ClusterManagedResourceSpec `json:",inline"` + ForProvider GrantParameters `json:"forProvider"` } // GrantPrivilege represents a privilege to be granted @@ -324,12 +324,12 @@ type GrantParameters struct { // RoleRef references the role object this grant is for. // +immutable // +optional - RoleRef *xpv1.Reference `json:"roleRef,omitempty"` + RoleRef *xpv2.Reference `json:"roleRef,omitempty"` // RoleSelector selects a reference to a Role this grant is for. // +immutable // +optional - RoleSelector *xpv1.Selector `json:"roleSelector,omitempty"` + RoleSelector *xpv2.Selector `json:"roleSelector,omitempty"` // Database this grant is for. // +optional @@ -339,12 +339,12 @@ type GrantParameters struct { // DatabaseRef references the database object this grant it for. // +immutable // +optional - DatabaseRef *xpv1.Reference `json:"databaseRef,omitempty"` + DatabaseRef *xpv2.Reference `json:"databaseRef,omitempty"` // DatabaseSelector selects a reference to a Database this grant is for. // +immutable // +optional - DatabaseSelector *xpv1.Selector `json:"databaseSelector,omitempty"` + DatabaseSelector *xpv2.Selector `json:"databaseSelector,omitempty"` // Schema this grant is for. // +optional @@ -353,12 +353,12 @@ type GrantParameters struct { // SchemaRef references the schema object this grant it for. // +immutable // +optional - SchemaRef *xpv1.Reference `json:"schemaRef,omitempty"` + SchemaRef *xpv2.Reference `json:"schemaRef,omitempty"` // SchemaSelector selects a reference to a Schema this grant is for. // +immutable // +optional - SchemaSelector *xpv1.Selector `json:"schemaSelector,omitempty"` + SchemaSelector *xpv2.Selector `json:"schemaSelector,omitempty"` // MemberOf is the Role that this grant makes Role a member of. // +optional @@ -368,12 +368,12 @@ type GrantParameters struct { // MemberOfRef references the Role that this grant makes Role a member of. // +immutable // +optional - MemberOfRef *xpv1.Reference `json:"memberOfRef,omitempty"` + MemberOfRef *xpv2.Reference `json:"memberOfRef,omitempty"` // MemberOfSelector selects a reference to a Role that this grant makes Role a member of. // +immutable // +optional - MemberOfSelector *xpv1.Selector `json:"memberOfSelector,omitempty"` + MemberOfSelector *xpv2.Selector `json:"memberOfSelector,omitempty"` // RevokePublicOnDb apply the statement "REVOKE ALL ON DATABASE %s FROM PUBLIC" to make database unreachable from public // +optional @@ -420,7 +420,7 @@ type GrantParameters struct { // A GrantStatus represents the observed state of a Grant. type GrantStatus struct { - xpv1.ResourceStatus `json:",inline"` + xpv2.ManagedResourceStatus `json:",inline"` } // +kubebuilder:object:root=true diff --git a/apis/cluster/postgresql/v1alpha1/provider_types.go b/apis/cluster/postgresql/v1alpha1/provider_types.go index 66cf03dd..e6c993d9 100644 --- a/apis/cluster/postgresql/v1alpha1/provider_types.go +++ b/apis/cluster/postgresql/v1alpha1/provider_types.go @@ -19,7 +19,7 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" ) // A ProviderConfigSpec defines the desired state of a ProviderConfig. @@ -42,19 +42,19 @@ const ( // CredentialsSourcePostgreSQLConnectionSecret indicates that a provider // should acquire credentials from a connection secret written by a managed // resource that represents a PostgreSQL server. - CredentialsSourcePostgreSQLConnectionSecret xpv1.CredentialsSource = "PostgreSQLConnectionSecret" + CredentialsSourcePostgreSQLConnectionSecret xpv2.CredentialsSource = "PostgreSQLConnectionSecret" ) // ProviderCredentials required to authenticate. type ProviderCredentials struct { // Source of the provider credentials. // +kubebuilder:validation:Enum=PostgreSQLConnectionSecret - Source xpv1.CredentialsSource `json:"source"` + Source xpv2.CredentialsSource `json:"source"` // A CredentialsSecretRef is a reference to a PostgreSQL connection secret // that contains the credentials that must be used to connect to the // provider. +optional - ConnectionSecretRef *xpv1.SecretReference `json:"connectionSecretRef,omitempty"` + ConnectionSecretRef *xpv2.SecretReference `json:"connectionSecretRef,omitempty"` // SecretKeyMapping allows overriding the default secret key names used // to read credentials from the connection secret. When not specified, @@ -104,7 +104,7 @@ func (m *SecretKeyMapping) ToMap() map[string]string { // A ProviderConfigStatus reflects the observed state of a ProviderConfig. type ProviderConfigStatus struct { - xpv1.ProviderConfigStatus `json:",inline"` + xpv2.ProviderConfigStatus `json:",inline"` } // +kubebuilder:object:root=true @@ -143,7 +143,7 @@ type ProviderConfigUsage struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - xpv1.ProviderConfigUsage `json:",inline"` + xpv2.ProviderConfigUsage `json:",inline"` } // +kubebuilder:object:root=true diff --git a/apis/cluster/postgresql/v1alpha1/role_types.go b/apis/cluster/postgresql/v1alpha1/role_types.go index 0459a1fc..390128ff 100644 --- a/apis/cluster/postgresql/v1alpha1/role_types.go +++ b/apis/cluster/postgresql/v1alpha1/role_types.go @@ -19,19 +19,19 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" ) // A RoleSpec defines the desired state of a Role. type RoleSpec struct { - xpv1.ResourceSpec `json:",inline"` - ForProvider RoleParameters `json:"forProvider"` + xpv2.ClusterManagedResourceSpec `json:",inline"` + ForProvider RoleParameters `json:"forProvider"` } // A RoleStatus represents the observed state of a Role. type RoleStatus struct { - xpv1.ResourceStatus `json:",inline"` - AtProvider RoleObservation `json:"atProvider,omitempty"` + xpv2.ManagedResourceStatus `json:",inline"` + AtProvider RoleObservation `json:"atProvider,omitempty"` } // RolePrivilege is the PostgreSQL identifier to add or remove a permission @@ -82,7 +82,7 @@ type RoleParameters struct { // PasswordSecretRef references the secret that contains the password used // for this role. If no reference is given, a password will be auto-generated. // +optional - PasswordSecretRef *xpv1.SecretKeySelector `json:"passwordSecretRef,omitempty"` + PasswordSecretRef *xpv2.SecretKeySelector `json:"passwordSecretRef,omitempty"` // ConfigurationParameters to be applied to the role. If specified, any other configuration parameters set on the // role in the database will be reset. diff --git a/apis/cluster/postgresql/v1alpha1/schema_types.go b/apis/cluster/postgresql/v1alpha1/schema_types.go index 24a8111b..40d3fdac 100644 --- a/apis/cluster/postgresql/v1alpha1/schema_types.go +++ b/apis/cluster/postgresql/v1alpha1/schema_types.go @@ -19,7 +19,7 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" ) // DropBehavior sets the method that is used to drop a schema. @@ -34,8 +34,8 @@ const ( // A SchemaSpec defines the desired state of a Schema. type SchemaSpec struct { - xpv1.ResourceSpec `json:",inline"` - ForProvider SchemaParameters `json:"forProvider"` + xpv2.ClusterManagedResourceSpec `json:",inline"` + ForProvider SchemaParameters `json:"forProvider"` } // SchemaParameters define the desired state of a PostgreSQL schema. @@ -48,12 +48,12 @@ type SchemaParameters struct { // RoleRef references the role object this schema is for. // +immutable // +optional - RoleRef *xpv1.Reference `json:"roleRef,omitempty"` + RoleRef *xpv2.Reference `json:"roleRef,omitempty"` // RoleSelector selects a reference to a Role this schema is for. // +immutable // +optional - RoleSelector *xpv1.Selector `json:"roleSelector,omitempty"` + RoleSelector *xpv2.Selector `json:"roleSelector,omitempty"` // Database this schema is for. // +optional @@ -63,12 +63,12 @@ type SchemaParameters struct { // DatabaseRef references the database object this schema is for. // +immutable // +optional - DatabaseRef *xpv1.Reference `json:"databaseRef,omitempty"` + DatabaseRef *xpv2.Reference `json:"databaseRef,omitempty"` // DatabaseSelector selects a reference to a Database this schema is for. // +immutable // +optional - DatabaseSelector *xpv1.Selector `json:"databaseSelector,omitempty"` + DatabaseSelector *xpv2.Selector `json:"databaseSelector,omitempty"` // RevokePublicOnSchema apply a "REVOKE ALL ON SCHEMA public FROM public" statement // +optional @@ -86,7 +86,7 @@ type SchemaParameters struct { // A SchemaStatus represents the observed state of a Schema. type SchemaStatus struct { - xpv1.ResourceStatus `json:",inline"` + xpv2.ManagedResourceStatus `json:",inline"` } // +kubebuilder:object:root=true diff --git a/apis/cluster/postgresql/v1alpha1/zz_generated.deepcopy.go b/apis/cluster/postgresql/v1alpha1/zz_generated.deepcopy.go index d7203aa1..e4faa028 100644 --- a/apis/cluster/postgresql/v1alpha1/zz_generated.deepcopy.go +++ b/apis/cluster/postgresql/v1alpha1/zz_generated.deepcopy.go @@ -9,7 +9,7 @@ package v1alpha1 import ( - "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" + "github.com/crossplane/crossplane/apis/v2/core/v2" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -82,12 +82,12 @@ func (in *DatabaseParameters) DeepCopyInto(out *DatabaseParameters) { } if in.OwnerRef != nil { in, out := &in.OwnerRef, &out.OwnerRef - *out = new(v1.Reference) + *out = new(v2.Reference) (*in).DeepCopyInto(*out) } if in.OwnerSelector != nil { in, out := &in.OwnerSelector, &out.OwnerSelector - *out = new(v1.Selector) + *out = new(v2.Selector) (*in).DeepCopyInto(*out) } if in.Template != nil { @@ -150,7 +150,7 @@ func (in *DatabaseParameters) DeepCopy() *DatabaseParameters { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DatabaseSpec) DeepCopyInto(out *DatabaseSpec) { *out = *in - in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ClusterManagedResourceSpec.DeepCopyInto(&out.ClusterManagedResourceSpec) in.ForProvider.DeepCopyInto(&out.ForProvider) } @@ -167,7 +167,7 @@ func (in *DatabaseSpec) DeepCopy() *DatabaseSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DatabaseStatus) DeepCopyInto(out *DatabaseStatus) { *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.ManagedResourceStatus.DeepCopyInto(&out.ManagedResourceStatus) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseStatus. @@ -269,12 +269,12 @@ func (in *DefaultPrivilegesParameters) DeepCopyInto(out *DefaultPrivilegesParame } if in.RoleRef != nil { in, out := &in.RoleRef, &out.RoleRef - *out = new(v1.Reference) + *out = new(v2.Reference) (*in).DeepCopyInto(*out) } if in.RoleSelector != nil { in, out := &in.RoleSelector, &out.RoleSelector - *out = new(v1.Selector) + *out = new(v2.Selector) (*in).DeepCopyInto(*out) } if in.Database != nil { @@ -284,12 +284,12 @@ func (in *DefaultPrivilegesParameters) DeepCopyInto(out *DefaultPrivilegesParame } if in.DatabaseRef != nil { in, out := &in.DatabaseRef, &out.DatabaseRef - *out = new(v1.Reference) + *out = new(v2.Reference) (*in).DeepCopyInto(*out) } if in.DatabaseSelector != nil { in, out := &in.DatabaseSelector, &out.DatabaseSelector - *out = new(v1.Selector) + *out = new(v2.Selector) (*in).DeepCopyInto(*out) } if in.Schema != nil { @@ -312,7 +312,7 @@ func (in *DefaultPrivilegesParameters) DeepCopy() *DefaultPrivilegesParameters { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DefaultPrivilegesSpec) DeepCopyInto(out *DefaultPrivilegesSpec) { *out = *in - in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ClusterManagedResourceSpec.DeepCopyInto(&out.ClusterManagedResourceSpec) in.ForProvider.DeepCopyInto(&out.ForProvider) } @@ -329,7 +329,7 @@ func (in *DefaultPrivilegesSpec) DeepCopy() *DefaultPrivilegesSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DefaultPrivilegesStatus) DeepCopyInto(out *DefaultPrivilegesStatus) { *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.ManagedResourceStatus.DeepCopyInto(&out.ManagedResourceStatus) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DefaultPrivilegesStatus. @@ -421,12 +421,12 @@ func (in *ExtensionParameters) DeepCopyInto(out *ExtensionParameters) { } if in.DatabaseRef != nil { in, out := &in.DatabaseRef, &out.DatabaseRef - *out = new(v1.Reference) + *out = new(v2.Reference) (*in).DeepCopyInto(*out) } if in.DatabaseSelector != nil { in, out := &in.DatabaseSelector, &out.DatabaseSelector - *out = new(v1.Selector) + *out = new(v2.Selector) (*in).DeepCopyInto(*out) } } @@ -444,7 +444,7 @@ func (in *ExtensionParameters) DeepCopy() *ExtensionParameters { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExtensionSpec) DeepCopyInto(out *ExtensionSpec) { *out = *in - in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ClusterManagedResourceSpec.DeepCopyInto(&out.ClusterManagedResourceSpec) in.ForProvider.DeepCopyInto(&out.ForProvider) } @@ -461,7 +461,7 @@ func (in *ExtensionSpec) DeepCopy() *ExtensionSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExtensionStatus) DeepCopyInto(out *ExtensionStatus) { *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.ManagedResourceStatus.DeepCopyInto(&out.ManagedResourceStatus) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionStatus. @@ -553,12 +553,12 @@ func (in *GrantParameters) DeepCopyInto(out *GrantParameters) { } if in.RoleRef != nil { in, out := &in.RoleRef, &out.RoleRef - *out = new(v1.Reference) + *out = new(v2.Reference) (*in).DeepCopyInto(*out) } if in.RoleSelector != nil { in, out := &in.RoleSelector, &out.RoleSelector - *out = new(v1.Selector) + *out = new(v2.Selector) (*in).DeepCopyInto(*out) } if in.Database != nil { @@ -568,12 +568,12 @@ func (in *GrantParameters) DeepCopyInto(out *GrantParameters) { } if in.DatabaseRef != nil { in, out := &in.DatabaseRef, &out.DatabaseRef - *out = new(v1.Reference) + *out = new(v2.Reference) (*in).DeepCopyInto(*out) } if in.DatabaseSelector != nil { in, out := &in.DatabaseSelector, &out.DatabaseSelector - *out = new(v1.Selector) + *out = new(v2.Selector) (*in).DeepCopyInto(*out) } if in.Schema != nil { @@ -583,12 +583,12 @@ func (in *GrantParameters) DeepCopyInto(out *GrantParameters) { } if in.SchemaRef != nil { in, out := &in.SchemaRef, &out.SchemaRef - *out = new(v1.Reference) + *out = new(v2.Reference) (*in).DeepCopyInto(*out) } if in.SchemaSelector != nil { in, out := &in.SchemaSelector, &out.SchemaSelector - *out = new(v1.Selector) + *out = new(v2.Selector) (*in).DeepCopyInto(*out) } if in.MemberOf != nil { @@ -598,12 +598,12 @@ func (in *GrantParameters) DeepCopyInto(out *GrantParameters) { } if in.MemberOfRef != nil { in, out := &in.MemberOfRef, &out.MemberOfRef - *out = new(v1.Reference) + *out = new(v2.Reference) (*in).DeepCopyInto(*out) } if in.MemberOfSelector != nil { in, out := &in.MemberOfSelector, &out.MemberOfSelector - *out = new(v1.Selector) + *out = new(v2.Selector) (*in).DeepCopyInto(*out) } if in.RevokePublicOnDb != nil { @@ -682,7 +682,7 @@ func (in GrantPrivileges) DeepCopy() GrantPrivileges { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GrantSpec) DeepCopyInto(out *GrantSpec) { *out = *in - in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ClusterManagedResourceSpec.DeepCopyInto(&out.ClusterManagedResourceSpec) in.ForProvider.DeepCopyInto(&out.ForProvider) } @@ -699,7 +699,7 @@ func (in *GrantSpec) DeepCopy() *GrantSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GrantStatus) DeepCopyInto(out *GrantStatus) { *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.ManagedResourceStatus.DeepCopyInto(&out.ManagedResourceStatus) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GrantStatus. @@ -871,7 +871,7 @@ func (in *ProviderCredentials) DeepCopyInto(out *ProviderCredentials) { *out = *in if in.ConnectionSecretRef != nil { in, out := &in.ConnectionSecretRef, &out.ConnectionSecretRef - *out = new(v1.SecretReference) + *out = new(v2.SecretReference) **out = **in } if in.SecretKeyMapping != nil { @@ -1009,7 +1009,7 @@ func (in *RoleParameters) DeepCopyInto(out *RoleParameters) { in.Privileges.DeepCopyInto(&out.Privileges) if in.PasswordSecretRef != nil { in, out := &in.PasswordSecretRef, &out.PasswordSecretRef - *out = new(v1.SecretKeySelector) + *out = new(v2.SecretKeySelector) **out = **in } if in.ConfigurationParameters != nil { @@ -1090,7 +1090,7 @@ func (in *RolePrivilege) DeepCopy() *RolePrivilege { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RoleSpec) DeepCopyInto(out *RoleSpec) { *out = *in - in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ClusterManagedResourceSpec.DeepCopyInto(&out.ClusterManagedResourceSpec) in.ForProvider.DeepCopyInto(&out.ForProvider) } @@ -1107,7 +1107,7 @@ func (in *RoleSpec) DeepCopy() *RoleSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RoleStatus) DeepCopyInto(out *RoleStatus) { *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.ManagedResourceStatus.DeepCopyInto(&out.ManagedResourceStatus) in.AtProvider.DeepCopyInto(&out.AtProvider) } @@ -1210,12 +1210,12 @@ func (in *SchemaParameters) DeepCopyInto(out *SchemaParameters) { } if in.RoleRef != nil { in, out := &in.RoleRef, &out.RoleRef - *out = new(v1.Reference) + *out = new(v2.Reference) (*in).DeepCopyInto(*out) } if in.RoleSelector != nil { in, out := &in.RoleSelector, &out.RoleSelector - *out = new(v1.Selector) + *out = new(v2.Selector) (*in).DeepCopyInto(*out) } if in.Database != nil { @@ -1225,12 +1225,12 @@ func (in *SchemaParameters) DeepCopyInto(out *SchemaParameters) { } if in.DatabaseRef != nil { in, out := &in.DatabaseRef, &out.DatabaseRef - *out = new(v1.Reference) + *out = new(v2.Reference) (*in).DeepCopyInto(*out) } if in.DatabaseSelector != nil { in, out := &in.DatabaseSelector, &out.DatabaseSelector - *out = new(v1.Selector) + *out = new(v2.Selector) (*in).DeepCopyInto(*out) } if in.RevokePublicOnSchema != nil { @@ -1258,7 +1258,7 @@ func (in *SchemaParameters) DeepCopy() *SchemaParameters { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SchemaSpec) DeepCopyInto(out *SchemaSpec) { *out = *in - in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ClusterManagedResourceSpec.DeepCopyInto(&out.ClusterManagedResourceSpec) in.ForProvider.DeepCopyInto(&out.ForProvider) } @@ -1275,7 +1275,7 @@ func (in *SchemaSpec) DeepCopy() *SchemaSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SchemaStatus) DeepCopyInto(out *SchemaStatus) { *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.ManagedResourceStatus.DeepCopyInto(&out.ManagedResourceStatus) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchemaStatus. diff --git a/apis/cluster/postgresql/v1alpha1/zz_generated.managed.go b/apis/cluster/postgresql/v1alpha1/zz_generated.managed.go index f47eccee..c7ab1f38 100644 --- a/apis/cluster/postgresql/v1alpha1/zz_generated.managed.go +++ b/apis/cluster/postgresql/v1alpha1/zz_generated.managed.go @@ -6,304 +6,304 @@ package v1alpha1 -import xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" +import xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" // GetCondition of this Database. -func (mg *Database) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (mg *Database) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return mg.Status.GetCondition(ct) } // GetDeletionPolicy of this Database. -func (mg *Database) GetDeletionPolicy() xpv1.DeletionPolicy { +func (mg *Database) GetDeletionPolicy() xpv2.DeletionPolicy { return mg.Spec.DeletionPolicy } // GetManagementPolicies of this Database. -func (mg *Database) GetManagementPolicies() xpv1.ManagementPolicies { +func (mg *Database) GetManagementPolicies() xpv2.ManagementPolicies { return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Database. -func (mg *Database) GetProviderConfigReference() *xpv1.Reference { +func (mg *Database) GetProviderConfigReference() *xpv2.Reference { return mg.Spec.ProviderConfigReference } // GetWriteConnectionSecretToReference of this Database. -func (mg *Database) GetWriteConnectionSecretToReference() *xpv1.SecretReference { +func (mg *Database) GetWriteConnectionSecretToReference() *xpv2.SecretReference { return mg.Spec.WriteConnectionSecretToReference } // SetConditions of this Database. -func (mg *Database) SetConditions(c ...xpv1.Condition) { +func (mg *Database) SetConditions(c ...xpv2.Condition) { mg.Status.SetConditions(c...) } // SetDeletionPolicy of this Database. -func (mg *Database) SetDeletionPolicy(r xpv1.DeletionPolicy) { +func (mg *Database) SetDeletionPolicy(r xpv2.DeletionPolicy) { mg.Spec.DeletionPolicy = r } // SetManagementPolicies of this Database. -func (mg *Database) SetManagementPolicies(r xpv1.ManagementPolicies) { +func (mg *Database) SetManagementPolicies(r xpv2.ManagementPolicies) { mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Database. -func (mg *Database) SetProviderConfigReference(r *xpv1.Reference) { +func (mg *Database) SetProviderConfigReference(r *xpv2.Reference) { mg.Spec.ProviderConfigReference = r } // SetWriteConnectionSecretToReference of this Database. -func (mg *Database) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { +func (mg *Database) SetWriteConnectionSecretToReference(r *xpv2.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } // GetCondition of this DefaultPrivileges. -func (mg *DefaultPrivileges) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (mg *DefaultPrivileges) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return mg.Status.GetCondition(ct) } // GetDeletionPolicy of this DefaultPrivileges. -func (mg *DefaultPrivileges) GetDeletionPolicy() xpv1.DeletionPolicy { +func (mg *DefaultPrivileges) GetDeletionPolicy() xpv2.DeletionPolicy { return mg.Spec.DeletionPolicy } // GetManagementPolicies of this DefaultPrivileges. -func (mg *DefaultPrivileges) GetManagementPolicies() xpv1.ManagementPolicies { +func (mg *DefaultPrivileges) GetManagementPolicies() xpv2.ManagementPolicies { return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this DefaultPrivileges. -func (mg *DefaultPrivileges) GetProviderConfigReference() *xpv1.Reference { +func (mg *DefaultPrivileges) GetProviderConfigReference() *xpv2.Reference { return mg.Spec.ProviderConfigReference } // GetWriteConnectionSecretToReference of this DefaultPrivileges. -func (mg *DefaultPrivileges) GetWriteConnectionSecretToReference() *xpv1.SecretReference { +func (mg *DefaultPrivileges) GetWriteConnectionSecretToReference() *xpv2.SecretReference { return mg.Spec.WriteConnectionSecretToReference } // SetConditions of this DefaultPrivileges. -func (mg *DefaultPrivileges) SetConditions(c ...xpv1.Condition) { +func (mg *DefaultPrivileges) SetConditions(c ...xpv2.Condition) { mg.Status.SetConditions(c...) } // SetDeletionPolicy of this DefaultPrivileges. -func (mg *DefaultPrivileges) SetDeletionPolicy(r xpv1.DeletionPolicy) { +func (mg *DefaultPrivileges) SetDeletionPolicy(r xpv2.DeletionPolicy) { mg.Spec.DeletionPolicy = r } // SetManagementPolicies of this DefaultPrivileges. -func (mg *DefaultPrivileges) SetManagementPolicies(r xpv1.ManagementPolicies) { +func (mg *DefaultPrivileges) SetManagementPolicies(r xpv2.ManagementPolicies) { mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this DefaultPrivileges. -func (mg *DefaultPrivileges) SetProviderConfigReference(r *xpv1.Reference) { +func (mg *DefaultPrivileges) SetProviderConfigReference(r *xpv2.Reference) { mg.Spec.ProviderConfigReference = r } // SetWriteConnectionSecretToReference of this DefaultPrivileges. -func (mg *DefaultPrivileges) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { +func (mg *DefaultPrivileges) SetWriteConnectionSecretToReference(r *xpv2.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } // GetCondition of this Extension. -func (mg *Extension) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (mg *Extension) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return mg.Status.GetCondition(ct) } // GetDeletionPolicy of this Extension. -func (mg *Extension) GetDeletionPolicy() xpv1.DeletionPolicy { +func (mg *Extension) GetDeletionPolicy() xpv2.DeletionPolicy { return mg.Spec.DeletionPolicy } // GetManagementPolicies of this Extension. -func (mg *Extension) GetManagementPolicies() xpv1.ManagementPolicies { +func (mg *Extension) GetManagementPolicies() xpv2.ManagementPolicies { return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Extension. -func (mg *Extension) GetProviderConfigReference() *xpv1.Reference { +func (mg *Extension) GetProviderConfigReference() *xpv2.Reference { return mg.Spec.ProviderConfigReference } // GetWriteConnectionSecretToReference of this Extension. -func (mg *Extension) GetWriteConnectionSecretToReference() *xpv1.SecretReference { +func (mg *Extension) GetWriteConnectionSecretToReference() *xpv2.SecretReference { return mg.Spec.WriteConnectionSecretToReference } // SetConditions of this Extension. -func (mg *Extension) SetConditions(c ...xpv1.Condition) { +func (mg *Extension) SetConditions(c ...xpv2.Condition) { mg.Status.SetConditions(c...) } // SetDeletionPolicy of this Extension. -func (mg *Extension) SetDeletionPolicy(r xpv1.DeletionPolicy) { +func (mg *Extension) SetDeletionPolicy(r xpv2.DeletionPolicy) { mg.Spec.DeletionPolicy = r } // SetManagementPolicies of this Extension. -func (mg *Extension) SetManagementPolicies(r xpv1.ManagementPolicies) { +func (mg *Extension) SetManagementPolicies(r xpv2.ManagementPolicies) { mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Extension. -func (mg *Extension) SetProviderConfigReference(r *xpv1.Reference) { +func (mg *Extension) SetProviderConfigReference(r *xpv2.Reference) { mg.Spec.ProviderConfigReference = r } // SetWriteConnectionSecretToReference of this Extension. -func (mg *Extension) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { +func (mg *Extension) SetWriteConnectionSecretToReference(r *xpv2.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } // GetCondition of this Grant. -func (mg *Grant) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (mg *Grant) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return mg.Status.GetCondition(ct) } // GetDeletionPolicy of this Grant. -func (mg *Grant) GetDeletionPolicy() xpv1.DeletionPolicy { +func (mg *Grant) GetDeletionPolicy() xpv2.DeletionPolicy { return mg.Spec.DeletionPolicy } // GetManagementPolicies of this Grant. -func (mg *Grant) GetManagementPolicies() xpv1.ManagementPolicies { +func (mg *Grant) GetManagementPolicies() xpv2.ManagementPolicies { return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Grant. -func (mg *Grant) GetProviderConfigReference() *xpv1.Reference { +func (mg *Grant) GetProviderConfigReference() *xpv2.Reference { return mg.Spec.ProviderConfigReference } // GetWriteConnectionSecretToReference of this Grant. -func (mg *Grant) GetWriteConnectionSecretToReference() *xpv1.SecretReference { +func (mg *Grant) GetWriteConnectionSecretToReference() *xpv2.SecretReference { return mg.Spec.WriteConnectionSecretToReference } // SetConditions of this Grant. -func (mg *Grant) SetConditions(c ...xpv1.Condition) { +func (mg *Grant) SetConditions(c ...xpv2.Condition) { mg.Status.SetConditions(c...) } // SetDeletionPolicy of this Grant. -func (mg *Grant) SetDeletionPolicy(r xpv1.DeletionPolicy) { +func (mg *Grant) SetDeletionPolicy(r xpv2.DeletionPolicy) { mg.Spec.DeletionPolicy = r } // SetManagementPolicies of this Grant. -func (mg *Grant) SetManagementPolicies(r xpv1.ManagementPolicies) { +func (mg *Grant) SetManagementPolicies(r xpv2.ManagementPolicies) { mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Grant. -func (mg *Grant) SetProviderConfigReference(r *xpv1.Reference) { +func (mg *Grant) SetProviderConfigReference(r *xpv2.Reference) { mg.Spec.ProviderConfigReference = r } // SetWriteConnectionSecretToReference of this Grant. -func (mg *Grant) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { +func (mg *Grant) SetWriteConnectionSecretToReference(r *xpv2.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } // GetCondition of this Role. -func (mg *Role) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (mg *Role) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return mg.Status.GetCondition(ct) } // GetDeletionPolicy of this Role. -func (mg *Role) GetDeletionPolicy() xpv1.DeletionPolicy { +func (mg *Role) GetDeletionPolicy() xpv2.DeletionPolicy { return mg.Spec.DeletionPolicy } // GetManagementPolicies of this Role. -func (mg *Role) GetManagementPolicies() xpv1.ManagementPolicies { +func (mg *Role) GetManagementPolicies() xpv2.ManagementPolicies { return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Role. -func (mg *Role) GetProviderConfigReference() *xpv1.Reference { +func (mg *Role) GetProviderConfigReference() *xpv2.Reference { return mg.Spec.ProviderConfigReference } // GetWriteConnectionSecretToReference of this Role. -func (mg *Role) GetWriteConnectionSecretToReference() *xpv1.SecretReference { +func (mg *Role) GetWriteConnectionSecretToReference() *xpv2.SecretReference { return mg.Spec.WriteConnectionSecretToReference } // SetConditions of this Role. -func (mg *Role) SetConditions(c ...xpv1.Condition) { +func (mg *Role) SetConditions(c ...xpv2.Condition) { mg.Status.SetConditions(c...) } // SetDeletionPolicy of this Role. -func (mg *Role) SetDeletionPolicy(r xpv1.DeletionPolicy) { +func (mg *Role) SetDeletionPolicy(r xpv2.DeletionPolicy) { mg.Spec.DeletionPolicy = r } // SetManagementPolicies of this Role. -func (mg *Role) SetManagementPolicies(r xpv1.ManagementPolicies) { +func (mg *Role) SetManagementPolicies(r xpv2.ManagementPolicies) { mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Role. -func (mg *Role) SetProviderConfigReference(r *xpv1.Reference) { +func (mg *Role) SetProviderConfigReference(r *xpv2.Reference) { mg.Spec.ProviderConfigReference = r } // SetWriteConnectionSecretToReference of this Role. -func (mg *Role) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { +func (mg *Role) SetWriteConnectionSecretToReference(r *xpv2.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } // GetCondition of this Schema. -func (mg *Schema) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (mg *Schema) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return mg.Status.GetCondition(ct) } // GetDeletionPolicy of this Schema. -func (mg *Schema) GetDeletionPolicy() xpv1.DeletionPolicy { +func (mg *Schema) GetDeletionPolicy() xpv2.DeletionPolicy { return mg.Spec.DeletionPolicy } // GetManagementPolicies of this Schema. -func (mg *Schema) GetManagementPolicies() xpv1.ManagementPolicies { +func (mg *Schema) GetManagementPolicies() xpv2.ManagementPolicies { return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Schema. -func (mg *Schema) GetProviderConfigReference() *xpv1.Reference { +func (mg *Schema) GetProviderConfigReference() *xpv2.Reference { return mg.Spec.ProviderConfigReference } // GetWriteConnectionSecretToReference of this Schema. -func (mg *Schema) GetWriteConnectionSecretToReference() *xpv1.SecretReference { +func (mg *Schema) GetWriteConnectionSecretToReference() *xpv2.SecretReference { return mg.Spec.WriteConnectionSecretToReference } // SetConditions of this Schema. -func (mg *Schema) SetConditions(c ...xpv1.Condition) { +func (mg *Schema) SetConditions(c ...xpv2.Condition) { mg.Status.SetConditions(c...) } // SetDeletionPolicy of this Schema. -func (mg *Schema) SetDeletionPolicy(r xpv1.DeletionPolicy) { +func (mg *Schema) SetDeletionPolicy(r xpv2.DeletionPolicy) { mg.Spec.DeletionPolicy = r } // SetManagementPolicies of this Schema. -func (mg *Schema) SetManagementPolicies(r xpv1.ManagementPolicies) { +func (mg *Schema) SetManagementPolicies(r xpv2.ManagementPolicies) { mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Schema. -func (mg *Schema) SetProviderConfigReference(r *xpv1.Reference) { +func (mg *Schema) SetProviderConfigReference(r *xpv2.Reference) { mg.Spec.ProviderConfigReference = r } // SetWriteConnectionSecretToReference of this Schema. -func (mg *Schema) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { +func (mg *Schema) SetWriteConnectionSecretToReference(r *xpv2.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } diff --git a/apis/cluster/postgresql/v1alpha1/zz_generated.pc.go b/apis/cluster/postgresql/v1alpha1/zz_generated.pc.go index 436a0353..13503fc4 100644 --- a/apis/cluster/postgresql/v1alpha1/zz_generated.pc.go +++ b/apis/cluster/postgresql/v1alpha1/zz_generated.pc.go @@ -6,10 +6,10 @@ package v1alpha1 -import xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" +import xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" // GetCondition of this ProviderConfig. -func (p *ProviderConfig) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (p *ProviderConfig) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return p.Status.GetCondition(ct) } @@ -19,7 +19,7 @@ func (p *ProviderConfig) GetUsers() int64 { } // SetConditions of this ProviderConfig. -func (p *ProviderConfig) SetConditions(c ...xpv1.Condition) { +func (p *ProviderConfig) SetConditions(c ...xpv2.Condition) { p.Status.SetConditions(c...) } diff --git a/apis/cluster/postgresql/v1alpha1/zz_generated.pcu.go b/apis/cluster/postgresql/v1alpha1/zz_generated.pcu.go index 50035883..909fa454 100644 --- a/apis/cluster/postgresql/v1alpha1/zz_generated.pcu.go +++ b/apis/cluster/postgresql/v1alpha1/zz_generated.pcu.go @@ -6,24 +6,24 @@ package v1alpha1 -import xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" +import xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" // GetProviderConfigReference of this ProviderConfigUsage. -func (p *ProviderConfigUsage) GetProviderConfigReference() xpv1.Reference { +func (p *ProviderConfigUsage) GetProviderConfigReference() xpv2.Reference { return p.ProviderConfigReference } // GetResourceReference of this ProviderConfigUsage. -func (p *ProviderConfigUsage) GetResourceReference() xpv1.TypedReference { +func (p *ProviderConfigUsage) GetResourceReference() xpv2.TypedReference { return p.ResourceReference } // SetProviderConfigReference of this ProviderConfigUsage. -func (p *ProviderConfigUsage) SetProviderConfigReference(r xpv1.Reference) { +func (p *ProviderConfigUsage) SetProviderConfigReference(r xpv2.Reference) { p.ProviderConfigReference = r } // SetResourceReference of this ProviderConfigUsage. -func (p *ProviderConfigUsage) SetResourceReference(r xpv1.TypedReference) { +func (p *ProviderConfigUsage) SetResourceReference(r xpv2.TypedReference) { p.ResourceReference = r } diff --git a/apis/cluster/postgresql/v1alpha1/zz_generated.resolvers.go b/apis/cluster/postgresql/v1alpha1/zz_generated.resolvers.go deleted file mode 100644 index 50b62728..00000000 --- a/apis/cluster/postgresql/v1alpha1/zz_generated.resolvers.go +++ /dev/null @@ -1,156 +0,0 @@ -// SPDX-FileCopyrightText: 2026 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by angryjet. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - reference "github.com/crossplane/crossplane-runtime/v2/pkg/reference" - errors "github.com/pkg/errors" - client "sigs.k8s.io/controller-runtime/pkg/client" -) - -// ResolveReferences of this Database. -func (mg *Database) ResolveReferences(ctx context.Context, c client.Reader) error { - r := reference.NewAPIResolver(c, mg) - - var rsp reference.ResolutionResponse - var err error - - rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.Owner), - Extract: reference.ExternalName(), - Namespace: mg.GetNamespace(), - Reference: mg.Spec.ForProvider.OwnerRef, - Selector: mg.Spec.ForProvider.OwnerSelector, - To: reference.To{ - List: &RoleList{}, - Managed: &Role{}, - }, - }) - if err != nil { - return errors.Wrap(err, "mg.Spec.ForProvider.Owner") - } - mg.Spec.ForProvider.Owner = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.ForProvider.OwnerRef = rsp.ResolvedReference - - return nil -} - -// ResolveReferences of this DefaultPrivileges. -func (mg *DefaultPrivileges) ResolveReferences(ctx context.Context, c client.Reader) error { - r := reference.NewAPIResolver(c, mg) - - var rsp reference.ResolutionResponse - var err error - - rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.Role), - Extract: reference.ExternalName(), - Namespace: mg.GetNamespace(), - Reference: mg.Spec.ForProvider.RoleRef, - Selector: mg.Spec.ForProvider.RoleSelector, - To: reference.To{ - List: &RoleList{}, - Managed: &Role{}, - }, - }) - if err != nil { - return errors.Wrap(err, "mg.Spec.ForProvider.Role") - } - mg.Spec.ForProvider.Role = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.ForProvider.RoleRef = rsp.ResolvedReference - - rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.Database), - Extract: reference.ExternalName(), - Namespace: mg.GetNamespace(), - Reference: mg.Spec.ForProvider.DatabaseRef, - Selector: mg.Spec.ForProvider.DatabaseSelector, - To: reference.To{ - List: &DatabaseList{}, - Managed: &Database{}, - }, - }) - if err != nil { - return errors.Wrap(err, "mg.Spec.ForProvider.Database") - } - mg.Spec.ForProvider.Database = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.ForProvider.DatabaseRef = rsp.ResolvedReference - - return nil -} - -// ResolveReferences of this Extension. -func (mg *Extension) ResolveReferences(ctx context.Context, c client.Reader) error { - r := reference.NewAPIResolver(c, mg) - - var rsp reference.ResolutionResponse - var err error - - rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.Database), - Extract: reference.ExternalName(), - Namespace: mg.GetNamespace(), - Reference: mg.Spec.ForProvider.DatabaseRef, - Selector: mg.Spec.ForProvider.DatabaseSelector, - To: reference.To{ - List: &DatabaseList{}, - Managed: &Database{}, - }, - }) - if err != nil { - return errors.Wrap(err, "mg.Spec.ForProvider.Database") - } - mg.Spec.ForProvider.Database = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.ForProvider.DatabaseRef = rsp.ResolvedReference - - return nil -} - -// ResolveReferences of this Schema. -func (mg *Schema) ResolveReferences(ctx context.Context, c client.Reader) error { - r := reference.NewAPIResolver(c, mg) - - var rsp reference.ResolutionResponse - var err error - - rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.Role), - Extract: reference.ExternalName(), - Namespace: mg.GetNamespace(), - Reference: mg.Spec.ForProvider.RoleRef, - Selector: mg.Spec.ForProvider.RoleSelector, - To: reference.To{ - List: &RoleList{}, - Managed: &Role{}, - }, - }) - if err != nil { - return errors.Wrap(err, "mg.Spec.ForProvider.Role") - } - mg.Spec.ForProvider.Role = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.ForProvider.RoleRef = rsp.ResolvedReference - - rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.Database), - Extract: reference.ExternalName(), - Namespace: mg.GetNamespace(), - Reference: mg.Spec.ForProvider.DatabaseRef, - Selector: mg.Spec.ForProvider.DatabaseSelector, - To: reference.To{ - List: &DatabaseList{}, - Managed: &Database{}, - }, - }) - if err != nil { - return errors.Wrap(err, "mg.Spec.ForProvider.Database") - } - mg.Spec.ForProvider.Database = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.ForProvider.DatabaseRef = rsp.ResolvedReference - - return nil -} diff --git a/apis/namespaced/mssql/v1alpha1/cluster_provider_types.go b/apis/namespaced/mssql/v1alpha1/cluster_provider_types.go index 0851e8ea..9a2b6a2a 100644 --- a/apis/namespaced/mssql/v1alpha1/cluster_provider_types.go +++ b/apis/namespaced/mssql/v1alpha1/cluster_provider_types.go @@ -19,7 +19,7 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" ) // A ClusterProviderConfigSpec defines the desired state of a ClusterProviderConfig. @@ -38,7 +38,7 @@ type ClusterProviderCredentials struct { // that contains the credentials that must be used to connect to the // provider. // +optional - ConnectionSecretRef xpv1.SecretReference `json:"connectionSecretRef,omitempty"` + ConnectionSecretRef xpv2.SecretReference `json:"connectionSecretRef,omitempty"` // SecretKeyMapping allows overriding the default secret key names used // to read credentials from the connection secret. When not specified, @@ -49,7 +49,7 @@ type ClusterProviderCredentials struct { // A ProviderConfigStatus reflects the observed state of a ProviderConfig. type ClusterProviderConfigStatus struct { - xpv1.ProviderConfigStatus `json:",inline"` + xpv2.ProviderConfigStatus `json:",inline"` } // +kubebuilder:object:root=true diff --git a/apis/namespaced/mssql/v1alpha1/database_types.go b/apis/namespaced/mssql/v1alpha1/database_types.go index 42fa18a2..0192959b 100644 --- a/apis/namespaced/mssql/v1alpha1/database_types.go +++ b/apis/namespaced/mssql/v1alpha1/database_types.go @@ -19,8 +19,7 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" - xpv2 "github.com/crossplane/crossplane-runtime/v2/apis/common/v2" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" ) // A DatabaseSpec defines the desired state of a Database. @@ -30,7 +29,7 @@ type DatabaseSpec struct { // A DatabaseStatus represents the observed state of a Database. type DatabaseStatus struct { - xpv1.ResourceStatus `json:",inline"` + xpv2.ManagedResourceStatus `json:",inline"` } // +kubebuilder:object:root=true diff --git a/apis/namespaced/mssql/v1alpha1/grant_types.go b/apis/namespaced/mssql/v1alpha1/grant_types.go index 5c066d7b..a8d227cd 100644 --- a/apis/namespaced/mssql/v1alpha1/grant_types.go +++ b/apis/namespaced/mssql/v1alpha1/grant_types.go @@ -17,8 +17,7 @@ limitations under the License. package v1alpha1 import ( - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" - xpv2 "github.com/crossplane/crossplane-runtime/v2/apis/common/v2" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -69,12 +68,12 @@ type GrantParameters struct { // UserRef references the user object this grant is for. // +immutable // +optional - UserRef *xpv1.NamespacedReference `json:"userRef,omitempty"` + UserRef *xpv2.NamespacedReference `json:"userRef,omitempty"` // UserSelector selects a reference to a User this grant is for. // +immutable // +optional - UserSelector *xpv1.NamespacedSelector `json:"userSelector,omitempty"` + UserSelector *xpv2.NamespacedSelector `json:"userSelector,omitempty"` // Database this grant is for. // +optional @@ -84,17 +83,17 @@ type GrantParameters struct { // DatabaseRef references the database object this grant it for. // +immutable // +optional - DatabaseRef *xpv1.NamespacedReference `json:"databaseRef,omitempty"` + DatabaseRef *xpv2.NamespacedReference `json:"databaseRef,omitempty"` // DatabaseSelector selects a reference to a Database this grant is for. // +immutable // +optional - DatabaseSelector *xpv1.NamespacedSelector `json:"databaseSelector,omitempty"` + DatabaseSelector *xpv2.NamespacedSelector `json:"databaseSelector,omitempty"` } // A GrantStatus represents the observed state of a Grant. type GrantStatus struct { - xpv1.ResourceStatus `json:",inline"` + xpv2.ManagedResourceStatus `json:",inline"` } // +kubebuilder:object:root=true diff --git a/apis/namespaced/mssql/v1alpha1/provider_types.go b/apis/namespaced/mssql/v1alpha1/provider_types.go index bffd8993..6d6a7428 100644 --- a/apis/namespaced/mssql/v1alpha1/provider_types.go +++ b/apis/namespaced/mssql/v1alpha1/provider_types.go @@ -19,8 +19,7 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" - xpv2 "github.com/crossplane/crossplane-runtime/v2/apis/common/v2" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" ) // A ProviderConfigSpec defines the desired state of a ProviderConfig. @@ -48,7 +47,7 @@ type ProviderCredentials struct { // that contains the credentials that must be used to connect to the // provider. // +optional - ConnectionSecretRef xpv1.LocalSecretReference `json:"connectionSecretRef,omitempty"` + ConnectionSecretRef xpv2.LocalSecretReference `json:"connectionSecretRef,omitempty"` // SecretKeyMapping allows overriding the default secret key names used // to read credentials from the connection secret. When not specified, @@ -98,7 +97,7 @@ func (m *SecretKeyMapping) ToMap() map[string]string { // A ProviderConfigStatus reflects the observed state of a ProviderConfig. type ProviderConfigStatus struct { - xpv1.ProviderConfigStatus `json:",inline"` + xpv2.ProviderConfigStatus `json:",inline"` } // +kubebuilder:object:root=true diff --git a/apis/namespaced/mssql/v1alpha1/user_types.go b/apis/namespaced/mssql/v1alpha1/user_types.go index b269a947..481c67eb 100644 --- a/apis/namespaced/mssql/v1alpha1/user_types.go +++ b/apis/namespaced/mssql/v1alpha1/user_types.go @@ -19,8 +19,7 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" - xpv2 "github.com/crossplane/crossplane-runtime/v2/apis/common/v2" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" ) // A UserSpec defines the desired state of a Database. @@ -31,8 +30,8 @@ type UserSpec struct { // A UserStatus represents the observed state of a User. type UserStatus struct { - xpv1.ResourceStatus `json:",inline"` - AtProvider UserObservation `json:"atProvider,omitempty"` + xpv2.ManagedResourceStatus `json:",inline"` + AtProvider UserObservation `json:"atProvider,omitempty"` } // UserParameters define the desired state of a MSSQL user instance. @@ -44,21 +43,21 @@ type UserParameters struct { Database *string `json:"database,omitempty"` // DatabaseRef allows you to specify custom resource name of the Database the USER is created for. // to fill Database field. - DatabaseRef *xpv1.NamespacedReference `json:"databaseRef,omitempty"` + DatabaseRef *xpv2.NamespacedReference `json:"databaseRef,omitempty"` // DatabaseSelector allows you to use selector constraints to select a Database the USER is created for. - DatabaseSelector *xpv1.NamespacedSelector `json:"databaseSelector,omitempty"` + DatabaseSelector *xpv2.NamespacedSelector `json:"databaseSelector,omitempty"` // PasswordSecretRef references the secret that contains the password used // for this user. If no reference is given, a password will be auto-generated. // +optional - PasswordSecretRef *xpv1.LocalSecretKeySelector `json:"passwordSecretRef,omitempty"` + PasswordSecretRef *xpv2.LocalSecretKeySelector `json:"passwordSecretRef,omitempty"` // LoginDatabase allows you to specify the name of the Database to be used to create the user LOGIN in (normally master). // +crossplane:generate:reference:type=Database LoginDatabase *string `json:"loginDatabase,omitempty"` // DatabaseRef allows you to specify custom resource name of the Database to be used to create the user LOGIN in (normally master). // to fill Database field. - LoginDatabaseRef *xpv1.NamespacedReference `json:"loginDatabaseRef,omitempty"` + LoginDatabaseRef *xpv2.NamespacedReference `json:"loginDatabaseRef,omitempty"` // DatabaseSelector allows you to use selector constraints to select a Database to be used to create the user LOGIN in (normally master). - LoginDatabaseSelector *xpv1.NamespacedSelector `json:"loginDatabaseSelector,omitempty"` + LoginDatabaseSelector *xpv2.NamespacedSelector `json:"loginDatabaseSelector,omitempty"` // Contained specifies whether to create a contained database user (without server-level login). // When true, the user will be created directly in the specified database using CREATE USER WITH PASSWORD. // When false (default), a server-level LOGIN will be created first, then a database user mapped to that login. diff --git a/apis/namespaced/mssql/v1alpha1/zz_generated.deepcopy.go b/apis/namespaced/mssql/v1alpha1/zz_generated.deepcopy.go index f0e44f94..45de1d76 100644 --- a/apis/namespaced/mssql/v1alpha1/zz_generated.deepcopy.go +++ b/apis/namespaced/mssql/v1alpha1/zz_generated.deepcopy.go @@ -9,7 +9,7 @@ package v1alpha1 import ( - "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" + "github.com/crossplane/crossplane/apis/v2/core/v2" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -107,7 +107,7 @@ func (in *ClusterProviderConfigStatus) DeepCopy() *ClusterProviderConfigStatus { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterProviderCredentials) DeepCopyInto(out *ClusterProviderCredentials) { *out = *in - in.ConnectionSecretRef.DeepCopyInto(&out.ConnectionSecretRef) + out.ConnectionSecretRef = in.ConnectionSecretRef if in.SecretKeyMapping != nil { in, out := &in.SecretKeyMapping, &out.SecretKeyMapping *out = new(SecretKeyMapping) @@ -203,7 +203,7 @@ func (in *DatabaseSpec) DeepCopy() *DatabaseSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DatabaseStatus) DeepCopyInto(out *DatabaseStatus) { *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.ManagedResourceStatus.DeepCopyInto(&out.ManagedResourceStatus) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseStatus. @@ -295,12 +295,12 @@ func (in *GrantParameters) DeepCopyInto(out *GrantParameters) { } if in.UserRef != nil { in, out := &in.UserRef, &out.UserRef - *out = new(v1.NamespacedReference) + *out = new(v2.NamespacedReference) (*in).DeepCopyInto(*out) } if in.UserSelector != nil { in, out := &in.UserSelector, &out.UserSelector - *out = new(v1.NamespacedSelector) + *out = new(v2.NamespacedSelector) (*in).DeepCopyInto(*out) } if in.Database != nil { @@ -310,12 +310,12 @@ func (in *GrantParameters) DeepCopyInto(out *GrantParameters) { } if in.DatabaseRef != nil { in, out := &in.DatabaseRef, &out.DatabaseRef - *out = new(v1.NamespacedReference) + *out = new(v2.NamespacedReference) (*in).DeepCopyInto(*out) } if in.DatabaseSelector != nil { in, out := &in.DatabaseSelector, &out.DatabaseSelector - *out = new(v1.NamespacedSelector) + *out = new(v2.NamespacedSelector) (*in).DeepCopyInto(*out) } } @@ -369,7 +369,7 @@ func (in *GrantSpec) DeepCopy() *GrantSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GrantStatus) DeepCopyInto(out *GrantStatus) { *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.ManagedResourceStatus.DeepCopyInto(&out.ManagedResourceStatus) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GrantStatus. @@ -478,7 +478,7 @@ func (in *ProviderConfigUsage) DeepCopyInto(out *ProviderConfigUsage) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.TypedProviderConfigUsage.DeepCopyInto(&out.TypedProviderConfigUsage) + out.TypedProviderConfigUsage = in.TypedProviderConfigUsage } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderConfigUsage. @@ -534,7 +534,7 @@ func (in *ProviderConfigUsageList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ProviderCredentials) DeepCopyInto(out *ProviderCredentials) { *out = *in - in.ConnectionSecretRef.DeepCopyInto(&out.ConnectionSecretRef) + out.ConnectionSecretRef = in.ConnectionSecretRef if in.SecretKeyMapping != nil { in, out := &in.SecretKeyMapping, &out.SecretKeyMapping *out = new(SecretKeyMapping) @@ -651,17 +651,17 @@ func (in *UserParameters) DeepCopyInto(out *UserParameters) { } if in.DatabaseRef != nil { in, out := &in.DatabaseRef, &out.DatabaseRef - *out = new(v1.NamespacedReference) + *out = new(v2.NamespacedReference) (*in).DeepCopyInto(*out) } if in.DatabaseSelector != nil { in, out := &in.DatabaseSelector, &out.DatabaseSelector - *out = new(v1.NamespacedSelector) + *out = new(v2.NamespacedSelector) (*in).DeepCopyInto(*out) } if in.PasswordSecretRef != nil { in, out := &in.PasswordSecretRef, &out.PasswordSecretRef - *out = new(v1.LocalSecretKeySelector) + *out = new(v2.LocalSecretKeySelector) **out = **in } if in.LoginDatabase != nil { @@ -671,12 +671,12 @@ func (in *UserParameters) DeepCopyInto(out *UserParameters) { } if in.LoginDatabaseRef != nil { in, out := &in.LoginDatabaseRef, &out.LoginDatabaseRef - *out = new(v1.NamespacedReference) + *out = new(v2.NamespacedReference) (*in).DeepCopyInto(*out) } if in.LoginDatabaseSelector != nil { in, out := &in.LoginDatabaseSelector, &out.LoginDatabaseSelector - *out = new(v1.NamespacedSelector) + *out = new(v2.NamespacedSelector) (*in).DeepCopyInto(*out) } if in.Contained != nil { @@ -716,7 +716,7 @@ func (in *UserSpec) DeepCopy() *UserSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *UserStatus) DeepCopyInto(out *UserStatus) { *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.ManagedResourceStatus.DeepCopyInto(&out.ManagedResourceStatus) out.AtProvider = in.AtProvider } diff --git a/apis/namespaced/mssql/v1alpha1/zz_generated.managed.go b/apis/namespaced/mssql/v1alpha1/zz_generated.managed.go index d1cafaea..40b426b1 100644 --- a/apis/namespaced/mssql/v1alpha1/zz_generated.managed.go +++ b/apis/namespaced/mssql/v1alpha1/zz_generated.managed.go @@ -6,124 +6,124 @@ package v1alpha1 -import xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" +import xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" // GetCondition of this Database. -func (mg *Database) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (mg *Database) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return mg.Status.GetCondition(ct) } // GetManagementPolicies of this Database. -func (mg *Database) GetManagementPolicies() xpv1.ManagementPolicies { +func (mg *Database) GetManagementPolicies() xpv2.ManagementPolicies { return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Database. -func (mg *Database) GetProviderConfigReference() *xpv1.ProviderConfigReference { +func (mg *Database) GetProviderConfigReference() *xpv2.ProviderConfigReference { return mg.Spec.ProviderConfigReference } // GetWriteConnectionSecretToReference of this Database. -func (mg *Database) GetWriteConnectionSecretToReference() *xpv1.LocalSecretReference { +func (mg *Database) GetWriteConnectionSecretToReference() *xpv2.LocalSecretReference { return mg.Spec.WriteConnectionSecretToReference } // SetConditions of this Database. -func (mg *Database) SetConditions(c ...xpv1.Condition) { +func (mg *Database) SetConditions(c ...xpv2.Condition) { mg.Status.SetConditions(c...) } // SetManagementPolicies of this Database. -func (mg *Database) SetManagementPolicies(r xpv1.ManagementPolicies) { +func (mg *Database) SetManagementPolicies(r xpv2.ManagementPolicies) { mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Database. -func (mg *Database) SetProviderConfigReference(r *xpv1.ProviderConfigReference) { +func (mg *Database) SetProviderConfigReference(r *xpv2.ProviderConfigReference) { mg.Spec.ProviderConfigReference = r } // SetWriteConnectionSecretToReference of this Database. -func (mg *Database) SetWriteConnectionSecretToReference(r *xpv1.LocalSecretReference) { +func (mg *Database) SetWriteConnectionSecretToReference(r *xpv2.LocalSecretReference) { mg.Spec.WriteConnectionSecretToReference = r } // GetCondition of this Grant. -func (mg *Grant) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (mg *Grant) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return mg.Status.GetCondition(ct) } // GetManagementPolicies of this Grant. -func (mg *Grant) GetManagementPolicies() xpv1.ManagementPolicies { +func (mg *Grant) GetManagementPolicies() xpv2.ManagementPolicies { return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Grant. -func (mg *Grant) GetProviderConfigReference() *xpv1.ProviderConfigReference { +func (mg *Grant) GetProviderConfigReference() *xpv2.ProviderConfigReference { return mg.Spec.ProviderConfigReference } // GetWriteConnectionSecretToReference of this Grant. -func (mg *Grant) GetWriteConnectionSecretToReference() *xpv1.LocalSecretReference { +func (mg *Grant) GetWriteConnectionSecretToReference() *xpv2.LocalSecretReference { return mg.Spec.WriteConnectionSecretToReference } // SetConditions of this Grant. -func (mg *Grant) SetConditions(c ...xpv1.Condition) { +func (mg *Grant) SetConditions(c ...xpv2.Condition) { mg.Status.SetConditions(c...) } // SetManagementPolicies of this Grant. -func (mg *Grant) SetManagementPolicies(r xpv1.ManagementPolicies) { +func (mg *Grant) SetManagementPolicies(r xpv2.ManagementPolicies) { mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Grant. -func (mg *Grant) SetProviderConfigReference(r *xpv1.ProviderConfigReference) { +func (mg *Grant) SetProviderConfigReference(r *xpv2.ProviderConfigReference) { mg.Spec.ProviderConfigReference = r } // SetWriteConnectionSecretToReference of this Grant. -func (mg *Grant) SetWriteConnectionSecretToReference(r *xpv1.LocalSecretReference) { +func (mg *Grant) SetWriteConnectionSecretToReference(r *xpv2.LocalSecretReference) { mg.Spec.WriteConnectionSecretToReference = r } // GetCondition of this User. -func (mg *User) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (mg *User) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return mg.Status.GetCondition(ct) } // GetManagementPolicies of this User. -func (mg *User) GetManagementPolicies() xpv1.ManagementPolicies { +func (mg *User) GetManagementPolicies() xpv2.ManagementPolicies { return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this User. -func (mg *User) GetProviderConfigReference() *xpv1.ProviderConfigReference { +func (mg *User) GetProviderConfigReference() *xpv2.ProviderConfigReference { return mg.Spec.ProviderConfigReference } // GetWriteConnectionSecretToReference of this User. -func (mg *User) GetWriteConnectionSecretToReference() *xpv1.LocalSecretReference { +func (mg *User) GetWriteConnectionSecretToReference() *xpv2.LocalSecretReference { return mg.Spec.WriteConnectionSecretToReference } // SetConditions of this User. -func (mg *User) SetConditions(c ...xpv1.Condition) { +func (mg *User) SetConditions(c ...xpv2.Condition) { mg.Status.SetConditions(c...) } // SetManagementPolicies of this User. -func (mg *User) SetManagementPolicies(r xpv1.ManagementPolicies) { +func (mg *User) SetManagementPolicies(r xpv2.ManagementPolicies) { mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this User. -func (mg *User) SetProviderConfigReference(r *xpv1.ProviderConfigReference) { +func (mg *User) SetProviderConfigReference(r *xpv2.ProviderConfigReference) { mg.Spec.ProviderConfigReference = r } // SetWriteConnectionSecretToReference of this User. -func (mg *User) SetWriteConnectionSecretToReference(r *xpv1.LocalSecretReference) { +func (mg *User) SetWriteConnectionSecretToReference(r *xpv2.LocalSecretReference) { mg.Spec.WriteConnectionSecretToReference = r } diff --git a/apis/namespaced/mssql/v1alpha1/zz_generated.pc.go b/apis/namespaced/mssql/v1alpha1/zz_generated.pc.go index 172e5157..6f296fe6 100644 --- a/apis/namespaced/mssql/v1alpha1/zz_generated.pc.go +++ b/apis/namespaced/mssql/v1alpha1/zz_generated.pc.go @@ -6,10 +6,10 @@ package v1alpha1 -import xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" +import xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" // GetCondition of this ClusterProviderConfig. -func (p *ClusterProviderConfig) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (p *ClusterProviderConfig) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return p.Status.GetCondition(ct) } @@ -19,7 +19,7 @@ func (p *ClusterProviderConfig) GetUsers() int64 { } // SetConditions of this ClusterProviderConfig. -func (p *ClusterProviderConfig) SetConditions(c ...xpv1.Condition) { +func (p *ClusterProviderConfig) SetConditions(c ...xpv2.Condition) { p.Status.SetConditions(c...) } @@ -29,7 +29,7 @@ func (p *ClusterProviderConfig) SetUsers(i int64) { } // GetCondition of this ProviderConfig. -func (p *ProviderConfig) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (p *ProviderConfig) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return p.Status.GetCondition(ct) } @@ -39,7 +39,7 @@ func (p *ProviderConfig) GetUsers() int64 { } // SetConditions of this ProviderConfig. -func (p *ProviderConfig) SetConditions(c ...xpv1.Condition) { +func (p *ProviderConfig) SetConditions(c ...xpv2.Condition) { p.Status.SetConditions(c...) } diff --git a/apis/namespaced/mssql/v1alpha1/zz_generated.pcu.go b/apis/namespaced/mssql/v1alpha1/zz_generated.pcu.go index c4bf4c8d..0e9ccc55 100644 --- a/apis/namespaced/mssql/v1alpha1/zz_generated.pcu.go +++ b/apis/namespaced/mssql/v1alpha1/zz_generated.pcu.go @@ -6,24 +6,24 @@ package v1alpha1 -import xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" +import xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" // GetProviderConfigReference of this ProviderConfigUsage. -func (p *ProviderConfigUsage) GetProviderConfigReference() xpv1.ProviderConfigReference { +func (p *ProviderConfigUsage) GetProviderConfigReference() xpv2.ProviderConfigReference { return p.ProviderConfigReference } // GetResourceReference of this ProviderConfigUsage. -func (p *ProviderConfigUsage) GetResourceReference() xpv1.TypedReference { +func (p *ProviderConfigUsage) GetResourceReference() xpv2.TypedReference { return p.ResourceReference } // SetProviderConfigReference of this ProviderConfigUsage. -func (p *ProviderConfigUsage) SetProviderConfigReference(r xpv1.ProviderConfigReference) { +func (p *ProviderConfigUsage) SetProviderConfigReference(r xpv2.ProviderConfigReference) { p.ProviderConfigReference = r } // SetResourceReference of this ProviderConfigUsage. -func (p *ProviderConfigUsage) SetResourceReference(r xpv1.TypedReference) { +func (p *ProviderConfigUsage) SetResourceReference(r xpv2.TypedReference) { p.ResourceReference = r } diff --git a/apis/namespaced/mssql/v1alpha1/zz_generated.resolvers.go b/apis/namespaced/mssql/v1alpha1/zz_generated.resolvers.go deleted file mode 100644 index 07535897..00000000 --- a/apis/namespaced/mssql/v1alpha1/zz_generated.resolvers.go +++ /dev/null @@ -1,102 +0,0 @@ -// SPDX-FileCopyrightText: 2026 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by angryjet. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - reference "github.com/crossplane/crossplane-runtime/v2/pkg/reference" - errors "github.com/pkg/errors" - client "sigs.k8s.io/controller-runtime/pkg/client" -) - -// ResolveReferences of this Grant. -func (mg *Grant) ResolveReferences(ctx context.Context, c client.Reader) error { - r := reference.NewAPINamespacedResolver(c, mg) - - var rsp reference.NamespacedResolutionResponse - var err error - - rsp, err = r.Resolve(ctx, reference.NamespacedResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.User), - Extract: reference.ExternalName(), - Namespace: mg.GetNamespace(), - Reference: mg.Spec.ForProvider.UserRef, - Selector: mg.Spec.ForProvider.UserSelector, - To: reference.To{ - List: &UserList{}, - Managed: &User{}, - }, - }) - if err != nil { - return errors.Wrap(err, "mg.Spec.ForProvider.User") - } - mg.Spec.ForProvider.User = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.ForProvider.UserRef = rsp.ResolvedReference - - rsp, err = r.Resolve(ctx, reference.NamespacedResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.Database), - Extract: reference.ExternalName(), - Namespace: mg.GetNamespace(), - Reference: mg.Spec.ForProvider.DatabaseRef, - Selector: mg.Spec.ForProvider.DatabaseSelector, - To: reference.To{ - List: &DatabaseList{}, - Managed: &Database{}, - }, - }) - if err != nil { - return errors.Wrap(err, "mg.Spec.ForProvider.Database") - } - mg.Spec.ForProvider.Database = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.ForProvider.DatabaseRef = rsp.ResolvedReference - - return nil -} - -// ResolveReferences of this User. -func (mg *User) ResolveReferences(ctx context.Context, c client.Reader) error { - r := reference.NewAPINamespacedResolver(c, mg) - - var rsp reference.NamespacedResolutionResponse - var err error - - rsp, err = r.Resolve(ctx, reference.NamespacedResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.Database), - Extract: reference.ExternalName(), - Namespace: mg.GetNamespace(), - Reference: mg.Spec.ForProvider.DatabaseRef, - Selector: mg.Spec.ForProvider.DatabaseSelector, - To: reference.To{ - List: &DatabaseList{}, - Managed: &Database{}, - }, - }) - if err != nil { - return errors.Wrap(err, "mg.Spec.ForProvider.Database") - } - mg.Spec.ForProvider.Database = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.ForProvider.DatabaseRef = rsp.ResolvedReference - - rsp, err = r.Resolve(ctx, reference.NamespacedResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.LoginDatabase), - Extract: reference.ExternalName(), - Namespace: mg.GetNamespace(), - Reference: mg.Spec.ForProvider.LoginDatabaseRef, - Selector: mg.Spec.ForProvider.LoginDatabaseSelector, - To: reference.To{ - List: &DatabaseList{}, - Managed: &Database{}, - }, - }) - if err != nil { - return errors.Wrap(err, "mg.Spec.ForProvider.LoginDatabase") - } - mg.Spec.ForProvider.LoginDatabase = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.ForProvider.LoginDatabaseRef = rsp.ResolvedReference - - return nil -} diff --git a/apis/namespaced/mysql/v1alpha1/cluster_provider_types.go b/apis/namespaced/mysql/v1alpha1/cluster_provider_types.go index ee61542a..5e1f1e2e 100644 --- a/apis/namespaced/mysql/v1alpha1/cluster_provider_types.go +++ b/apis/namespaced/mysql/v1alpha1/cluster_provider_types.go @@ -19,7 +19,7 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" ) // A ClusterProviderConfigSpec defines the desired state of a ClusterProviderConfig. @@ -51,7 +51,7 @@ type ClusterProviderCredentials struct { // A CredentialsSecretRef is a reference to a MySQL connection secret // that contains the credentials that must be used to connect to the // provider. +optional - ConnectionSecretRef xpv1.SecretReference `json:"connectionSecretRef,omitempty"` + ConnectionSecretRef xpv2.SecretReference `json:"connectionSecretRef,omitempty"` // SecretKeyMapping allows overriding the default secret key names used // to read credentials from the connection secret. When not specified, @@ -62,7 +62,7 @@ type ClusterProviderCredentials struct { // A ClusterProviderConfigStatus reflects the observed state of a ClusterProviderConfig. type ClusterProviderConfigStatus struct { - xpv1.ProviderConfigStatus `json:",inline"` + xpv2.ProviderConfigStatus `json:",inline"` } // +kubebuilder:object:root=true diff --git a/apis/namespaced/mysql/v1alpha1/database_types.go b/apis/namespaced/mysql/v1alpha1/database_types.go index 5a58fa90..3c6c3086 100644 --- a/apis/namespaced/mysql/v1alpha1/database_types.go +++ b/apis/namespaced/mysql/v1alpha1/database_types.go @@ -19,8 +19,7 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" - xpv2 "github.com/crossplane/crossplane-runtime/v2/apis/common/v2" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" ) // A DatabaseSpec defines the desired state of a Database. @@ -32,7 +31,7 @@ type DatabaseSpec struct { // A DatabaseStatus represents the observed state of a Database. type DatabaseStatus struct { - xpv1.ResourceStatus `json:",inline"` + xpv2.ManagedResourceStatus `json:",inline"` } // DatabaseParameters define the desired state of a MySQL database instance. diff --git a/apis/namespaced/mysql/v1alpha1/grant_types.go b/apis/namespaced/mysql/v1alpha1/grant_types.go index 0c2df388..f513ca65 100644 --- a/apis/namespaced/mysql/v1alpha1/grant_types.go +++ b/apis/namespaced/mysql/v1alpha1/grant_types.go @@ -19,8 +19,7 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" - xpv2 "github.com/crossplane/crossplane-runtime/v2/apis/common/v2" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" ) // A GrantSpec defines the desired state of a Grant. @@ -66,12 +65,12 @@ type GrantParameters struct { // UserRef references the user object this grant is for. // +immutable // +optional - UserRef *xpv1.NamespacedReference `json:"userRef,omitempty"` + UserRef *xpv2.NamespacedReference `json:"userRef,omitempty"` // UserSelector selects a reference to a User this grant is for. // +immutable // +optional - UserSelector *xpv1.NamespacedSelector `json:"userSelector,omitempty"` + UserSelector *xpv2.NamespacedSelector `json:"userSelector,omitempty"` // Tables this grant is for, default *. // +optional @@ -85,12 +84,12 @@ type GrantParameters struct { // DatabaseRef references the database object this grant it for. // +immutable // +optional - DatabaseRef *xpv1.NamespacedReference `json:"databaseRef,omitempty"` + DatabaseRef *xpv2.NamespacedReference `json:"databaseRef,omitempty"` // DatabaseSelector selects a reference to a Database this grant is for. // +immutable // +optional - DatabaseSelector *xpv1.NamespacedSelector `json:"databaseSelector,omitempty"` + DatabaseSelector *xpv2.NamespacedSelector `json:"databaseSelector,omitempty"` // BinLog defines whether the create, delete, update operations of this grant are propagated to replicas. Defaults to true // +optional @@ -99,8 +98,8 @@ type GrantParameters struct { // A GrantStatus represents the observed state of a Grant. type GrantStatus struct { - xpv1.ResourceStatus `json:",inline"` - AtProvider GrantObservation `json:"atProvider,omitempty"` + xpv2.ManagedResourceStatus `json:",inline"` + AtProvider GrantObservation `json:"atProvider,omitempty"` } // A GrantObservation represents the observed state of a MySQL grant. diff --git a/apis/namespaced/mysql/v1alpha1/provider_types.go b/apis/namespaced/mysql/v1alpha1/provider_types.go index 280e2fe2..25abc869 100644 --- a/apis/namespaced/mysql/v1alpha1/provider_types.go +++ b/apis/namespaced/mysql/v1alpha1/provider_types.go @@ -19,8 +19,7 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" - xpv2 "github.com/crossplane/crossplane-runtime/v2/apis/common/v2" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" ) // A ProviderConfigSpec defines the desired state of a ProviderConfig. @@ -52,7 +51,7 @@ type TLSConfig struct { // TLSSecret defines a reference to a K8s secret and its specific internal key that contains the TLS cert/keys in PEM format. type TLSSecret struct { - SecretRef xpv1.SecretKeySelector `json:"secretRef,omitempty"` + SecretRef xpv2.SecretKeySelector `json:"secretRef,omitempty"` } type MySQLConnectionSecretSource string @@ -73,7 +72,7 @@ type ProviderCredentials struct { // A CredentialsSecretRef is a reference to a MySQL connection secret // that contains the credentials that must be used to connect to the // provider. +optional - ConnectionSecretRef xpv1.LocalSecretReference `json:"connectionSecretRef,omitempty"` + ConnectionSecretRef xpv2.LocalSecretReference `json:"connectionSecretRef,omitempty"` // SecretKeyMapping allows overriding the default secret key names used // to read credentials from the connection secret. When not specified, @@ -123,7 +122,7 @@ func (m *SecretKeyMapping) ToMap() map[string]string { // A ProviderConfigStatus reflects the observed state of a ProviderConfig. type ProviderConfigStatus struct { - xpv1.ProviderConfigStatus `json:",inline"` + xpv2.ProviderConfigStatus `json:",inline"` } // +kubebuilder:object:root=true diff --git a/apis/namespaced/mysql/v1alpha1/user_types.go b/apis/namespaced/mysql/v1alpha1/user_types.go index fec67c90..0d40f987 100644 --- a/apis/namespaced/mysql/v1alpha1/user_types.go +++ b/apis/namespaced/mysql/v1alpha1/user_types.go @@ -19,8 +19,7 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" - xpv2 "github.com/crossplane/crossplane-runtime/v2/apis/common/v2" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" ) // A UserSpec defines the desired state of a Database. @@ -31,8 +30,8 @@ type UserSpec struct { // A UserStatus represents the observed state of a User. type UserStatus struct { - xpv1.ResourceStatus `json:",inline"` - AtProvider UserObservation `json:"atProvider,omitempty"` + xpv2.ManagedResourceStatus `json:",inline"` + AtProvider UserObservation `json:"atProvider,omitempty"` } // UserParameters define the desired state of a MySQL user instance. @@ -42,7 +41,7 @@ type UserParameters struct { // for this user. If no reference is given, a password will be auto-generated. // Cannot be set together with AuthenticationPlugin. // +optional - PasswordSecretRef *xpv1.LocalSecretKeySelector `json:"passwordSecretRef,omitempty"` + PasswordSecretRef *xpv2.LocalSecretKeySelector `json:"passwordSecretRef,omitempty"` // AuthenticationPlugin selects a non-default MySQL authentication plugin // for the user. When set, the user is created with diff --git a/apis/namespaced/mysql/v1alpha1/zz_generated.deepcopy.go b/apis/namespaced/mysql/v1alpha1/zz_generated.deepcopy.go index 4977818e..29ce455b 100644 --- a/apis/namespaced/mysql/v1alpha1/zz_generated.deepcopy.go +++ b/apis/namespaced/mysql/v1alpha1/zz_generated.deepcopy.go @@ -9,7 +9,7 @@ package v1alpha1 import ( - "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" + "github.com/crossplane/crossplane/apis/v2/core/v2" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -104,7 +104,7 @@ func (in *ClusterProviderConfigSpec) DeepCopyInto(out *ClusterProviderConfigSpec if in.TLSConfig != nil { in, out := &in.TLSConfig, &out.TLSConfig *out = new(TLSConfig) - (*in).DeepCopyInto(*out) + **out = **in } } @@ -137,7 +137,7 @@ func (in *ClusterProviderConfigStatus) DeepCopy() *ClusterProviderConfigStatus { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterProviderCredentials) DeepCopyInto(out *ClusterProviderCredentials) { *out = *in - in.ConnectionSecretRef.DeepCopyInto(&out.ConnectionSecretRef) + out.ConnectionSecretRef = in.ConnectionSecretRef if in.SecretKeyMapping != nil { in, out := &in.SecretKeyMapping, &out.SecretKeyMapping *out = new(SecretKeyMapping) @@ -264,7 +264,7 @@ func (in *DatabaseSpec) DeepCopy() *DatabaseSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DatabaseStatus) DeepCopyInto(out *DatabaseStatus) { *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.ManagedResourceStatus.DeepCopyInto(&out.ManagedResourceStatus) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseStatus. @@ -371,12 +371,12 @@ func (in *GrantParameters) DeepCopyInto(out *GrantParameters) { } if in.UserRef != nil { in, out := &in.UserRef, &out.UserRef - *out = new(v1.NamespacedReference) + *out = new(v2.NamespacedReference) (*in).DeepCopyInto(*out) } if in.UserSelector != nil { in, out := &in.UserSelector, &out.UserSelector - *out = new(v1.NamespacedSelector) + *out = new(v2.NamespacedSelector) (*in).DeepCopyInto(*out) } if in.Table != nil { @@ -391,12 +391,12 @@ func (in *GrantParameters) DeepCopyInto(out *GrantParameters) { } if in.DatabaseRef != nil { in, out := &in.DatabaseRef, &out.DatabaseRef - *out = new(v1.NamespacedReference) + *out = new(v2.NamespacedReference) (*in).DeepCopyInto(*out) } if in.DatabaseSelector != nil { in, out := &in.DatabaseSelector, &out.DatabaseSelector - *out = new(v1.NamespacedSelector) + *out = new(v2.NamespacedSelector) (*in).DeepCopyInto(*out) } if in.BinLog != nil { @@ -455,7 +455,7 @@ func (in *GrantSpec) DeepCopy() *GrantSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GrantStatus) DeepCopyInto(out *GrantStatus) { *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.ManagedResourceStatus.DeepCopyInto(&out.ManagedResourceStatus) in.AtProvider.DeepCopyInto(&out.AtProvider) } @@ -540,7 +540,7 @@ func (in *ProviderConfigSpec) DeepCopyInto(out *ProviderConfigSpec) { if in.TLSConfig != nil { in, out := &in.TLSConfig, &out.TLSConfig *out = new(TLSConfig) - (*in).DeepCopyInto(*out) + **out = **in } } @@ -575,7 +575,7 @@ func (in *ProviderConfigUsage) DeepCopyInto(out *ProviderConfigUsage) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.TypedProviderConfigUsage.DeepCopyInto(&out.TypedProviderConfigUsage) + out.TypedProviderConfigUsage = in.TypedProviderConfigUsage } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderConfigUsage. @@ -631,7 +631,7 @@ func (in *ProviderConfigUsageList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ProviderCredentials) DeepCopyInto(out *ProviderCredentials) { *out = *in - in.ConnectionSecretRef.DeepCopyInto(&out.ConnectionSecretRef) + out.ConnectionSecretRef = in.ConnectionSecretRef if in.SecretKeyMapping != nil { in, out := &in.SecretKeyMapping, &out.SecretKeyMapping *out = new(SecretKeyMapping) @@ -702,9 +702,9 @@ func (in *SecretKeyMapping) DeepCopy() *SecretKeyMapping { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TLSConfig) DeepCopyInto(out *TLSConfig) { *out = *in - in.CACert.DeepCopyInto(&out.CACert) - in.ClientCert.DeepCopyInto(&out.ClientCert) - in.ClientKey.DeepCopyInto(&out.ClientKey) + out.CACert = in.CACert + out.ClientCert = in.ClientCert + out.ClientKey = in.ClientKey } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSConfig. @@ -720,7 +720,7 @@ func (in *TLSConfig) DeepCopy() *TLSConfig { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TLSSecret) DeepCopyInto(out *TLSSecret) { *out = *in - in.SecretRef.DeepCopyInto(&out.SecretRef) + out.SecretRef = in.SecretRef } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSSecret. @@ -822,7 +822,7 @@ func (in *UserParameters) DeepCopyInto(out *UserParameters) { *out = *in if in.PasswordSecretRef != nil { in, out := &in.PasswordSecretRef, &out.PasswordSecretRef - *out = new(v1.LocalSecretKeySelector) + *out = new(v2.LocalSecretKeySelector) **out = **in } if in.AuthenticationPlugin != nil { @@ -872,7 +872,7 @@ func (in *UserSpec) DeepCopy() *UserSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *UserStatus) DeepCopyInto(out *UserStatus) { *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.ManagedResourceStatus.DeepCopyInto(&out.ManagedResourceStatus) in.AtProvider.DeepCopyInto(&out.AtProvider) } diff --git a/apis/namespaced/mysql/v1alpha1/zz_generated.managed.go b/apis/namespaced/mysql/v1alpha1/zz_generated.managed.go index d1cafaea..40b426b1 100644 --- a/apis/namespaced/mysql/v1alpha1/zz_generated.managed.go +++ b/apis/namespaced/mysql/v1alpha1/zz_generated.managed.go @@ -6,124 +6,124 @@ package v1alpha1 -import xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" +import xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" // GetCondition of this Database. -func (mg *Database) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (mg *Database) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return mg.Status.GetCondition(ct) } // GetManagementPolicies of this Database. -func (mg *Database) GetManagementPolicies() xpv1.ManagementPolicies { +func (mg *Database) GetManagementPolicies() xpv2.ManagementPolicies { return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Database. -func (mg *Database) GetProviderConfigReference() *xpv1.ProviderConfigReference { +func (mg *Database) GetProviderConfigReference() *xpv2.ProviderConfigReference { return mg.Spec.ProviderConfigReference } // GetWriteConnectionSecretToReference of this Database. -func (mg *Database) GetWriteConnectionSecretToReference() *xpv1.LocalSecretReference { +func (mg *Database) GetWriteConnectionSecretToReference() *xpv2.LocalSecretReference { return mg.Spec.WriteConnectionSecretToReference } // SetConditions of this Database. -func (mg *Database) SetConditions(c ...xpv1.Condition) { +func (mg *Database) SetConditions(c ...xpv2.Condition) { mg.Status.SetConditions(c...) } // SetManagementPolicies of this Database. -func (mg *Database) SetManagementPolicies(r xpv1.ManagementPolicies) { +func (mg *Database) SetManagementPolicies(r xpv2.ManagementPolicies) { mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Database. -func (mg *Database) SetProviderConfigReference(r *xpv1.ProviderConfigReference) { +func (mg *Database) SetProviderConfigReference(r *xpv2.ProviderConfigReference) { mg.Spec.ProviderConfigReference = r } // SetWriteConnectionSecretToReference of this Database. -func (mg *Database) SetWriteConnectionSecretToReference(r *xpv1.LocalSecretReference) { +func (mg *Database) SetWriteConnectionSecretToReference(r *xpv2.LocalSecretReference) { mg.Spec.WriteConnectionSecretToReference = r } // GetCondition of this Grant. -func (mg *Grant) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (mg *Grant) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return mg.Status.GetCondition(ct) } // GetManagementPolicies of this Grant. -func (mg *Grant) GetManagementPolicies() xpv1.ManagementPolicies { +func (mg *Grant) GetManagementPolicies() xpv2.ManagementPolicies { return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Grant. -func (mg *Grant) GetProviderConfigReference() *xpv1.ProviderConfigReference { +func (mg *Grant) GetProviderConfigReference() *xpv2.ProviderConfigReference { return mg.Spec.ProviderConfigReference } // GetWriteConnectionSecretToReference of this Grant. -func (mg *Grant) GetWriteConnectionSecretToReference() *xpv1.LocalSecretReference { +func (mg *Grant) GetWriteConnectionSecretToReference() *xpv2.LocalSecretReference { return mg.Spec.WriteConnectionSecretToReference } // SetConditions of this Grant. -func (mg *Grant) SetConditions(c ...xpv1.Condition) { +func (mg *Grant) SetConditions(c ...xpv2.Condition) { mg.Status.SetConditions(c...) } // SetManagementPolicies of this Grant. -func (mg *Grant) SetManagementPolicies(r xpv1.ManagementPolicies) { +func (mg *Grant) SetManagementPolicies(r xpv2.ManagementPolicies) { mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Grant. -func (mg *Grant) SetProviderConfigReference(r *xpv1.ProviderConfigReference) { +func (mg *Grant) SetProviderConfigReference(r *xpv2.ProviderConfigReference) { mg.Spec.ProviderConfigReference = r } // SetWriteConnectionSecretToReference of this Grant. -func (mg *Grant) SetWriteConnectionSecretToReference(r *xpv1.LocalSecretReference) { +func (mg *Grant) SetWriteConnectionSecretToReference(r *xpv2.LocalSecretReference) { mg.Spec.WriteConnectionSecretToReference = r } // GetCondition of this User. -func (mg *User) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (mg *User) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return mg.Status.GetCondition(ct) } // GetManagementPolicies of this User. -func (mg *User) GetManagementPolicies() xpv1.ManagementPolicies { +func (mg *User) GetManagementPolicies() xpv2.ManagementPolicies { return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this User. -func (mg *User) GetProviderConfigReference() *xpv1.ProviderConfigReference { +func (mg *User) GetProviderConfigReference() *xpv2.ProviderConfigReference { return mg.Spec.ProviderConfigReference } // GetWriteConnectionSecretToReference of this User. -func (mg *User) GetWriteConnectionSecretToReference() *xpv1.LocalSecretReference { +func (mg *User) GetWriteConnectionSecretToReference() *xpv2.LocalSecretReference { return mg.Spec.WriteConnectionSecretToReference } // SetConditions of this User. -func (mg *User) SetConditions(c ...xpv1.Condition) { +func (mg *User) SetConditions(c ...xpv2.Condition) { mg.Status.SetConditions(c...) } // SetManagementPolicies of this User. -func (mg *User) SetManagementPolicies(r xpv1.ManagementPolicies) { +func (mg *User) SetManagementPolicies(r xpv2.ManagementPolicies) { mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this User. -func (mg *User) SetProviderConfigReference(r *xpv1.ProviderConfigReference) { +func (mg *User) SetProviderConfigReference(r *xpv2.ProviderConfigReference) { mg.Spec.ProviderConfigReference = r } // SetWriteConnectionSecretToReference of this User. -func (mg *User) SetWriteConnectionSecretToReference(r *xpv1.LocalSecretReference) { +func (mg *User) SetWriteConnectionSecretToReference(r *xpv2.LocalSecretReference) { mg.Spec.WriteConnectionSecretToReference = r } diff --git a/apis/namespaced/mysql/v1alpha1/zz_generated.pc.go b/apis/namespaced/mysql/v1alpha1/zz_generated.pc.go index 172e5157..6f296fe6 100644 --- a/apis/namespaced/mysql/v1alpha1/zz_generated.pc.go +++ b/apis/namespaced/mysql/v1alpha1/zz_generated.pc.go @@ -6,10 +6,10 @@ package v1alpha1 -import xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" +import xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" // GetCondition of this ClusterProviderConfig. -func (p *ClusterProviderConfig) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (p *ClusterProviderConfig) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return p.Status.GetCondition(ct) } @@ -19,7 +19,7 @@ func (p *ClusterProviderConfig) GetUsers() int64 { } // SetConditions of this ClusterProviderConfig. -func (p *ClusterProviderConfig) SetConditions(c ...xpv1.Condition) { +func (p *ClusterProviderConfig) SetConditions(c ...xpv2.Condition) { p.Status.SetConditions(c...) } @@ -29,7 +29,7 @@ func (p *ClusterProviderConfig) SetUsers(i int64) { } // GetCondition of this ProviderConfig. -func (p *ProviderConfig) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (p *ProviderConfig) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return p.Status.GetCondition(ct) } @@ -39,7 +39,7 @@ func (p *ProviderConfig) GetUsers() int64 { } // SetConditions of this ProviderConfig. -func (p *ProviderConfig) SetConditions(c ...xpv1.Condition) { +func (p *ProviderConfig) SetConditions(c ...xpv2.Condition) { p.Status.SetConditions(c...) } diff --git a/apis/namespaced/mysql/v1alpha1/zz_generated.pcu.go b/apis/namespaced/mysql/v1alpha1/zz_generated.pcu.go index c4bf4c8d..0e9ccc55 100644 --- a/apis/namespaced/mysql/v1alpha1/zz_generated.pcu.go +++ b/apis/namespaced/mysql/v1alpha1/zz_generated.pcu.go @@ -6,24 +6,24 @@ package v1alpha1 -import xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" +import xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" // GetProviderConfigReference of this ProviderConfigUsage. -func (p *ProviderConfigUsage) GetProviderConfigReference() xpv1.ProviderConfigReference { +func (p *ProviderConfigUsage) GetProviderConfigReference() xpv2.ProviderConfigReference { return p.ProviderConfigReference } // GetResourceReference of this ProviderConfigUsage. -func (p *ProviderConfigUsage) GetResourceReference() xpv1.TypedReference { +func (p *ProviderConfigUsage) GetResourceReference() xpv2.TypedReference { return p.ResourceReference } // SetProviderConfigReference of this ProviderConfigUsage. -func (p *ProviderConfigUsage) SetProviderConfigReference(r xpv1.ProviderConfigReference) { +func (p *ProviderConfigUsage) SetProviderConfigReference(r xpv2.ProviderConfigReference) { p.ProviderConfigReference = r } // SetResourceReference of this ProviderConfigUsage. -func (p *ProviderConfigUsage) SetResourceReference(r xpv1.TypedReference) { +func (p *ProviderConfigUsage) SetResourceReference(r xpv2.TypedReference) { p.ResourceReference = r } diff --git a/apis/namespaced/mysql/v1alpha1/zz_generated.resolvers.go b/apis/namespaced/mysql/v1alpha1/zz_generated.resolvers.go deleted file mode 100644 index 06a696c7..00000000 --- a/apis/namespaced/mysql/v1alpha1/zz_generated.resolvers.go +++ /dev/null @@ -1,58 +0,0 @@ -// SPDX-FileCopyrightText: 2026 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by angryjet. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - reference "github.com/crossplane/crossplane-runtime/v2/pkg/reference" - errors "github.com/pkg/errors" - client "sigs.k8s.io/controller-runtime/pkg/client" -) - -// ResolveReferences of this Grant. -func (mg *Grant) ResolveReferences(ctx context.Context, c client.Reader) error { - r := reference.NewAPINamespacedResolver(c, mg) - - var rsp reference.NamespacedResolutionResponse - var err error - - rsp, err = r.Resolve(ctx, reference.NamespacedResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.User), - Extract: reference.ExternalName(), - Namespace: mg.GetNamespace(), - Reference: mg.Spec.ForProvider.UserRef, - Selector: mg.Spec.ForProvider.UserSelector, - To: reference.To{ - List: &UserList{}, - Managed: &User{}, - }, - }) - if err != nil { - return errors.Wrap(err, "mg.Spec.ForProvider.User") - } - mg.Spec.ForProvider.User = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.ForProvider.UserRef = rsp.ResolvedReference - - rsp, err = r.Resolve(ctx, reference.NamespacedResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.Database), - Extract: reference.ExternalName(), - Namespace: mg.GetNamespace(), - Reference: mg.Spec.ForProvider.DatabaseRef, - Selector: mg.Spec.ForProvider.DatabaseSelector, - To: reference.To{ - List: &DatabaseList{}, - Managed: &Database{}, - }, - }) - if err != nil { - return errors.Wrap(err, "mg.Spec.ForProvider.Database") - } - mg.Spec.ForProvider.Database = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.ForProvider.DatabaseRef = rsp.ResolvedReference - - return nil -} diff --git a/apis/namespaced/postgresql/v1alpha1/cluster_provider_types.go b/apis/namespaced/postgresql/v1alpha1/cluster_provider_types.go index a2f0db07..602b97ba 100644 --- a/apis/namespaced/postgresql/v1alpha1/cluster_provider_types.go +++ b/apis/namespaced/postgresql/v1alpha1/cluster_provider_types.go @@ -19,7 +19,7 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" ) // A ClusterProviderConfigSpec defines the desired state of a ClusterProviderConfig. @@ -47,7 +47,7 @@ type ClusterProviderCredentials struct { // A CredentialsSecretRef is a reference to a PostgreSQL connection secret // that contains the credentials that must be used to connect to the // provider. +optional - ConnectionSecretRef xpv1.SecretReference `json:"connectionSecretRef,omitempty"` + ConnectionSecretRef xpv2.SecretReference `json:"connectionSecretRef,omitempty"` // SecretKeyMapping allows overriding the default secret key names used // to read credentials from the connection secret. When not specified, @@ -58,7 +58,7 @@ type ClusterProviderCredentials struct { // A ClusterProviderConfigStatus reflects the observed state of a ClusterProviderConfig. type ClusterProviderConfigStatus struct { - xpv1.ProviderConfigStatus `json:",inline"` + xpv2.ProviderConfigStatus `json:",inline"` } // +kubebuilder:object:root=true diff --git a/apis/namespaced/postgresql/v1alpha1/database_types.go b/apis/namespaced/postgresql/v1alpha1/database_types.go index 43b7b7aa..45c29718 100644 --- a/apis/namespaced/postgresql/v1alpha1/database_types.go +++ b/apis/namespaced/postgresql/v1alpha1/database_types.go @@ -19,8 +19,7 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" - xpv2 "github.com/crossplane/crossplane-runtime/v2/apis/common/v2" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" ) // DatabaseStrategy sets the method that is used to create a database. @@ -46,11 +45,11 @@ type DatabaseParameters struct { // OwnerRef references the role object that will own this database. // +optional - OwnerRef *xpv1.NamespacedReference `json:"ownerRef,omitempty"` + OwnerRef *xpv2.NamespacedReference `json:"ownerRef,omitempty"` // OwnerSelector selects a reference to a Role that will own this database. // +optional - OwnerSelector *xpv1.NamespacedSelector `json:"ownerSelector,omitempty"` + OwnerSelector *xpv2.NamespacedSelector `json:"ownerSelector,omitempty"` // The name of the template from which to create the new database, or // DEFAULT to use the default template (template1). @@ -112,7 +111,7 @@ type DatabaseSpec struct { // A DatabaseStatus represents the observed state of a Database. type DatabaseStatus struct { - xpv1.ResourceStatus `json:",inline"` + xpv2.ManagedResourceStatus `json:",inline"` } // +kubebuilder:object:root=true diff --git a/apis/namespaced/postgresql/v1alpha1/default_privileges_types.go b/apis/namespaced/postgresql/v1alpha1/default_privileges_types.go index 2895f22c..419411e0 100644 --- a/apis/namespaced/postgresql/v1alpha1/default_privileges_types.go +++ b/apis/namespaced/postgresql/v1alpha1/default_privileges_types.go @@ -1,8 +1,7 @@ package v1alpha1 import ( - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" - xpv2 "github.com/crossplane/crossplane-runtime/v2/apis/common/v2" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -35,7 +34,7 @@ type DefaultPrivilegesSpec struct { // A DefaultPrivilegesStatus represents the observed state of a Grant. type DefaultPrivilegesStatus struct { - xpv1.ResourceStatus `json:",inline"` + xpv2.ManagedResourceStatus `json:",inline"` } // DefaultPrivilegesParameters defines the desired state of a Default Grant. @@ -75,12 +74,12 @@ type DefaultPrivilegesParameters struct { // RoleRef to which default privileges are granted. // +immutable // +optional - RoleRef *xpv1.NamespacedReference `json:"roleRef,omitempty"` + RoleRef *xpv2.NamespacedReference `json:"roleRef,omitempty"` // RoleSelector selects a reference to a Role this default grant is for. // +immutable // +optional - RoleSelector *xpv1.NamespacedSelector `json:"roleSelector,omitempty"` + RoleSelector *xpv2.NamespacedSelector `json:"roleSelector,omitempty"` // Database in which the default privileges are applied // +optional @@ -90,12 +89,12 @@ type DefaultPrivilegesParameters struct { // DatabaseRef references the database object this default grant it for. // +immutable // +optional - DatabaseRef *xpv1.NamespacedReference `json:"databaseRef,omitempty"` + DatabaseRef *xpv2.NamespacedReference `json:"databaseRef,omitempty"` // DatabaseSelector selects a reference to a Database this grant is for. // +immutable // +optional - DatabaseSelector *xpv1.NamespacedSelector `json:"databaseSelector,omitempty"` + DatabaseSelector *xpv2.NamespacedSelector `json:"databaseSelector,omitempty"` // Schema in which the default privileges are applied. // Not applicable when objectType is schema. diff --git a/apis/namespaced/postgresql/v1alpha1/extension_types.go b/apis/namespaced/postgresql/v1alpha1/extension_types.go index ecb5b850..065b184a 100644 --- a/apis/namespaced/postgresql/v1alpha1/extension_types.go +++ b/apis/namespaced/postgresql/v1alpha1/extension_types.go @@ -19,8 +19,7 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" - xpv2 "github.com/crossplane/crossplane-runtime/v2/apis/common/v2" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" ) // ExtensionParameters are the configurable fields of a Extension. @@ -45,12 +44,12 @@ type ExtensionParameters struct { // DatabaseRef references the database object this extension is for. // +immutable // +optional - DatabaseRef *xpv1.NamespacedReference `json:"databaseRef,omitempty"` + DatabaseRef *xpv2.NamespacedReference `json:"databaseRef,omitempty"` // DatabaseSelector selects a reference to a Database this extension is for. // +immutable // +optional - DatabaseSelector *xpv1.NamespacedSelector `json:"databaseSelector,omitempty"` + DatabaseSelector *xpv2.NamespacedSelector `json:"databaseSelector,omitempty"` } // ExtensionSpec defines the desired state of an Extension. @@ -61,7 +60,7 @@ type ExtensionSpec struct { // A ExtensionStatus represents the observed state of a Extension. type ExtensionStatus struct { - xpv1.ResourceStatus `json:",inline"` + xpv2.ManagedResourceStatus `json:",inline"` } // +kubebuilder:object:root=true diff --git a/apis/namespaced/postgresql/v1alpha1/grant_types.go b/apis/namespaced/postgresql/v1alpha1/grant_types.go index 99004214..c36c170f 100644 --- a/apis/namespaced/postgresql/v1alpha1/grant_types.go +++ b/apis/namespaced/postgresql/v1alpha1/grant_types.go @@ -23,10 +23,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" client "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" - - xpv2 "github.com/crossplane/crossplane-runtime/v2/apis/common/v2" "github.com/crossplane/crossplane-runtime/v2/pkg/reference" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/pkg/errors" ) @@ -326,12 +324,12 @@ type GrantParameters struct { // RoleRef references the role object this grant is for. // +immutable // +optional - RoleRef *xpv1.NamespacedReference `json:"roleRef,omitempty"` + RoleRef *xpv2.NamespacedReference `json:"roleRef,omitempty"` // RoleSelector selects a reference to a Role this grant is for. // +immutable // +optional - RoleSelector *xpv1.NamespacedSelector `json:"roleSelector,omitempty"` + RoleSelector *xpv2.NamespacedSelector `json:"roleSelector,omitempty"` // Database this grant is for. // +optional @@ -341,12 +339,12 @@ type GrantParameters struct { // DatabaseRef references the database object this grant it for. // +immutable // +optional - DatabaseRef *xpv1.NamespacedReference `json:"databaseRef,omitempty"` + DatabaseRef *xpv2.NamespacedReference `json:"databaseRef,omitempty"` // DatabaseSelector selects a reference to a Database this grant is for. // +immutable // +optional - DatabaseSelector *xpv1.NamespacedSelector `json:"databaseSelector,omitempty"` + DatabaseSelector *xpv2.NamespacedSelector `json:"databaseSelector,omitempty"` // Schema this grant is for. // +optional @@ -355,12 +353,12 @@ type GrantParameters struct { // SchemaRef references the schema object this grant it for. // +immutable // +optional - SchemaRef *xpv1.NamespacedReference `json:"schemaRef,omitempty"` + SchemaRef *xpv2.NamespacedReference `json:"schemaRef,omitempty"` // SchemaSelector selects a reference to a Schema this grant is for. // +immutable // +optional - SchemaSelector *xpv1.NamespacedSelector `json:"schemaSelector,omitempty"` + SchemaSelector *xpv2.NamespacedSelector `json:"schemaSelector,omitempty"` // MemberOf is the Role that this grant makes Role a member of. // +optional @@ -370,12 +368,12 @@ type GrantParameters struct { // MemberOfRef references the Role that this grant makes Role a member of. // +immutable // +optional - MemberOfRef *xpv1.NamespacedReference `json:"memberOfRef,omitempty"` + MemberOfRef *xpv2.NamespacedReference `json:"memberOfRef,omitempty"` // MemberOfSelector selects a reference to a Role that this grant makes Role a member of. // +immutable // +optional - MemberOfSelector *xpv1.NamespacedSelector `json:"memberOfSelector,omitempty"` + MemberOfSelector *xpv2.NamespacedSelector `json:"memberOfSelector,omitempty"` // RevokePublicOnDb apply the statement "REVOKE ALL ON DATABASE %s FROM PUBLIC" to make database unreachable from public // +optional @@ -422,7 +420,7 @@ type GrantParameters struct { // A GrantStatus represents the observed state of a Grant. type GrantStatus struct { - xpv1.ResourceStatus `json:",inline"` + xpv2.ManagedResourceStatus `json:",inline"` } // +kubebuilder:object:root=true diff --git a/apis/namespaced/postgresql/v1alpha1/provider_types.go b/apis/namespaced/postgresql/v1alpha1/provider_types.go index e1597550..3bdbfb60 100644 --- a/apis/namespaced/postgresql/v1alpha1/provider_types.go +++ b/apis/namespaced/postgresql/v1alpha1/provider_types.go @@ -19,8 +19,7 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" - xpv2 "github.com/crossplane/crossplane-runtime/v2/apis/common/v2" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" ) // A ProviderConfigSpec defines the desired state of a ProviderConfig. @@ -57,7 +56,7 @@ type ProviderCredentials struct { // A CredentialsSecretRef is a reference to a PostgreSQL connection secret // that contains the credentials that must be used to connect to the // provider. +optional - ConnectionSecretRef xpv1.LocalSecretReference `json:"connectionSecretRef,omitempty"` + ConnectionSecretRef xpv2.LocalSecretReference `json:"connectionSecretRef,omitempty"` // SecretKeyMapping allows overriding the default secret key names used // to read credentials from the connection secret. When not specified, @@ -107,7 +106,7 @@ func (m *SecretKeyMapping) ToMap() map[string]string { // A ProviderConfigStatus reflects the observed state of a ProviderConfig. type ProviderConfigStatus struct { - xpv1.ProviderConfigStatus `json:",inline"` + xpv2.ProviderConfigStatus `json:",inline"` } // +kubebuilder:object:root=true diff --git a/apis/namespaced/postgresql/v1alpha1/role_types.go b/apis/namespaced/postgresql/v1alpha1/role_types.go index b0c62ecb..9562119f 100644 --- a/apis/namespaced/postgresql/v1alpha1/role_types.go +++ b/apis/namespaced/postgresql/v1alpha1/role_types.go @@ -19,8 +19,7 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" - xpv2 "github.com/crossplane/crossplane-runtime/v2/apis/common/v2" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" ) // A RoleSpec defines the desired state of a Role. @@ -31,8 +30,8 @@ type RoleSpec struct { // A RoleStatus represents the observed state of a Role. type RoleStatus struct { - xpv1.ResourceStatus `json:",inline"` - AtProvider RoleObservation `json:"atProvider,omitempty"` + xpv2.ManagedResourceStatus `json:",inline"` + AtProvider RoleObservation `json:"atProvider,omitempty"` } // RolePrivilege is the PostgreSQL identifier to add or remove a permission @@ -83,7 +82,7 @@ type RoleParameters struct { // PasswordSecretRef references the secret that contains the password used // for this role. If no reference is given, a password will be auto-generated. // +optional - PasswordSecretRef *xpv1.LocalSecretKeySelector `json:"passwordSecretRef,omitempty"` + PasswordSecretRef *xpv2.LocalSecretKeySelector `json:"passwordSecretRef,omitempty"` // ConfigurationParameters to be applied to the role. If specified, any other configuration parameters set on the // role in the database will be reset. diff --git a/apis/namespaced/postgresql/v1alpha1/schema_types.go b/apis/namespaced/postgresql/v1alpha1/schema_types.go index 77bf7fd9..8aba6a51 100644 --- a/apis/namespaced/postgresql/v1alpha1/schema_types.go +++ b/apis/namespaced/postgresql/v1alpha1/schema_types.go @@ -19,8 +19,7 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" - xpv2 "github.com/crossplane/crossplane-runtime/v2/apis/common/v2" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" ) // DropBehavior sets the method that is used to drop a schema @@ -49,12 +48,12 @@ type SchemaParameters struct { // RoleRef references the role object this schema is for. // +immutable // +optional - RoleRef *xpv1.NamespacedReference `json:"roleRef,omitempty"` + RoleRef *xpv2.NamespacedReference `json:"roleRef,omitempty"` // RoleSelector selects a reference to a Role this schema is for. // +immutable // +optional - RoleSelector *xpv1.NamespacedSelector `json:"roleSelector,omitempty"` + RoleSelector *xpv2.NamespacedSelector `json:"roleSelector,omitempty"` // Database this schema is for. // +optional @@ -64,12 +63,12 @@ type SchemaParameters struct { // DatabaseRef references the database object this schema is for. // +immutable // +optional - DatabaseRef *xpv1.NamespacedReference `json:"databaseRef,omitempty"` + DatabaseRef *xpv2.NamespacedReference `json:"databaseRef,omitempty"` // DatabaseSelector selects a reference to a Database this schema is for. // +immutable // +optional - DatabaseSelector *xpv1.NamespacedSelector `json:"databaseSelector,omitempty"` + DatabaseSelector *xpv2.NamespacedSelector `json:"databaseSelector,omitempty"` // RevokePublicOnSchema apply a "REVOKE ALL ON SCHEMA public FROM public" statement // +optional @@ -87,7 +86,7 @@ type SchemaParameters struct { // A SchemaStatus represents the observed state of a Schema. type SchemaStatus struct { - xpv1.ResourceStatus `json:",inline"` + xpv2.ManagedResourceStatus `json:",inline"` } // +kubebuilder:object:root=true diff --git a/apis/namespaced/postgresql/v1alpha1/zz_generated.deepcopy.go b/apis/namespaced/postgresql/v1alpha1/zz_generated.deepcopy.go index 31d4b943..fc158d79 100644 --- a/apis/namespaced/postgresql/v1alpha1/zz_generated.deepcopy.go +++ b/apis/namespaced/postgresql/v1alpha1/zz_generated.deepcopy.go @@ -9,7 +9,7 @@ package v1alpha1 import ( - "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" + "github.com/crossplane/crossplane/apis/v2/core/v2" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -112,7 +112,7 @@ func (in *ClusterProviderConfigStatus) DeepCopy() *ClusterProviderConfigStatus { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterProviderCredentials) DeepCopyInto(out *ClusterProviderCredentials) { *out = *in - in.ConnectionSecretRef.DeepCopyInto(&out.ConnectionSecretRef) + out.ConnectionSecretRef = in.ConnectionSecretRef if in.SecretKeyMapping != nil { in, out := &in.SecretKeyMapping, &out.SecretKeyMapping *out = new(SecretKeyMapping) @@ -199,12 +199,12 @@ func (in *DatabaseParameters) DeepCopyInto(out *DatabaseParameters) { } if in.OwnerRef != nil { in, out := &in.OwnerRef, &out.OwnerRef - *out = new(v1.NamespacedReference) + *out = new(v2.NamespacedReference) (*in).DeepCopyInto(*out) } if in.OwnerSelector != nil { in, out := &in.OwnerSelector, &out.OwnerSelector - *out = new(v1.NamespacedSelector) + *out = new(v2.NamespacedSelector) (*in).DeepCopyInto(*out) } if in.Template != nil { @@ -284,7 +284,7 @@ func (in *DatabaseSpec) DeepCopy() *DatabaseSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DatabaseStatus) DeepCopyInto(out *DatabaseStatus) { *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.ManagedResourceStatus.DeepCopyInto(&out.ManagedResourceStatus) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseStatus. @@ -386,12 +386,12 @@ func (in *DefaultPrivilegesParameters) DeepCopyInto(out *DefaultPrivilegesParame } if in.RoleRef != nil { in, out := &in.RoleRef, &out.RoleRef - *out = new(v1.NamespacedReference) + *out = new(v2.NamespacedReference) (*in).DeepCopyInto(*out) } if in.RoleSelector != nil { in, out := &in.RoleSelector, &out.RoleSelector - *out = new(v1.NamespacedSelector) + *out = new(v2.NamespacedSelector) (*in).DeepCopyInto(*out) } if in.Database != nil { @@ -401,12 +401,12 @@ func (in *DefaultPrivilegesParameters) DeepCopyInto(out *DefaultPrivilegesParame } if in.DatabaseRef != nil { in, out := &in.DatabaseRef, &out.DatabaseRef - *out = new(v1.NamespacedReference) + *out = new(v2.NamespacedReference) (*in).DeepCopyInto(*out) } if in.DatabaseSelector != nil { in, out := &in.DatabaseSelector, &out.DatabaseSelector - *out = new(v1.NamespacedSelector) + *out = new(v2.NamespacedSelector) (*in).DeepCopyInto(*out) } if in.Schema != nil { @@ -446,7 +446,7 @@ func (in *DefaultPrivilegesSpec) DeepCopy() *DefaultPrivilegesSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DefaultPrivilegesStatus) DeepCopyInto(out *DefaultPrivilegesStatus) { *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.ManagedResourceStatus.DeepCopyInto(&out.ManagedResourceStatus) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DefaultPrivilegesStatus. @@ -538,12 +538,12 @@ func (in *ExtensionParameters) DeepCopyInto(out *ExtensionParameters) { } if in.DatabaseRef != nil { in, out := &in.DatabaseRef, &out.DatabaseRef - *out = new(v1.NamespacedReference) + *out = new(v2.NamespacedReference) (*in).DeepCopyInto(*out) } if in.DatabaseSelector != nil { in, out := &in.DatabaseSelector, &out.DatabaseSelector - *out = new(v1.NamespacedSelector) + *out = new(v2.NamespacedSelector) (*in).DeepCopyInto(*out) } } @@ -578,7 +578,7 @@ func (in *ExtensionSpec) DeepCopy() *ExtensionSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExtensionStatus) DeepCopyInto(out *ExtensionStatus) { *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.ManagedResourceStatus.DeepCopyInto(&out.ManagedResourceStatus) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionStatus. @@ -670,12 +670,12 @@ func (in *GrantParameters) DeepCopyInto(out *GrantParameters) { } if in.RoleRef != nil { in, out := &in.RoleRef, &out.RoleRef - *out = new(v1.NamespacedReference) + *out = new(v2.NamespacedReference) (*in).DeepCopyInto(*out) } if in.RoleSelector != nil { in, out := &in.RoleSelector, &out.RoleSelector - *out = new(v1.NamespacedSelector) + *out = new(v2.NamespacedSelector) (*in).DeepCopyInto(*out) } if in.Database != nil { @@ -685,12 +685,12 @@ func (in *GrantParameters) DeepCopyInto(out *GrantParameters) { } if in.DatabaseRef != nil { in, out := &in.DatabaseRef, &out.DatabaseRef - *out = new(v1.NamespacedReference) + *out = new(v2.NamespacedReference) (*in).DeepCopyInto(*out) } if in.DatabaseSelector != nil { in, out := &in.DatabaseSelector, &out.DatabaseSelector - *out = new(v1.NamespacedSelector) + *out = new(v2.NamespacedSelector) (*in).DeepCopyInto(*out) } if in.Schema != nil { @@ -700,12 +700,12 @@ func (in *GrantParameters) DeepCopyInto(out *GrantParameters) { } if in.SchemaRef != nil { in, out := &in.SchemaRef, &out.SchemaRef - *out = new(v1.NamespacedReference) + *out = new(v2.NamespacedReference) (*in).DeepCopyInto(*out) } if in.SchemaSelector != nil { in, out := &in.SchemaSelector, &out.SchemaSelector - *out = new(v1.NamespacedSelector) + *out = new(v2.NamespacedSelector) (*in).DeepCopyInto(*out) } if in.MemberOf != nil { @@ -715,12 +715,12 @@ func (in *GrantParameters) DeepCopyInto(out *GrantParameters) { } if in.MemberOfRef != nil { in, out := &in.MemberOfRef, &out.MemberOfRef - *out = new(v1.NamespacedReference) + *out = new(v2.NamespacedReference) (*in).DeepCopyInto(*out) } if in.MemberOfSelector != nil { in, out := &in.MemberOfSelector, &out.MemberOfSelector - *out = new(v1.NamespacedSelector) + *out = new(v2.NamespacedSelector) (*in).DeepCopyInto(*out) } if in.RevokePublicOnDb != nil { @@ -816,7 +816,7 @@ func (in *GrantSpec) DeepCopy() *GrantSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GrantStatus) DeepCopyInto(out *GrantStatus) { *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.ManagedResourceStatus.DeepCopyInto(&out.ManagedResourceStatus) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GrantStatus. @@ -930,7 +930,7 @@ func (in *ProviderConfigUsage) DeepCopyInto(out *ProviderConfigUsage) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.TypedProviderConfigUsage.DeepCopyInto(&out.TypedProviderConfigUsage) + out.TypedProviderConfigUsage = in.TypedProviderConfigUsage } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderConfigUsage. @@ -986,7 +986,7 @@ func (in *ProviderConfigUsageList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ProviderCredentials) DeepCopyInto(out *ProviderCredentials) { *out = *in - in.ConnectionSecretRef.DeepCopyInto(&out.ConnectionSecretRef) + out.ConnectionSecretRef = in.ConnectionSecretRef if in.SecretKeyMapping != nil { in, out := &in.SecretKeyMapping, &out.SecretKeyMapping *out = new(SecretKeyMapping) @@ -1122,7 +1122,7 @@ func (in *RoleParameters) DeepCopyInto(out *RoleParameters) { in.Privileges.DeepCopyInto(&out.Privileges) if in.PasswordSecretRef != nil { in, out := &in.PasswordSecretRef, &out.PasswordSecretRef - *out = new(v1.LocalSecretKeySelector) + *out = new(v2.LocalSecretKeySelector) **out = **in } if in.ConfigurationParameters != nil { @@ -1220,7 +1220,7 @@ func (in *RoleSpec) DeepCopy() *RoleSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RoleStatus) DeepCopyInto(out *RoleStatus) { *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.ManagedResourceStatus.DeepCopyInto(&out.ManagedResourceStatus) in.AtProvider.DeepCopyInto(&out.AtProvider) } @@ -1323,12 +1323,12 @@ func (in *SchemaParameters) DeepCopyInto(out *SchemaParameters) { } if in.RoleRef != nil { in, out := &in.RoleRef, &out.RoleRef - *out = new(v1.NamespacedReference) + *out = new(v2.NamespacedReference) (*in).DeepCopyInto(*out) } if in.RoleSelector != nil { in, out := &in.RoleSelector, &out.RoleSelector - *out = new(v1.NamespacedSelector) + *out = new(v2.NamespacedSelector) (*in).DeepCopyInto(*out) } if in.Database != nil { @@ -1338,12 +1338,12 @@ func (in *SchemaParameters) DeepCopyInto(out *SchemaParameters) { } if in.DatabaseRef != nil { in, out := &in.DatabaseRef, &out.DatabaseRef - *out = new(v1.NamespacedReference) + *out = new(v2.NamespacedReference) (*in).DeepCopyInto(*out) } if in.DatabaseSelector != nil { in, out := &in.DatabaseSelector, &out.DatabaseSelector - *out = new(v1.NamespacedSelector) + *out = new(v2.NamespacedSelector) (*in).DeepCopyInto(*out) } if in.RevokePublicOnSchema != nil { @@ -1388,7 +1388,7 @@ func (in *SchemaSpec) DeepCopy() *SchemaSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SchemaStatus) DeepCopyInto(out *SchemaStatus) { *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.ManagedResourceStatus.DeepCopyInto(&out.ManagedResourceStatus) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchemaStatus. diff --git a/apis/namespaced/postgresql/v1alpha1/zz_generated.managed.go b/apis/namespaced/postgresql/v1alpha1/zz_generated.managed.go index 92dac395..715a7ab2 100644 --- a/apis/namespaced/postgresql/v1alpha1/zz_generated.managed.go +++ b/apis/namespaced/postgresql/v1alpha1/zz_generated.managed.go @@ -6,244 +6,244 @@ package v1alpha1 -import xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" +import xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" // GetCondition of this Database. -func (mg *Database) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (mg *Database) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return mg.Status.GetCondition(ct) } // GetManagementPolicies of this Database. -func (mg *Database) GetManagementPolicies() xpv1.ManagementPolicies { +func (mg *Database) GetManagementPolicies() xpv2.ManagementPolicies { return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Database. -func (mg *Database) GetProviderConfigReference() *xpv1.ProviderConfigReference { +func (mg *Database) GetProviderConfigReference() *xpv2.ProviderConfigReference { return mg.Spec.ProviderConfigReference } // GetWriteConnectionSecretToReference of this Database. -func (mg *Database) GetWriteConnectionSecretToReference() *xpv1.LocalSecretReference { +func (mg *Database) GetWriteConnectionSecretToReference() *xpv2.LocalSecretReference { return mg.Spec.WriteConnectionSecretToReference } // SetConditions of this Database. -func (mg *Database) SetConditions(c ...xpv1.Condition) { +func (mg *Database) SetConditions(c ...xpv2.Condition) { mg.Status.SetConditions(c...) } // SetManagementPolicies of this Database. -func (mg *Database) SetManagementPolicies(r xpv1.ManagementPolicies) { +func (mg *Database) SetManagementPolicies(r xpv2.ManagementPolicies) { mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Database. -func (mg *Database) SetProviderConfigReference(r *xpv1.ProviderConfigReference) { +func (mg *Database) SetProviderConfigReference(r *xpv2.ProviderConfigReference) { mg.Spec.ProviderConfigReference = r } // SetWriteConnectionSecretToReference of this Database. -func (mg *Database) SetWriteConnectionSecretToReference(r *xpv1.LocalSecretReference) { +func (mg *Database) SetWriteConnectionSecretToReference(r *xpv2.LocalSecretReference) { mg.Spec.WriteConnectionSecretToReference = r } // GetCondition of this DefaultPrivileges. -func (mg *DefaultPrivileges) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (mg *DefaultPrivileges) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return mg.Status.GetCondition(ct) } // GetManagementPolicies of this DefaultPrivileges. -func (mg *DefaultPrivileges) GetManagementPolicies() xpv1.ManagementPolicies { +func (mg *DefaultPrivileges) GetManagementPolicies() xpv2.ManagementPolicies { return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this DefaultPrivileges. -func (mg *DefaultPrivileges) GetProviderConfigReference() *xpv1.ProviderConfigReference { +func (mg *DefaultPrivileges) GetProviderConfigReference() *xpv2.ProviderConfigReference { return mg.Spec.ProviderConfigReference } // GetWriteConnectionSecretToReference of this DefaultPrivileges. -func (mg *DefaultPrivileges) GetWriteConnectionSecretToReference() *xpv1.LocalSecretReference { +func (mg *DefaultPrivileges) GetWriteConnectionSecretToReference() *xpv2.LocalSecretReference { return mg.Spec.WriteConnectionSecretToReference } // SetConditions of this DefaultPrivileges. -func (mg *DefaultPrivileges) SetConditions(c ...xpv1.Condition) { +func (mg *DefaultPrivileges) SetConditions(c ...xpv2.Condition) { mg.Status.SetConditions(c...) } // SetManagementPolicies of this DefaultPrivileges. -func (mg *DefaultPrivileges) SetManagementPolicies(r xpv1.ManagementPolicies) { +func (mg *DefaultPrivileges) SetManagementPolicies(r xpv2.ManagementPolicies) { mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this DefaultPrivileges. -func (mg *DefaultPrivileges) SetProviderConfigReference(r *xpv1.ProviderConfigReference) { +func (mg *DefaultPrivileges) SetProviderConfigReference(r *xpv2.ProviderConfigReference) { mg.Spec.ProviderConfigReference = r } // SetWriteConnectionSecretToReference of this DefaultPrivileges. -func (mg *DefaultPrivileges) SetWriteConnectionSecretToReference(r *xpv1.LocalSecretReference) { +func (mg *DefaultPrivileges) SetWriteConnectionSecretToReference(r *xpv2.LocalSecretReference) { mg.Spec.WriteConnectionSecretToReference = r } // GetCondition of this Extension. -func (mg *Extension) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (mg *Extension) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return mg.Status.GetCondition(ct) } // GetManagementPolicies of this Extension. -func (mg *Extension) GetManagementPolicies() xpv1.ManagementPolicies { +func (mg *Extension) GetManagementPolicies() xpv2.ManagementPolicies { return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Extension. -func (mg *Extension) GetProviderConfigReference() *xpv1.ProviderConfigReference { +func (mg *Extension) GetProviderConfigReference() *xpv2.ProviderConfigReference { return mg.Spec.ProviderConfigReference } // GetWriteConnectionSecretToReference of this Extension. -func (mg *Extension) GetWriteConnectionSecretToReference() *xpv1.LocalSecretReference { +func (mg *Extension) GetWriteConnectionSecretToReference() *xpv2.LocalSecretReference { return mg.Spec.WriteConnectionSecretToReference } // SetConditions of this Extension. -func (mg *Extension) SetConditions(c ...xpv1.Condition) { +func (mg *Extension) SetConditions(c ...xpv2.Condition) { mg.Status.SetConditions(c...) } // SetManagementPolicies of this Extension. -func (mg *Extension) SetManagementPolicies(r xpv1.ManagementPolicies) { +func (mg *Extension) SetManagementPolicies(r xpv2.ManagementPolicies) { mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Extension. -func (mg *Extension) SetProviderConfigReference(r *xpv1.ProviderConfigReference) { +func (mg *Extension) SetProviderConfigReference(r *xpv2.ProviderConfigReference) { mg.Spec.ProviderConfigReference = r } // SetWriteConnectionSecretToReference of this Extension. -func (mg *Extension) SetWriteConnectionSecretToReference(r *xpv1.LocalSecretReference) { +func (mg *Extension) SetWriteConnectionSecretToReference(r *xpv2.LocalSecretReference) { mg.Spec.WriteConnectionSecretToReference = r } // GetCondition of this Grant. -func (mg *Grant) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (mg *Grant) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return mg.Status.GetCondition(ct) } // GetManagementPolicies of this Grant. -func (mg *Grant) GetManagementPolicies() xpv1.ManagementPolicies { +func (mg *Grant) GetManagementPolicies() xpv2.ManagementPolicies { return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Grant. -func (mg *Grant) GetProviderConfigReference() *xpv1.ProviderConfigReference { +func (mg *Grant) GetProviderConfigReference() *xpv2.ProviderConfigReference { return mg.Spec.ProviderConfigReference } // GetWriteConnectionSecretToReference of this Grant. -func (mg *Grant) GetWriteConnectionSecretToReference() *xpv1.LocalSecretReference { +func (mg *Grant) GetWriteConnectionSecretToReference() *xpv2.LocalSecretReference { return mg.Spec.WriteConnectionSecretToReference } // SetConditions of this Grant. -func (mg *Grant) SetConditions(c ...xpv1.Condition) { +func (mg *Grant) SetConditions(c ...xpv2.Condition) { mg.Status.SetConditions(c...) } // SetManagementPolicies of this Grant. -func (mg *Grant) SetManagementPolicies(r xpv1.ManagementPolicies) { +func (mg *Grant) SetManagementPolicies(r xpv2.ManagementPolicies) { mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Grant. -func (mg *Grant) SetProviderConfigReference(r *xpv1.ProviderConfigReference) { +func (mg *Grant) SetProviderConfigReference(r *xpv2.ProviderConfigReference) { mg.Spec.ProviderConfigReference = r } // SetWriteConnectionSecretToReference of this Grant. -func (mg *Grant) SetWriteConnectionSecretToReference(r *xpv1.LocalSecretReference) { +func (mg *Grant) SetWriteConnectionSecretToReference(r *xpv2.LocalSecretReference) { mg.Spec.WriteConnectionSecretToReference = r } // GetCondition of this Role. -func (mg *Role) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (mg *Role) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return mg.Status.GetCondition(ct) } // GetManagementPolicies of this Role. -func (mg *Role) GetManagementPolicies() xpv1.ManagementPolicies { +func (mg *Role) GetManagementPolicies() xpv2.ManagementPolicies { return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Role. -func (mg *Role) GetProviderConfigReference() *xpv1.ProviderConfigReference { +func (mg *Role) GetProviderConfigReference() *xpv2.ProviderConfigReference { return mg.Spec.ProviderConfigReference } // GetWriteConnectionSecretToReference of this Role. -func (mg *Role) GetWriteConnectionSecretToReference() *xpv1.LocalSecretReference { +func (mg *Role) GetWriteConnectionSecretToReference() *xpv2.LocalSecretReference { return mg.Spec.WriteConnectionSecretToReference } // SetConditions of this Role. -func (mg *Role) SetConditions(c ...xpv1.Condition) { +func (mg *Role) SetConditions(c ...xpv2.Condition) { mg.Status.SetConditions(c...) } // SetManagementPolicies of this Role. -func (mg *Role) SetManagementPolicies(r xpv1.ManagementPolicies) { +func (mg *Role) SetManagementPolicies(r xpv2.ManagementPolicies) { mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Role. -func (mg *Role) SetProviderConfigReference(r *xpv1.ProviderConfigReference) { +func (mg *Role) SetProviderConfigReference(r *xpv2.ProviderConfigReference) { mg.Spec.ProviderConfigReference = r } // SetWriteConnectionSecretToReference of this Role. -func (mg *Role) SetWriteConnectionSecretToReference(r *xpv1.LocalSecretReference) { +func (mg *Role) SetWriteConnectionSecretToReference(r *xpv2.LocalSecretReference) { mg.Spec.WriteConnectionSecretToReference = r } // GetCondition of this Schema. -func (mg *Schema) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (mg *Schema) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return mg.Status.GetCondition(ct) } // GetManagementPolicies of this Schema. -func (mg *Schema) GetManagementPolicies() xpv1.ManagementPolicies { +func (mg *Schema) GetManagementPolicies() xpv2.ManagementPolicies { return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Schema. -func (mg *Schema) GetProviderConfigReference() *xpv1.ProviderConfigReference { +func (mg *Schema) GetProviderConfigReference() *xpv2.ProviderConfigReference { return mg.Spec.ProviderConfigReference } // GetWriteConnectionSecretToReference of this Schema. -func (mg *Schema) GetWriteConnectionSecretToReference() *xpv1.LocalSecretReference { +func (mg *Schema) GetWriteConnectionSecretToReference() *xpv2.LocalSecretReference { return mg.Spec.WriteConnectionSecretToReference } // SetConditions of this Schema. -func (mg *Schema) SetConditions(c ...xpv1.Condition) { +func (mg *Schema) SetConditions(c ...xpv2.Condition) { mg.Status.SetConditions(c...) } // SetManagementPolicies of this Schema. -func (mg *Schema) SetManagementPolicies(r xpv1.ManagementPolicies) { +func (mg *Schema) SetManagementPolicies(r xpv2.ManagementPolicies) { mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Schema. -func (mg *Schema) SetProviderConfigReference(r *xpv1.ProviderConfigReference) { +func (mg *Schema) SetProviderConfigReference(r *xpv2.ProviderConfigReference) { mg.Spec.ProviderConfigReference = r } // SetWriteConnectionSecretToReference of this Schema. -func (mg *Schema) SetWriteConnectionSecretToReference(r *xpv1.LocalSecretReference) { +func (mg *Schema) SetWriteConnectionSecretToReference(r *xpv2.LocalSecretReference) { mg.Spec.WriteConnectionSecretToReference = r } diff --git a/apis/namespaced/postgresql/v1alpha1/zz_generated.pc.go b/apis/namespaced/postgresql/v1alpha1/zz_generated.pc.go index 172e5157..6f296fe6 100644 --- a/apis/namespaced/postgresql/v1alpha1/zz_generated.pc.go +++ b/apis/namespaced/postgresql/v1alpha1/zz_generated.pc.go @@ -6,10 +6,10 @@ package v1alpha1 -import xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" +import xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" // GetCondition of this ClusterProviderConfig. -func (p *ClusterProviderConfig) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (p *ClusterProviderConfig) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return p.Status.GetCondition(ct) } @@ -19,7 +19,7 @@ func (p *ClusterProviderConfig) GetUsers() int64 { } // SetConditions of this ClusterProviderConfig. -func (p *ClusterProviderConfig) SetConditions(c ...xpv1.Condition) { +func (p *ClusterProviderConfig) SetConditions(c ...xpv2.Condition) { p.Status.SetConditions(c...) } @@ -29,7 +29,7 @@ func (p *ClusterProviderConfig) SetUsers(i int64) { } // GetCondition of this ProviderConfig. -func (p *ProviderConfig) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +func (p *ProviderConfig) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return p.Status.GetCondition(ct) } @@ -39,7 +39,7 @@ func (p *ProviderConfig) GetUsers() int64 { } // SetConditions of this ProviderConfig. -func (p *ProviderConfig) SetConditions(c ...xpv1.Condition) { +func (p *ProviderConfig) SetConditions(c ...xpv2.Condition) { p.Status.SetConditions(c...) } diff --git a/apis/namespaced/postgresql/v1alpha1/zz_generated.pcu.go b/apis/namespaced/postgresql/v1alpha1/zz_generated.pcu.go index c4bf4c8d..0e9ccc55 100644 --- a/apis/namespaced/postgresql/v1alpha1/zz_generated.pcu.go +++ b/apis/namespaced/postgresql/v1alpha1/zz_generated.pcu.go @@ -6,24 +6,24 @@ package v1alpha1 -import xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" +import xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" // GetProviderConfigReference of this ProviderConfigUsage. -func (p *ProviderConfigUsage) GetProviderConfigReference() xpv1.ProviderConfigReference { +func (p *ProviderConfigUsage) GetProviderConfigReference() xpv2.ProviderConfigReference { return p.ProviderConfigReference } // GetResourceReference of this ProviderConfigUsage. -func (p *ProviderConfigUsage) GetResourceReference() xpv1.TypedReference { +func (p *ProviderConfigUsage) GetResourceReference() xpv2.TypedReference { return p.ResourceReference } // SetProviderConfigReference of this ProviderConfigUsage. -func (p *ProviderConfigUsage) SetProviderConfigReference(r xpv1.ProviderConfigReference) { +func (p *ProviderConfigUsage) SetProviderConfigReference(r xpv2.ProviderConfigReference) { p.ProviderConfigReference = r } // SetResourceReference of this ProviderConfigUsage. -func (p *ProviderConfigUsage) SetResourceReference(r xpv1.TypedReference) { +func (p *ProviderConfigUsage) SetResourceReference(r xpv2.TypedReference) { p.ResourceReference = r } diff --git a/apis/namespaced/postgresql/v1alpha1/zz_generated.resolvers.go b/apis/namespaced/postgresql/v1alpha1/zz_generated.resolvers.go deleted file mode 100644 index 4f6ea6e0..00000000 --- a/apis/namespaced/postgresql/v1alpha1/zz_generated.resolvers.go +++ /dev/null @@ -1,156 +0,0 @@ -// SPDX-FileCopyrightText: 2026 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by angryjet. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - reference "github.com/crossplane/crossplane-runtime/v2/pkg/reference" - errors "github.com/pkg/errors" - client "sigs.k8s.io/controller-runtime/pkg/client" -) - -// ResolveReferences of this Database. -func (mg *Database) ResolveReferences(ctx context.Context, c client.Reader) error { - r := reference.NewAPINamespacedResolver(c, mg) - - var rsp reference.NamespacedResolutionResponse - var err error - - rsp, err = r.Resolve(ctx, reference.NamespacedResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.Owner), - Extract: reference.ExternalName(), - Namespace: mg.GetNamespace(), - Reference: mg.Spec.ForProvider.OwnerRef, - Selector: mg.Spec.ForProvider.OwnerSelector, - To: reference.To{ - List: &RoleList{}, - Managed: &Role{}, - }, - }) - if err != nil { - return errors.Wrap(err, "mg.Spec.ForProvider.Owner") - } - mg.Spec.ForProvider.Owner = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.ForProvider.OwnerRef = rsp.ResolvedReference - - return nil -} - -// ResolveReferences of this DefaultPrivileges. -func (mg *DefaultPrivileges) ResolveReferences(ctx context.Context, c client.Reader) error { - r := reference.NewAPINamespacedResolver(c, mg) - - var rsp reference.NamespacedResolutionResponse - var err error - - rsp, err = r.Resolve(ctx, reference.NamespacedResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.Role), - Extract: reference.ExternalName(), - Namespace: mg.GetNamespace(), - Reference: mg.Spec.ForProvider.RoleRef, - Selector: mg.Spec.ForProvider.RoleSelector, - To: reference.To{ - List: &RoleList{}, - Managed: &Role{}, - }, - }) - if err != nil { - return errors.Wrap(err, "mg.Spec.ForProvider.Role") - } - mg.Spec.ForProvider.Role = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.ForProvider.RoleRef = rsp.ResolvedReference - - rsp, err = r.Resolve(ctx, reference.NamespacedResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.Database), - Extract: reference.ExternalName(), - Namespace: mg.GetNamespace(), - Reference: mg.Spec.ForProvider.DatabaseRef, - Selector: mg.Spec.ForProvider.DatabaseSelector, - To: reference.To{ - List: &DatabaseList{}, - Managed: &Database{}, - }, - }) - if err != nil { - return errors.Wrap(err, "mg.Spec.ForProvider.Database") - } - mg.Spec.ForProvider.Database = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.ForProvider.DatabaseRef = rsp.ResolvedReference - - return nil -} - -// ResolveReferences of this Extension. -func (mg *Extension) ResolveReferences(ctx context.Context, c client.Reader) error { - r := reference.NewAPINamespacedResolver(c, mg) - - var rsp reference.NamespacedResolutionResponse - var err error - - rsp, err = r.Resolve(ctx, reference.NamespacedResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.Database), - Extract: reference.ExternalName(), - Namespace: mg.GetNamespace(), - Reference: mg.Spec.ForProvider.DatabaseRef, - Selector: mg.Spec.ForProvider.DatabaseSelector, - To: reference.To{ - List: &DatabaseList{}, - Managed: &Database{}, - }, - }) - if err != nil { - return errors.Wrap(err, "mg.Spec.ForProvider.Database") - } - mg.Spec.ForProvider.Database = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.ForProvider.DatabaseRef = rsp.ResolvedReference - - return nil -} - -// ResolveReferences of this Schema. -func (mg *Schema) ResolveReferences(ctx context.Context, c client.Reader) error { - r := reference.NewAPINamespacedResolver(c, mg) - - var rsp reference.NamespacedResolutionResponse - var err error - - rsp, err = r.Resolve(ctx, reference.NamespacedResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.Role), - Extract: reference.ExternalName(), - Namespace: mg.GetNamespace(), - Reference: mg.Spec.ForProvider.RoleRef, - Selector: mg.Spec.ForProvider.RoleSelector, - To: reference.To{ - List: &RoleList{}, - Managed: &Role{}, - }, - }) - if err != nil { - return errors.Wrap(err, "mg.Spec.ForProvider.Role") - } - mg.Spec.ForProvider.Role = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.ForProvider.RoleRef = rsp.ResolvedReference - - rsp, err = r.Resolve(ctx, reference.NamespacedResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.Database), - Extract: reference.ExternalName(), - Namespace: mg.GetNamespace(), - Reference: mg.Spec.ForProvider.DatabaseRef, - Selector: mg.Spec.ForProvider.DatabaseSelector, - To: reference.To{ - List: &DatabaseList{}, - Managed: &Database{}, - }, - }) - if err != nil { - return errors.Wrap(err, "mg.Spec.ForProvider.Database") - } - mg.Spec.ForProvider.Database = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.ForProvider.DatabaseRef = rsp.ResolvedReference - - return nil -} diff --git a/go.mod b/go.mod index dc991cce..d9df2701 100644 --- a/go.mod +++ b/go.mod @@ -5,16 +5,17 @@ go 1.26.1 require ( github.com/DATA-DOG/go-sqlmock v1.5.2 github.com/alecthomas/kingpin/v2 v2.4.0 - github.com/crossplane/crossplane-runtime/v2 v2.2.1 + github.com/crossplane/crossplane-runtime/v2 v2.3.3 github.com/crossplane/crossplane-tools v0.0.0-20250731192036-00d407d8b7ec + github.com/crossplane/crossplane/apis/v2 v2.3.4 github.com/crossplane/upjet/v2 v2.2.0 github.com/go-sql-driver/mysql v1.10.0 github.com/google/go-cmp v0.7.0 github.com/lib/pq v1.12.3 github.com/microsoft/go-mssqldb v1.10.0 github.com/pkg/errors v0.9.1 - k8s.io/api v0.35.0 - k8s.io/apimachinery v0.35.0 + k8s.io/api v0.35.1 + k8s.io/apimachinery v0.35.1 k8s.io/utils v0.0.0-20260108192941-914a6e750570 sigs.k8s.io/controller-runtime v0.23.1 sigs.k8s.io/controller-tools v0.20.0 @@ -30,7 +31,6 @@ require ( github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/blang/semver/v4 v4.0.0 // indirect - github.com/cenkalti/backoff/v5 v5.0.3 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/dave/jennifer v1.7.1 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect @@ -42,20 +42,20 @@ require ( github.com/fxamacker/cbor/v2 v2.9.0 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/zapr v1.3.0 // indirect - github.com/go-openapi/jsonpointer v0.22.4 // indirect - github.com/go-openapi/jsonreference v0.21.4 // indirect - github.com/go-openapi/swag v0.25.4 // indirect - github.com/go-openapi/swag/cmdutils v0.25.4 // indirect - github.com/go-openapi/swag/conv v0.25.4 // indirect - github.com/go-openapi/swag/fileutils v0.25.4 // indirect - github.com/go-openapi/swag/jsonname v0.25.4 // indirect - github.com/go-openapi/swag/jsonutils v0.25.4 // indirect - github.com/go-openapi/swag/loading v0.25.4 // indirect - github.com/go-openapi/swag/mangling v0.25.4 // indirect - github.com/go-openapi/swag/netutils v0.25.4 // indirect - github.com/go-openapi/swag/stringutils v0.25.4 // indirect - github.com/go-openapi/swag/typeutils v0.25.4 // indirect - github.com/go-openapi/swag/yamlutils v0.25.4 // indirect + github.com/go-openapi/jsonpointer v0.22.5 // indirect + github.com/go-openapi/jsonreference v0.21.5 // indirect + github.com/go-openapi/swag v0.25.5 // indirect + github.com/go-openapi/swag/cmdutils v0.25.5 // indirect + github.com/go-openapi/swag/conv v0.25.5 // indirect + github.com/go-openapi/swag/fileutils v0.25.5 // indirect + github.com/go-openapi/swag/jsonname v0.25.5 // indirect + github.com/go-openapi/swag/jsonutils v0.25.5 // indirect + github.com/go-openapi/swag/loading v0.25.5 // indirect + github.com/go-openapi/swag/mangling v0.25.5 // indirect + github.com/go-openapi/swag/netutils v0.25.5 // indirect + github.com/go-openapi/swag/stringutils v0.25.5 // indirect + github.com/go-openapi/swag/typeutils v0.25.5 // indirect + github.com/go-openapi/swag/yamlutils v0.25.5 // indirect github.com/gobuffalo/flect v1.0.3 // indirect github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect github.com/golang-sql/sqlexp v0.1.0 // indirect @@ -72,7 +72,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.23.2 // indirect github.com/prometheus/client_model v0.6.2 // indirect github.com/prometheus/common v0.67.5 // indirect @@ -86,24 +86,24 @@ require ( github.com/xhit/go-str2duration/v2 v2.1.0 // indirect github.com/yuin/goldmark v1.4.13 // indirect github.com/zclconf/go-cty v1.16.2 // indirect - go.opentelemetry.io/otel v1.41.0 // indirect - go.opentelemetry.io/otel/trace v1.41.0 // indirect + go.opentelemetry.io/otel v1.42.0 // indirect + go.opentelemetry.io/otel/trace v1.42.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.1 // indirect go.yaml.in/yaml/v2 v2.4.3 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect - golang.org/x/crypto v0.52.0 // indirect - golang.org/x/mod v0.35.0 // indirect - golang.org/x/net v0.55.0 // indirect - golang.org/x/oauth2 v0.34.0 // indirect - golang.org/x/sync v0.20.0 // indirect - golang.org/x/sys v0.45.0 // indirect - golang.org/x/term v0.43.0 // indirect - golang.org/x/text v0.37.0 // indirect - golang.org/x/time v0.14.0 // indirect - golang.org/x/tools v0.44.0 // indirect + golang.org/x/crypto v0.53.0 // indirect + golang.org/x/mod v0.37.0 // indirect + golang.org/x/net v0.56.0 // indirect + golang.org/x/oauth2 v0.36.0 // indirect + golang.org/x/sync v0.21.0 // indirect + golang.org/x/sys v0.46.0 // indirect + golang.org/x/term v0.44.0 // indirect + golang.org/x/text v0.39.0 // indirect + golang.org/x/time v0.15.0 // indirect + golang.org/x/tools v0.47.0 // indirect gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260203192932-546029d2fa20 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260316180232-0b37fe3546d5 // indirect google.golang.org/grpc v1.79.3 // indirect google.golang.org/protobuf v1.36.11 // indirect gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect @@ -111,7 +111,7 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/apiextensions-apiserver v0.35.0 // indirect - k8s.io/client-go v0.35.0 // indirect + k8s.io/client-go v0.35.1 // indirect k8s.io/code-generator v0.35.0 // indirect k8s.io/component-base v0.35.0 // indirect k8s.io/gengo/v2 v2.0.0-20251215205346-5ee0d033ba5b // indirect diff --git a/go.sum b/go.sum index 6c682823..1c3866f5 100644 --- a/go.sum +++ b/go.sum @@ -4,6 +4,7 @@ dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8= dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA= filippo.io/edwards25519 v1.2.0 h1:crnVqOiS4jqYleHd9vaKZ+HKtHfllngJIiOpNpoJsjo= filippo.io/edwards25519 v1.2.0/go.mod h1:xzAOLCNug/yB62zG1bQ8uziwrIqIuxhctzJT18Q77mc= +github.com/Azure/azure-sdk-for-go v68.0.0+incompatible h1:fcYLmCpyNYRnvJbPerq7U0hS+6+I79yEDJBqVNcqUzU= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.1 h1:jHb/wfvRikGdxMXYV3QG/SzUOPYN9KEUUuC0Yd0/vC0= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.1/go.mod h1:pzBXCYn05zvYIrwLgtK8Ap8QcjRg+0i76tMQdWN6wOk= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 h1:Hk5QBxZQC1jb2Fwj6mpzme37xbCDdNTxU7O9eb5+LB4= @@ -49,10 +50,12 @@ github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UF github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/crossplane/crossplane-runtime/v2 v2.2.1 h1:CJXV8+1SDXLYJx67sUO4MIuLCkKEOKxCS2zg02nBqUI= -github.com/crossplane/crossplane-runtime/v2 v2.2.1/go.mod h1:3Xq18YLf2en0BB2OZpcixTKazeX7bS3txLbQHjOR52c= +github.com/crossplane/crossplane-runtime/v2 v2.3.3 h1:seIYf6pk7dLhXd7uSh/N9rVB8IdbCthy3LB6TSn91OI= +github.com/crossplane/crossplane-runtime/v2 v2.3.3/go.mod h1:UBxoZEXVZz9Ql2W5u5ssFE+egQ21BYqGGc2F3dozUvI= github.com/crossplane/crossplane-tools v0.0.0-20250731192036-00d407d8b7ec h1:+51Et4UW8XrvGne8RAqn9qEIfhoqPXYqIp/kQvpMaAo= github.com/crossplane/crossplane-tools v0.0.0-20250731192036-00d407d8b7ec/go.mod h1:8etxwmP4cZwJDwen4+PQlnc1tggltAhEfyyigmdHulQ= +github.com/crossplane/crossplane/apis/v2 v2.3.4 h1:qB1YqF300msWEkDQTFUhqfeOq3HtVfSZ1+3wNz1JStA= +github.com/crossplane/crossplane/apis/v2 v2.3.4/go.mod h1:s0cfMZA+Y/dwQ577PLQn5SBWyUg9k6vKjGAkHEwBShg= github.com/crossplane/upjet/v2 v2.2.0 h1:ZWRG9weBklrA3hRG8CjxYql7ffEE5sYnIH3UsyxsSTA= github.com/crossplane/upjet/v2 v2.2.0/go.mod h1:jDCqvAFLrVEzqE+pywmQ5u18HbJK5j5Jj4cTQpqOLqY= github.com/dave/jennifer v1.7.1 h1:B4jJJDHelWcDhlRQxWeo0Npa/pYKBLrirAQoTN45txo= @@ -81,40 +84,40 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= -github.com/go-openapi/jsonpointer v0.22.4 h1:dZtK82WlNpVLDW2jlA1YCiVJFVqkED1MegOUy9kR5T4= -github.com/go-openapi/jsonpointer v0.22.4/go.mod h1:elX9+UgznpFhgBuaMQ7iu4lvvX1nvNsesQ3oxmYTw80= -github.com/go-openapi/jsonreference v0.21.4 h1:24qaE2y9bx/q3uRK/qN+TDwbok1NhbSmGjjySRCHtC8= -github.com/go-openapi/jsonreference v0.21.4/go.mod h1:rIENPTjDbLpzQmQWCj5kKj3ZlmEh+EFVbz3RTUh30/4= -github.com/go-openapi/swag v0.25.4 h1:OyUPUFYDPDBMkqyxOTkqDYFnrhuhi9NR6QVUvIochMU= -github.com/go-openapi/swag v0.25.4/go.mod h1:zNfJ9WZABGHCFg2RnY0S4IOkAcVTzJ6z2Bi+Q4i6qFQ= -github.com/go-openapi/swag/cmdutils v0.25.4 h1:8rYhB5n6WawR192/BfUu2iVlxqVR9aRgGJP6WaBoW+4= -github.com/go-openapi/swag/cmdutils v0.25.4/go.mod h1:pdae/AFo6WxLl5L0rq87eRzVPm/XRHM3MoYgRMvG4A0= -github.com/go-openapi/swag/conv v0.25.4 h1:/Dd7p0LZXczgUcC/Ikm1+YqVzkEeCc9LnOWjfkpkfe4= -github.com/go-openapi/swag/conv v0.25.4/go.mod h1:3LXfie/lwoAv0NHoEuY1hjoFAYkvlqI/Bn5EQDD3PPU= -github.com/go-openapi/swag/fileutils v0.25.4 h1:2oI0XNW5y6UWZTC7vAxC8hmsK/tOkWXHJQH4lKjqw+Y= -github.com/go-openapi/swag/fileutils v0.25.4/go.mod h1:cdOT/PKbwcysVQ9Tpr0q20lQKH7MGhOEb6EwmHOirUk= -github.com/go-openapi/swag/jsonname v0.25.4 h1:bZH0+MsS03MbnwBXYhuTttMOqk+5KcQ9869Vye1bNHI= -github.com/go-openapi/swag/jsonname v0.25.4/go.mod h1:GPVEk9CWVhNvWhZgrnvRA6utbAltopbKwDu8mXNUMag= -github.com/go-openapi/swag/jsonutils v0.25.4 h1:VSchfbGhD4UTf4vCdR2F4TLBdLwHyUDTd1/q4i+jGZA= -github.com/go-openapi/swag/jsonutils v0.25.4/go.mod h1:7OYGXpvVFPn4PpaSdPHJBtF0iGnbEaTk8AvBkoWnaAY= -github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4 h1:IACsSvBhiNJwlDix7wq39SS2Fh7lUOCJRmx/4SN4sVo= -github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4/go.mod h1:Mt0Ost9l3cUzVv4OEZG+WSeoHwjWLnarzMePNDAOBiM= -github.com/go-openapi/swag/loading v0.25.4 h1:jN4MvLj0X6yhCDduRsxDDw1aHe+ZWoLjW+9ZQWIKn2s= -github.com/go-openapi/swag/loading v0.25.4/go.mod h1:rpUM1ZiyEP9+mNLIQUdMiD7dCETXvkkC30z53i+ftTE= -github.com/go-openapi/swag/mangling v0.25.4 h1:2b9kBJk9JvPgxr36V23FxJLdwBrpijI26Bx5JH4Hp48= -github.com/go-openapi/swag/mangling v0.25.4/go.mod h1:6dxwu6QyORHpIIApsdZgb6wBk/DPU15MdyYj/ikn0Hg= -github.com/go-openapi/swag/netutils v0.25.4 h1:Gqe6K71bGRb3ZQLusdI8p/y1KLgV4M/k+/HzVSqT8H0= -github.com/go-openapi/swag/netutils v0.25.4/go.mod h1:m2W8dtdaoX7oj9rEttLyTeEFFEBvnAx9qHd5nJEBzYg= -github.com/go-openapi/swag/stringutils v0.25.4 h1:O6dU1Rd8bej4HPA3/CLPciNBBDwZj9HiEpdVsb8B5A8= -github.com/go-openapi/swag/stringutils v0.25.4/go.mod h1:GTsRvhJW5xM5gkgiFe0fV3PUlFm0dr8vki6/VSRaZK0= -github.com/go-openapi/swag/typeutils v0.25.4 h1:1/fbZOUN472NTc39zpa+YGHn3jzHWhv42wAJSN91wRw= -github.com/go-openapi/swag/typeutils v0.25.4/go.mod h1:Ou7g//Wx8tTLS9vG0UmzfCsjZjKhpjxayRKTHXf2pTE= -github.com/go-openapi/swag/yamlutils v0.25.4 h1:6jdaeSItEUb7ioS9lFoCZ65Cne1/RZtPBZ9A56h92Sw= -github.com/go-openapi/swag/yamlutils v0.25.4/go.mod h1:MNzq1ulQu+yd8Kl7wPOut/YHAAU/H6hL91fF+E2RFwc= -github.com/go-openapi/testify/enable/yaml/v2 v2.0.2 h1:0+Y41Pz1NkbTHz8NngxTuAXxEodtNSI1WG1c/m5Akw4= -github.com/go-openapi/testify/enable/yaml/v2 v2.0.2/go.mod h1:kme83333GCtJQHXQ8UKX3IBZu6z8T5Dvy5+CW3NLUUg= -github.com/go-openapi/testify/v2 v2.0.2 h1:X999g3jeLcoY8qctY/c/Z8iBHTbwLz7R2WXd6Ub6wls= -github.com/go-openapi/testify/v2 v2.0.2/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54= +github.com/go-openapi/jsonpointer v0.22.5 h1:8on/0Yp4uTb9f4XvTrM2+1CPrV05QPZXu+rvu2o9jcA= +github.com/go-openapi/jsonpointer v0.22.5/go.mod h1:gyUR3sCvGSWchA2sUBJGluYMbe1zazrYWIkWPjjMUY0= +github.com/go-openapi/jsonreference v0.21.5 h1:6uCGVXU/aNF13AQNggxfysJ+5ZcU4nEAe+pJyVWRdiE= +github.com/go-openapi/jsonreference v0.21.5/go.mod h1:u25Bw85sX4E2jzFodh1FOKMTZLcfifd1Q+iKKOUxExw= +github.com/go-openapi/swag v0.25.5 h1:pNkwbUEeGwMtcgxDr+2GBPAk4kT+kJ+AaB+TMKAg+TU= +github.com/go-openapi/swag v0.25.5/go.mod h1:B3RT6l8q7X803JRxa2e59tHOiZlX1t8viplOcs9CwTA= +github.com/go-openapi/swag/cmdutils v0.25.5 h1:yh5hHrpgsw4NwM9KAEtaDTXILYzdXh/I8Whhx9hKj7c= +github.com/go-openapi/swag/cmdutils v0.25.5/go.mod h1:pdae/AFo6WxLl5L0rq87eRzVPm/XRHM3MoYgRMvG4A0= +github.com/go-openapi/swag/conv v0.25.5 h1:wAXBYEXJjoKwE5+vc9YHhpQOFj2JYBMF2DUi+tGu97g= +github.com/go-openapi/swag/conv v0.25.5/go.mod h1:CuJ1eWvh1c4ORKx7unQnFGyvBbNlRKbnRyAvDvzWA4k= +github.com/go-openapi/swag/fileutils v0.25.5 h1:B6JTdOcs2c0dBIs9HnkyTW+5gC+8NIhVBUwERkFhMWk= +github.com/go-openapi/swag/fileutils v0.25.5/go.mod h1:V3cT9UdMQIaH4WiTrUc9EPtVA4txS0TOmRURmhGF4kc= +github.com/go-openapi/swag/jsonname v0.25.5 h1:8p150i44rv/Drip4vWI3kGi9+4W9TdI3US3uUYSFhSo= +github.com/go-openapi/swag/jsonname v0.25.5/go.mod h1:jNqqikyiAK56uS7n8sLkdaNY/uq6+D2m2LANat09pKU= +github.com/go-openapi/swag/jsonutils v0.25.5 h1:XUZF8awQr75MXeC+/iaw5usY/iM7nXPDwdG3Jbl9vYo= +github.com/go-openapi/swag/jsonutils v0.25.5/go.mod h1:48FXUaz8YsDAA9s5AnaUvAmry1UcLcNVWUjY42XkrN4= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.5 h1:SX6sE4FrGb4sEnnxbFL/25yZBb5Hcg1inLeErd86Y1U= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.5/go.mod h1:/2KvOTrKWjVA5Xli3DZWdMCZDzz3uV/T7bXwrKWPquo= +github.com/go-openapi/swag/loading v0.25.5 h1:odQ/umlIZ1ZVRteI6ckSrvP6e2w9UTF5qgNdemJHjuU= +github.com/go-openapi/swag/loading v0.25.5/go.mod h1:I8A8RaaQ4DApxhPSWLNYWh9NvmX2YKMoB9nwvv6oW6g= +github.com/go-openapi/swag/mangling v0.25.5 h1:hyrnvbQRS7vKePQPHHDso+k6CGn5ZBs5232UqWZmJZw= +github.com/go-openapi/swag/mangling v0.25.5/go.mod h1:6hadXM/o312N/h98RwByLg088U61TPGiltQn71Iw0NY= +github.com/go-openapi/swag/netutils v0.25.5 h1:LZq2Xc2QI8+7838elRAaPCeqJnHODfSyOa7ZGfxDKlU= +github.com/go-openapi/swag/netutils v0.25.5/go.mod h1:lHbtmj4m57APG/8H7ZcMMSWzNqIQcu0RFiXrPUara14= +github.com/go-openapi/swag/stringutils v0.25.5 h1:NVkoDOA8YBgtAR/zvCx5rhJKtZF3IzXcDdwOsYzrB6M= +github.com/go-openapi/swag/stringutils v0.25.5/go.mod h1:PKK8EZdu4QJq8iezt17HM8RXnLAzY7gW0O1KKarrZII= +github.com/go-openapi/swag/typeutils v0.25.5 h1:EFJ+PCga2HfHGdo8s8VJXEVbeXRCYwzzr9u4rJk7L7E= +github.com/go-openapi/swag/typeutils v0.25.5/go.mod h1:itmFmScAYE1bSD8C4rS0W+0InZUBrB2xSPbWt6DLGuc= +github.com/go-openapi/swag/yamlutils v0.25.5 h1:kASCIS+oIeoc55j28T4o8KwlV2S4ZLPT6G0iq2SSbVQ= +github.com/go-openapi/swag/yamlutils v0.25.5/go.mod h1:Gek1/SjjfbYvM+Iq4QGwa/2lEXde9n2j4a3wI3pNuOQ= +github.com/go-openapi/testify/enable/yaml/v2 v2.4.0 h1:7SgOMTvJkM8yWrQlU8Jm18VeDPuAvB/xWrdxFJkoFag= +github.com/go-openapi/testify/enable/yaml/v2 v2.4.0/go.mod h1:14iV8jyyQlinc9StD7w1xVPW3CO3q1Gj04Jy//Kw4VM= +github.com/go-openapi/testify/v2 v2.4.0 h1:8nsPrHVCWkQ4p8h1EsRVymA2XABB4OT40gcvAu+voFM= +github.com/go-openapi/testify/v2 v2.4.0/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54= github.com/go-sql-driver/mysql v1.10.0 h1:Q+1LV8DkHJvSYAdR83XzuhDaTykuDx0l6fkXxoWCWfw= github.com/go-sql-driver/mysql v1.10.0/go.mod h1:M+cqaI7+xxXGG9swrdeUIoPG3Y3KCkF0pZej+SK+nWk= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= @@ -155,8 +158,8 @@ github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.4 h1:kEISI/Gx67NzH3nJxAmY/dGac80kKZgZt134u7Y/k1s= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.4/go.mod h1:6Nz966r3vQYCqIzWsuEl9d7cf7mRhtDmm++sOxlnfxI= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.7 h1:X+2YciYSxvMQK0UZ7sg45ZVabVZBeBuvMkmuI2V3Fak= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.7/go.mod h1:lW34nIZuQ8UDPdkon5fmfp2l3+ZkQ2me/+oecHYLOII= github.com/hashicorp/hcl/v2 v2.9.1/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg= github.com/hashicorp/hcl/v2 v2.23.0 h1:Fphj1/gCylPxHutVSEOf2fBOh1VE4AuLV7+kbJf3qos= github.com/hashicorp/hcl/v2 v2.23.0/go.mod h1:62ZYHrXgPoX8xBnzl8QzbWq4dyDsDtfCRgIq1rbJEvA= @@ -165,8 +168,8 @@ github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLf github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/sqlstruct v0.0.0-20201105191214-5f3e10d3ab46/go.mod h1:yyMNCyc/Ib3bDTKd379tNMpB/7/H5TjM2Y9QJ5THLbE= -github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= -github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= +github.com/klauspost/compress v1.18.5 h1:/h1gH5Ce+VWNLSWqPzOVn6XBO+vJbCNGvjoaGBFW2IE= +github.com/klauspost/compress v1.18.5/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -209,8 +212,9 @@ github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmd github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o= github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg= github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= @@ -272,20 +276,20 @@ go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.64.0 h1:ssfIgGNANqpVFCndZvcuyKbl0g+UAVcbBcqGkG28H0Y= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.64.0/go.mod h1:GQ/474YrbE4Jx8gZ4q5I4hrhUzM6UPzyrqJYV2AqPoQ= -go.opentelemetry.io/otel v1.41.0 h1:YlEwVsGAlCvczDILpUXpIpPSL/VPugt7zHThEMLce1c= -go.opentelemetry.io/otel v1.41.0/go.mod h1:Yt4UwgEKeT05QbLwbyHXEwhnjxNO6D8L5PQP51/46dE= +go.opentelemetry.io/otel v1.42.0 h1:lSQGzTgVR3+sgJDAU/7/ZMjN9Z+vUip7leaqBKy4sho= +go.opentelemetry.io/otel v1.42.0/go.mod h1:lJNsdRMxCUIWuMlVJWzecSMuNjE7dOYyWlqOXWkdqCc= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 h1:OeNbIYk/2C15ckl7glBlOBp5+WlYsOElzTNmiPW/x60= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0/go.mod h1:7Bept48yIeqxP2OZ9/AqIpYS94h2or0aB4FypJTc8ZM= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.39.0 h1:in9O8ESIOlwJAEGTkkf34DesGRAc/Pn8qJ7k3r/42LM= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.39.0/go.mod h1:Rp0EXBm5tfnv0WL+ARyO/PHBEaEAT8UUHQ6AGJcSq6c= -go.opentelemetry.io/otel/metric v1.41.0 h1:rFnDcs4gRzBcsO9tS8LCpgR0dxg4aaxWlJxCno7JlTQ= -go.opentelemetry.io/otel/metric v1.41.0/go.mod h1:xPvCwd9pU0VN8tPZYzDZV/BMj9CM9vs00GuBjeKhJps= +go.opentelemetry.io/otel/metric v1.42.0 h1:2jXG+3oZLNXEPfNmnpxKDeZsFI5o4J+nz6xUlaFdF/4= +go.opentelemetry.io/otel/metric v1.42.0/go.mod h1:RlUN/7vTU7Ao/diDkEpQpnz3/92J9ko05BIwxYa2SSI= go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= -go.opentelemetry.io/otel/trace v1.41.0 h1:Vbk2co6bhj8L59ZJ6/xFTskY+tGAbOnCtQGVVa9TIN0= -go.opentelemetry.io/otel/trace v1.41.0/go.mod h1:U1NU4ULCoxeDKc09yCWdWe+3QoyweJcISEVa1RBzOis= +go.opentelemetry.io/otel/trace v1.42.0 h1:OUCgIPt+mzOnaUTpOQcBiM/PLQ/Op7oq6g4LenLmOYY= +go.opentelemetry.io/otel/trace v1.42.0/go.mod h1:f3K9S+IFqnumBkKhRJMeaZeNk9epyhnCmQh/EysQCdc= go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4= go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= @@ -300,43 +304,43 @@ go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.52.0 h1:RMs7fP2rXdep0CftQlK8Uf+kibLm7qkCcradZWYz988= -golang.org/x/crypto v0.52.0/go.mod h1:1QgfPxDqh0T2M/elOJtp9RvuR95kVjir0e6/BvEmGbc= +golang.org/x/crypto v0.53.0 h1:QZ4Muo8THX6CizN2vPPd5fBGHyogrdK9fG4wLPFUsto= +golang.org/x/crypto v0.53.0/go.mod h1:DNLU434OwVakk9PzuwV8w62mAJpRJL3vsgcfp4Qnsio= golang.org/x/exp v0.0.0-20260112195511-716be5621a96 h1:Z/6YuSHTLOHfNFdb8zVZomZr7cqNgTJvA8+Qz75D8gU= golang.org/x/exp v0.0.0-20260112195511-716be5621a96/go.mod h1:nzimsREAkjBCIEFtHiYkrJyT+2uy9YZJB7H1k68CXZU= -golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM= -golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU= +golang.org/x/mod v0.37.0 h1:vF1DjpVEshcIqoEaauuHebaLk1O1forxjxBaVn884JQ= +golang.org/x/mod v0.37.0/go.mod h1:m8S8VeM9r4dzDwjrKO0a1sZP3YjeMamRRlD+fmR2Q/0= golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8= -golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww= -golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw= -golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= +golang.org/x/net v0.56.0 h1:Rw8j/hFzGvJUZwNBXnAtf5sVDVt+65SK2C7IxCxZt5o= +golang.org/x/net v0.56.0/go.mod h1:D3Ku6r+V6JROoZK144D2XfMHFcMq/0zSfLelVTCFKec= +golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= +golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= -golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sync v0.21.0 h1:HLII4xRRTtCRkxYp4HNFF0Js/Og6q2i++KXbg0gHCwM= +golang.org/x/sync v0.21.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY= -golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= -golang.org/x/term v0.43.0 h1:S4RLU2sB31O/NCl+zFN9Aru9A/Cq2aqKpTZJ6B+DwT4= -golang.org/x/term v0.43.0/go.mod h1:lrhlHNdQJHO+1qVYiHfFKVuVioJIheAc3fBSMFYEIsk= +golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw= +golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/term v0.44.0 h1:0rLvDRCtNj0gZkyIXhCyOb2OAzEhLVqc4B+hrsBhrmc= +golang.org/x/term v0.44.0/go.mod h1:7ze4MdzUzLXpSAoFP1H0bOI9aXDqveSvatT5vKcFh2Y= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= -golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= -golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= -golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= +golang.org/x/text v0.39.0 h1:UbZz4pLOvn600D6Oh6GGEI6VAmndrEBLv8/6BEXzyus= +golang.org/x/text v0.39.0/go.mod h1:3UwRclnC2g0TU9x8PZiyfOajCd1zaUNHF9cvqcQZ+ZM= +golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U= +golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c= -golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI= +golang.org/x/tools v0.47.0 h1:7Kn5x/d1svx/PzryTsqeoZN4TZwqeH5pGWjefhLi/1Q= +golang.org/x/tools v0.47.0/go.mod h1:dFHnyTvFWY212G+h7ZY4Vsp/K3U4/7W9TyVaAul8uCA= golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM= golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated h1:1h2MnaIAIXISqTFKdENegdpAgUXz6NrPEsbIeWaBRvM= @@ -349,10 +353,10 @@ gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto/googleapis/api v0.0.0-20260114163908-3f89685c29c3 h1:X9z6obt+cWRX8XjDVOn+SZWhWe5kZHm46TThU9j+jss= -google.golang.org/genproto/googleapis/api v0.0.0-20260114163908-3f89685c29c3/go.mod h1:dd646eSK+Dk9kxVBl1nChEOhJPtMXriCcVb4x3o6J+E= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260203192932-546029d2fa20 h1:Jr5R2J6F6qWyzINc+4AM8t5pfUz6beZpHp678GNrMbE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260203192932-546029d2fa20/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ= +google.golang.org/genproto/googleapis/api v0.0.0-20260316180232-0b37fe3546d5 h1:CogIeEXn4qWYzzQU0QqvYBM8yDF9cFYzDq9ojSpv0Js= +google.golang.org/genproto/googleapis/api v0.0.0-20260316180232-0b37fe3546d5/go.mod h1:EIQZ5bFCfRQDV4MhRle7+OgjNtZ6P1PiZBgAKuxXu/Y= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260316180232-0b37fe3546d5 h1:aJmi6DVGGIStN9Mobk/tZOOQUBbj0BPjZjjnOdoZKts= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260316180232-0b37fe3546d5/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= google.golang.org/grpc v1.79.3 h1:sybAEdRIEtvcD68Gx7dmnwjZKlyfuc61Dyo9pGXXkKE= google.golang.org/grpc v1.79.3/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ= google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= @@ -372,16 +376,16 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.35.0 h1:iBAU5LTyBI9vw3L5glmat1njFK34srdLmktWwLTprlY= -k8s.io/api v0.35.0/go.mod h1:AQ0SNTzm4ZAczM03QH42c7l3bih1TbAXYo0DkF8ktnA= +k8s.io/api v0.35.1 h1:0PO/1FhlK/EQNVK5+txc4FuhQibV25VLSdLMmGpDE/Q= +k8s.io/api v0.35.1/go.mod h1:28uR9xlXWml9eT0uaGo6y71xK86JBELShLy4wR1XtxM= k8s.io/apiextensions-apiserver v0.35.0 h1:3xHk2rTOdWXXJM+RDQZJvdx0yEOgC0FgQ1PlJatA5T4= k8s.io/apiextensions-apiserver v0.35.0/go.mod h1:E1Ahk9SADaLQ4qtzYFkwUqusXTcaV2uw3l14aqpL2LU= -k8s.io/apimachinery v0.35.0 h1:Z2L3IHvPVv/MJ7xRxHEtk6GoJElaAqDCCU0S6ncYok8= -k8s.io/apimachinery v0.35.0/go.mod h1:jQCgFZFR1F4Ik7hvr2g84RTJSZegBc8yHgFWKn//hns= +k8s.io/apimachinery v0.35.1 h1:yxO6gV555P1YV0SANtnTjXYfiivaTPvCTKX6w6qdDsU= +k8s.io/apimachinery v0.35.1/go.mod h1:jQCgFZFR1F4Ik7hvr2g84RTJSZegBc8yHgFWKn//hns= k8s.io/apiserver v0.35.0 h1:CUGo5o+7hW9GcAEF3x3usT3fX4f9r8xmgQeCBDaOgX4= k8s.io/apiserver v0.35.0/go.mod h1:QUy1U4+PrzbJaM3XGu2tQ7U9A4udRRo5cyxkFX0GEds= -k8s.io/client-go v0.35.0 h1:IAW0ifFbfQQwQmga0UdoH0yvdqrbwMdq9vIFEhRpxBE= -k8s.io/client-go v0.35.0/go.mod h1:q2E5AAyqcbeLGPdoRB+Nxe3KYTfPce1Dnu1myQdqz9o= +k8s.io/client-go v0.35.1 h1:+eSfZHwuo/I19PaSxqumjqZ9l5XiTEKbIaJ+j1wLcLM= +k8s.io/client-go v0.35.1/go.mod h1:1p1KxDt3a0ruRfc/pG4qT/3oHmUj1AhSHEcxNSGg+OA= k8s.io/code-generator v0.35.0 h1:TvrtfKYZTm9oDF2z+veFKSCcgZE3Igv0svY+ehCmjHQ= k8s.io/code-generator v0.35.0/go.mod h1:iS1gvVf3c/T71N5DOGYO+Gt3PdJ6B9LYSvIyQ4FHzgc= k8s.io/component-base v0.35.0 h1:+yBrOhzri2S1BVqyVSvcM3PtPyx5GUxCK2tinZz1G94= diff --git a/package/crds/mssql.sql.crossplane.io_databases.yaml b/package/crds/mssql.sql.crossplane.io_databases.yaml index 35ee8398..ce3e95fd 100644 --- a/package/crds/mssql.sql.crossplane.io_databases.yaml +++ b/package/crds/mssql.sql.crossplane.io_databases.yaml @@ -200,6 +200,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + lastHandledReconcileAt: + description: |- + LastHandledReconcileAt holds the value of the most recent + reconcile-requested-at annotation token that the controller has + processed. Users can compare this to the annotation to determine + whether a reconcile request has been handled. + type: string observedGeneration: description: |- ObservedGeneration is the latest metadata.generation diff --git a/package/crds/mssql.sql.crossplane.io_grants.yaml b/package/crds/mssql.sql.crossplane.io_grants.yaml index cf9f6661..6e2aa07a 100644 --- a/package/crds/mssql.sql.crossplane.io_grants.yaml +++ b/package/crds/mssql.sql.crossplane.io_grants.yaml @@ -393,6 +393,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + lastHandledReconcileAt: + description: |- + LastHandledReconcileAt holds the value of the most recent + reconcile-requested-at annotation token that the controller has + processed. Users can compare this to the annotation to determine + whether a reconcile request has been handled. + type: string observedGeneration: description: |- ObservedGeneration is the latest metadata.generation diff --git a/package/crds/mssql.sql.crossplane.io_users.yaml b/package/crds/mssql.sql.crossplane.io_users.yaml index 79f92e8f..de1d0ed1 100644 --- a/package/crds/mssql.sql.crossplane.io_users.yaml +++ b/package/crds/mssql.sql.crossplane.io_users.yaml @@ -406,6 +406,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + lastHandledReconcileAt: + description: |- + LastHandledReconcileAt holds the value of the most recent + reconcile-requested-at annotation token that the controller has + processed. Users can compare this to the annotation to determine + whether a reconcile request has been handled. + type: string observedGeneration: description: |- ObservedGeneration is the latest metadata.generation diff --git a/package/crds/mssql.sql.m.crossplane.io_databases.yaml b/package/crds/mssql.sql.m.crossplane.io_databases.yaml index a4314bed..9701cb9b 100644 --- a/package/crds/mssql.sql.m.crossplane.io_databases.yaml +++ b/package/crds/mssql.sql.m.crossplane.io_databases.yaml @@ -158,6 +158,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + lastHandledReconcileAt: + description: |- + LastHandledReconcileAt holds the value of the most recent + reconcile-requested-at annotation token that the controller has + processed. Users can compare this to the annotation to determine + whether a reconcile request has been handled. + type: string observedGeneration: description: |- ObservedGeneration is the latest metadata.generation diff --git a/package/crds/mssql.sql.m.crossplane.io_grants.yaml b/package/crds/mssql.sql.m.crossplane.io_grants.yaml index 8d8a3a0c..48d86e72 100644 --- a/package/crds/mssql.sql.m.crossplane.io_grants.yaml +++ b/package/crds/mssql.sql.m.crossplane.io_grants.yaml @@ -363,6 +363,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + lastHandledReconcileAt: + description: |- + LastHandledReconcileAt holds the value of the most recent + reconcile-requested-at annotation token that the controller has + processed. Users can compare this to the annotation to determine + whether a reconcile request has been handled. + type: string observedGeneration: description: |- ObservedGeneration is the latest metadata.generation diff --git a/package/crds/mssql.sql.m.crossplane.io_users.yaml b/package/crds/mssql.sql.m.crossplane.io_users.yaml index e72c4cf3..95f0ca34 100644 --- a/package/crds/mssql.sql.m.crossplane.io_users.yaml +++ b/package/crds/mssql.sql.m.crossplane.io_users.yaml @@ -367,6 +367,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + lastHandledReconcileAt: + description: |- + LastHandledReconcileAt holds the value of the most recent + reconcile-requested-at annotation token that the controller has + processed. Users can compare this to the annotation to determine + whether a reconcile request has been handled. + type: string observedGeneration: description: |- ObservedGeneration is the latest metadata.generation diff --git a/package/crds/mysql.sql.crossplane.io_databases.yaml b/package/crds/mysql.sql.crossplane.io_databases.yaml index 5aca8c62..9a7f56bc 100644 --- a/package/crds/mysql.sql.crossplane.io_databases.yaml +++ b/package/crds/mysql.sql.crossplane.io_databases.yaml @@ -220,6 +220,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + lastHandledReconcileAt: + description: |- + LastHandledReconcileAt holds the value of the most recent + reconcile-requested-at annotation token that the controller has + processed. Users can compare this to the annotation to determine + whether a reconcile request has been handled. + type: string observedGeneration: description: |- ObservedGeneration is the latest metadata.generation diff --git a/package/crds/mysql.sql.crossplane.io_grants.yaml b/package/crds/mysql.sql.crossplane.io_grants.yaml index 08cffcfd..f0630ced 100644 --- a/package/crds/mysql.sql.crossplane.io_grants.yaml +++ b/package/crds/mysql.sql.crossplane.io_grants.yaml @@ -404,6 +404,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + lastHandledReconcileAt: + description: |- + LastHandledReconcileAt holds the value of the most recent + reconcile-requested-at annotation token that the controller has + processed. Users can compare this to the annotation to determine + whether a reconcile request has been handled. + type: string observedGeneration: description: |- ObservedGeneration is the latest metadata.generation diff --git a/package/crds/mysql.sql.crossplane.io_users.yaml b/package/crds/mysql.sql.crossplane.io_users.yaml index a14e6c68..0b43adcf 100644 --- a/package/crds/mysql.sql.crossplane.io_users.yaml +++ b/package/crds/mysql.sql.crossplane.io_users.yaml @@ -325,6 +325,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + lastHandledReconcileAt: + description: |- + LastHandledReconcileAt holds the value of the most recent + reconcile-requested-at annotation token that the controller has + processed. Users can compare this to the annotation to determine + whether a reconcile request has been handled. + type: string observedGeneration: description: |- ObservedGeneration is the latest metadata.generation diff --git a/package/crds/mysql.sql.m.crossplane.io_databases.yaml b/package/crds/mysql.sql.m.crossplane.io_databases.yaml index a2db32f5..00f69928 100644 --- a/package/crds/mysql.sql.m.crossplane.io_databases.yaml +++ b/package/crds/mysql.sql.m.crossplane.io_databases.yaml @@ -178,6 +178,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + lastHandledReconcileAt: + description: |- + LastHandledReconcileAt holds the value of the most recent + reconcile-requested-at annotation token that the controller has + processed. Users can compare this to the annotation to determine + whether a reconcile request has been handled. + type: string observedGeneration: description: |- ObservedGeneration is the latest metadata.generation diff --git a/package/crds/mysql.sql.m.crossplane.io_grants.yaml b/package/crds/mysql.sql.m.crossplane.io_grants.yaml index f40a8958..b34d406c 100644 --- a/package/crds/mysql.sql.m.crossplane.io_grants.yaml +++ b/package/crds/mysql.sql.m.crossplane.io_grants.yaml @@ -372,6 +372,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + lastHandledReconcileAt: + description: |- + LastHandledReconcileAt holds the value of the most recent + reconcile-requested-at annotation token that the controller has + processed. Users can compare this to the annotation to determine + whether a reconcile request has been handled. + type: string observedGeneration: description: |- ObservedGeneration is the latest metadata.generation diff --git a/package/crds/mysql.sql.m.crossplane.io_users.yaml b/package/crds/mysql.sql.m.crossplane.io_users.yaml index 8ff1932e..14e0b291 100644 --- a/package/crds/mysql.sql.m.crossplane.io_users.yaml +++ b/package/crds/mysql.sql.m.crossplane.io_users.yaml @@ -278,6 +278,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + lastHandledReconcileAt: + description: |- + LastHandledReconcileAt holds the value of the most recent + reconcile-requested-at annotation token that the controller has + processed. Users can compare this to the annotation to determine + whether a reconcile request has been handled. + type: string observedGeneration: description: |- ObservedGeneration is the latest metadata.generation diff --git a/package/crds/postgresql.sql.crossplane.io_databases.yaml b/package/crds/postgresql.sql.crossplane.io_databases.yaml index 52f4a3ee..1bac0770 100644 --- a/package/crds/postgresql.sql.crossplane.io_databases.yaml +++ b/package/crds/postgresql.sql.crossplane.io_databases.yaml @@ -356,6 +356,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + lastHandledReconcileAt: + description: |- + LastHandledReconcileAt holds the value of the most recent + reconcile-requested-at annotation token that the controller has + processed. Users can compare this to the annotation to determine + whether a reconcile request has been handled. + type: string observedGeneration: description: |- ObservedGeneration is the latest metadata.generation diff --git a/package/crds/postgresql.sql.crossplane.io_defaultprivileges.yaml b/package/crds/postgresql.sql.crossplane.io_defaultprivileges.yaml index 005441a6..6012ca7e 100644 --- a/package/crds/postgresql.sql.crossplane.io_defaultprivileges.yaml +++ b/package/crds/postgresql.sql.crossplane.io_defaultprivileges.yaml @@ -434,6 +434,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + lastHandledReconcileAt: + description: |- + LastHandledReconcileAt holds the value of the most recent + reconcile-requested-at annotation token that the controller has + processed. Users can compare this to the annotation to determine + whether a reconcile request has been handled. + type: string observedGeneration: description: |- ObservedGeneration is the latest metadata.generation diff --git a/package/crds/postgresql.sql.crossplane.io_extensions.yaml b/package/crds/postgresql.sql.crossplane.io_extensions.yaml index 1542cd36..061bbd41 100644 --- a/package/crds/postgresql.sql.crossplane.io_extensions.yaml +++ b/package/crds/postgresql.sql.crossplane.io_extensions.yaml @@ -307,6 +307,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + lastHandledReconcileAt: + description: |- + LastHandledReconcileAt holds the value of the most recent + reconcile-requested-at annotation token that the controller has + processed. Users can compare this to the annotation to determine + whether a reconcile request has been handled. + type: string observedGeneration: description: |- ObservedGeneration is the latest metadata.generation diff --git a/package/crds/postgresql.sql.crossplane.io_grants.yaml b/package/crds/postgresql.sql.crossplane.io_grants.yaml index 810a7ec5..703b5c5d 100644 --- a/package/crds/postgresql.sql.crossplane.io_grants.yaml +++ b/package/crds/postgresql.sql.crossplane.io_grants.yaml @@ -620,6 +620,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + lastHandledReconcileAt: + description: |- + LastHandledReconcileAt holds the value of the most recent + reconcile-requested-at annotation token that the controller has + processed. Users can compare this to the annotation to determine + whether a reconcile request has been handled. + type: string observedGeneration: description: |- ObservedGeneration is the latest metadata.generation diff --git a/package/crds/postgresql.sql.crossplane.io_roles.yaml b/package/crds/postgresql.sql.crossplane.io_roles.yaml index dd86f612..887c58b9 100644 --- a/package/crds/postgresql.sql.crossplane.io_roles.yaml +++ b/package/crds/postgresql.sql.crossplane.io_roles.yaml @@ -317,6 +317,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + lastHandledReconcileAt: + description: |- + LastHandledReconcileAt holds the value of the most recent + reconcile-requested-at annotation token that the controller has + processed. Users can compare this to the annotation to determine + whether a reconcile request has been handled. + type: string observedGeneration: description: |- ObservedGeneration is the latest metadata.generation diff --git a/package/crds/postgresql.sql.crossplane.io_schemas.yaml b/package/crds/postgresql.sql.crossplane.io_schemas.yaml index 73b19951..6480cbb9 100644 --- a/package/crds/postgresql.sql.crossplane.io_schemas.yaml +++ b/package/crds/postgresql.sql.crossplane.io_schemas.yaml @@ -386,6 +386,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + lastHandledReconcileAt: + description: |- + LastHandledReconcileAt holds the value of the most recent + reconcile-requested-at annotation token that the controller has + processed. Users can compare this to the annotation to determine + whether a reconcile request has been handled. + type: string observedGeneration: description: |- ObservedGeneration is the latest metadata.generation diff --git a/package/crds/postgresql.sql.m.crossplane.io_databases.yaml b/package/crds/postgresql.sql.m.crossplane.io_databases.yaml index 660d3181..ab663605 100644 --- a/package/crds/postgresql.sql.m.crossplane.io_databases.yaml +++ b/package/crds/postgresql.sql.m.crossplane.io_databases.yaml @@ -320,6 +320,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + lastHandledReconcileAt: + description: |- + LastHandledReconcileAt holds the value of the most recent + reconcile-requested-at annotation token that the controller has + processed. Users can compare this to the annotation to determine + whether a reconcile request has been handled. + type: string observedGeneration: description: |- ObservedGeneration is the latest metadata.generation diff --git a/package/crds/postgresql.sql.m.crossplane.io_defaultprivileges.yaml b/package/crds/postgresql.sql.m.crossplane.io_defaultprivileges.yaml index d5bd6b26..577ffa39 100644 --- a/package/crds/postgresql.sql.m.crossplane.io_defaultprivileges.yaml +++ b/package/crds/postgresql.sql.m.crossplane.io_defaultprivileges.yaml @@ -404,6 +404,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + lastHandledReconcileAt: + description: |- + LastHandledReconcileAt holds the value of the most recent + reconcile-requested-at annotation token that the controller has + processed. Users can compare this to the annotation to determine + whether a reconcile request has been handled. + type: string observedGeneration: description: |- ObservedGeneration is the latest metadata.generation diff --git a/package/crds/postgresql.sql.m.crossplane.io_extensions.yaml b/package/crds/postgresql.sql.m.crossplane.io_extensions.yaml index e1c9f904..848b3cc8 100644 --- a/package/crds/postgresql.sql.m.crossplane.io_extensions.yaml +++ b/package/crds/postgresql.sql.m.crossplane.io_extensions.yaml @@ -271,6 +271,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + lastHandledReconcileAt: + description: |- + LastHandledReconcileAt holds the value of the most recent + reconcile-requested-at annotation token that the controller has + processed. Users can compare this to the annotation to determine + whether a reconcile request has been handled. + type: string observedGeneration: description: |- ObservedGeneration is the latest metadata.generation diff --git a/package/crds/postgresql.sql.m.crossplane.io_grants.yaml b/package/crds/postgresql.sql.m.crossplane.io_grants.yaml index 6d140dc4..dbe9632f 100644 --- a/package/crds/postgresql.sql.m.crossplane.io_grants.yaml +++ b/package/crds/postgresql.sql.m.crossplane.io_grants.yaml @@ -602,6 +602,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + lastHandledReconcileAt: + description: |- + LastHandledReconcileAt holds the value of the most recent + reconcile-requested-at annotation token that the controller has + processed. Users can compare this to the annotation to determine + whether a reconcile request has been handled. + type: string observedGeneration: description: |- ObservedGeneration is the latest metadata.generation diff --git a/package/crds/postgresql.sql.m.crossplane.io_roles.yaml b/package/crds/postgresql.sql.m.crossplane.io_roles.yaml index 275a64a7..90e30e1e 100644 --- a/package/crds/postgresql.sql.m.crossplane.io_roles.yaml +++ b/package/crds/postgresql.sql.m.crossplane.io_roles.yaml @@ -270,6 +270,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + lastHandledReconcileAt: + description: |- + LastHandledReconcileAt holds the value of the most recent + reconcile-requested-at annotation token that the controller has + processed. Users can compare this to the annotation to determine + whether a reconcile request has been handled. + type: string observedGeneration: description: |- ObservedGeneration is the latest metadata.generation diff --git a/package/crds/postgresql.sql.m.crossplane.io_schemas.yaml b/package/crds/postgresql.sql.m.crossplane.io_schemas.yaml index 5f2a3474..94bbd122 100644 --- a/package/crds/postgresql.sql.m.crossplane.io_schemas.yaml +++ b/package/crds/postgresql.sql.m.crossplane.io_schemas.yaml @@ -356,6 +356,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + lastHandledReconcileAt: + description: |- + LastHandledReconcileAt holds the value of the most recent + reconcile-requested-at annotation token that the controller has + processed. Users can compare this to the annotation to determine + whether a reconcile request has been handled. + type: string observedGeneration: description: |- ObservedGeneration is the latest metadata.generation diff --git a/pkg/clients/mssql/mssql.go b/pkg/clients/mssql/mssql.go index 1c0a5ac0..4be0e99c 100644 --- a/pkg/clients/mssql/mssql.go +++ b/pkg/clients/mssql/mssql.go @@ -25,8 +25,8 @@ import ( "github.com/pkg/errors" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/pkg/clients/xsql" ) @@ -45,8 +45,8 @@ type mssqlDB struct { // New returns a new mssql database client. func New(creds map[string][]byte, database string) xsql.DB { - endpoint := string(creds[xpv1.ResourceCredentialsSecretEndpointKey]) - port := string(creds[xpv1.ResourceCredentialsSecretPortKey]) + endpoint := string(creds[xpv2.CredentialsSecretEndpointKey]) + port := string(creds[xpv2.CredentialsSecretPortKey]) host := endpoint if port != "" { @@ -59,7 +59,7 @@ func New(creds map[string][]byte, database string) xsql.DB { } u := &url.URL{ Scheme: driverName, - User: url.UserPassword(string(creds[xpv1.ResourceCredentialsSecretUserKey]), string(creds[xpv1.ResourceCredentialsSecretPasswordKey])), + User: url.UserPassword(string(creds[xpv2.CredentialsSecretUserKey]), string(creds[xpv2.CredentialsSecretPasswordKey])), Host: host, RawQuery: query.Encode(), } @@ -112,10 +112,10 @@ func (c mssqlDB) Scan(ctx context.Context, q xsql.Query, dest ...interface{}) er // GetConnectionDetails returns the connection details for a user of this DB func (c mssqlDB) GetConnectionDetails(username, password string) managed.ConnectionDetails { return managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte(username), - xpv1.ResourceCredentialsSecretPasswordKey: []byte(password), - xpv1.ResourceCredentialsSecretEndpointKey: []byte(c.endpoint), - xpv1.ResourceCredentialsSecretPortKey: []byte(c.port), + xpv2.CredentialsSecretUserKey: []byte(username), + xpv2.CredentialsSecretPasswordKey: []byte(password), + xpv2.CredentialsSecretEndpointKey: []byte(c.endpoint), + xpv2.CredentialsSecretPortKey: []byte(c.port), } } diff --git a/pkg/clients/mysql/mysql.go b/pkg/clients/mysql/mysql.go index 4ab55902..da4b94c4 100644 --- a/pkg/clients/mysql/mysql.go +++ b/pkg/clients/mysql/mysql.go @@ -10,8 +10,8 @@ import ( "github.com/crossplane-contrib/provider-sql/pkg/clients/xsql" "github.com/pkg/errors" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" ) const ( @@ -27,10 +27,10 @@ type mySQLDB struct { // New returns a new MySQL database client. func New(creds map[string][]byte, tls *string, binlog *bool) xsql.DB { - endpoint := string(creds[xpv1.ResourceCredentialsSecretEndpointKey]) - port := string(creds[xpv1.ResourceCredentialsSecretPortKey]) - username := string(creds[xpv1.ResourceCredentialsSecretUserKey]) - password := string(creds[xpv1.ResourceCredentialsSecretPasswordKey]) + endpoint := string(creds[xpv2.CredentialsSecretEndpointKey]) + port := string(creds[xpv2.CredentialsSecretPortKey]) + username := string(creds[xpv2.CredentialsSecretUserKey]) + password := string(creds[xpv2.CredentialsSecretPasswordKey]) if tls == nil { defaultTLS := "preferred" tls = &defaultTLS @@ -110,10 +110,10 @@ func (c mySQLDB) Scan(ctx context.Context, q xsql.Query, dest ...interface{}) er // GetConnectionDetails returns the connection details for a user of this DB func (c mySQLDB) GetConnectionDetails(username, password string) managed.ConnectionDetails { return managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte(username), - xpv1.ResourceCredentialsSecretPasswordKey: []byte(password), - xpv1.ResourceCredentialsSecretEndpointKey: []byte(c.endpoint), - xpv1.ResourceCredentialsSecretPortKey: []byte(c.port), + xpv2.CredentialsSecretUserKey: []byte(username), + xpv2.CredentialsSecretPasswordKey: []byte(password), + xpv2.CredentialsSecretEndpointKey: []byte(c.endpoint), + xpv2.CredentialsSecretPortKey: []byte(c.port), } } diff --git a/pkg/clients/postgresql/postgresql.go b/pkg/clients/postgresql/postgresql.go index 97ef36cc..9dd60287 100644 --- a/pkg/clients/postgresql/postgresql.go +++ b/pkg/clients/postgresql/postgresql.go @@ -10,8 +10,8 @@ import ( "github.com/lib/pq" "github.com/lib/pq/pqerror" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" ) const ( @@ -32,10 +32,10 @@ type postgresDB struct { // value of PGDATABASE, or if unset, the hardcoded string 'postgres'. // The sslmode defines the mode used to set up the connection for the provider. func New(creds map[string][]byte, database, sslmode string) xsql.DB { - endpoint := string(creds[xpv1.ResourceCredentialsSecretEndpointKey]) - port := string(creds[xpv1.ResourceCredentialsSecretPortKey]) - username := string(creds[xpv1.ResourceCredentialsSecretUserKey]) - password := string(creds[xpv1.ResourceCredentialsSecretPasswordKey]) + endpoint := string(creds[xpv2.CredentialsSecretEndpointKey]) + port := string(creds[xpv2.CredentialsSecretPortKey]) + username := string(creds[xpv2.CredentialsSecretUserKey]) + password := string(creds[xpv2.CredentialsSecretPasswordKey]) dsn := DSN(username, password, endpoint, port, database, sslmode) return postgresDB{ @@ -131,10 +131,10 @@ func (c postgresDB) Scan(ctx context.Context, q xsql.Query, dest ...interface{}) // GetConnectionDetails returns the connection details for a user of this DB func (c postgresDB) GetConnectionDetails(username, password string) managed.ConnectionDetails { return managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte(username), - xpv1.ResourceCredentialsSecretPasswordKey: []byte(password), - xpv1.ResourceCredentialsSecretEndpointKey: []byte(c.endpoint), - xpv1.ResourceCredentialsSecretPortKey: []byte(c.port), + xpv2.CredentialsSecretUserKey: []byte(username), + xpv2.CredentialsSecretPasswordKey: []byte(password), + xpv2.CredentialsSecretEndpointKey: []byte(c.endpoint), + xpv2.CredentialsSecretPortKey: []byte(c.port), } } diff --git a/pkg/controller/cluster/mssql/database/reconciler.go b/pkg/controller/cluster/mssql/database/reconciler.go index bf28ad01..a59a3cc6 100644 --- a/pkg/controller/cluster/mssql/database/reconciler.go +++ b/pkg/controller/cluster/mssql/database/reconciler.go @@ -27,13 +27,13 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" xpcontroller "github.com/crossplane/crossplane-runtime/v2/pkg/controller" "github.com/crossplane/crossplane-runtime/v2/pkg/event" "github.com/crossplane/crossplane-runtime/v2/pkg/feature" "github.com/crossplane/crossplane-runtime/v2/pkg/meta" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" clusterv1alpha1 "github.com/crossplane-contrib/provider-sql/apis/cluster/mssql/v1alpha1" "github.com/crossplane-contrib/provider-sql/pkg/clients/mssql" @@ -148,7 +148,7 @@ func (c *external) Observe(ctx context.Context, mg *clusterv1alpha1.Database) (m return managed.ExternalObservation{}, errors.Wrap(err, errSelectDB) } - mg.SetConditions(xpv1.Available()) + mg.SetConditions(xpv2.Available()) return managed.ExternalObservation{ ResourceExists: true, diff --git a/pkg/controller/cluster/mssql/database/reconciler_test.go b/pkg/controller/cluster/mssql/database/reconciler_test.go index a0d77a67..a75c0094 100644 --- a/pkg/controller/cluster/mssql/database/reconciler_test.go +++ b/pkg/controller/cluster/mssql/database/reconciler_test.go @@ -27,10 +27,10 @@ import ( corev1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" "github.com/crossplane/crossplane-runtime/v2/pkg/test" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/pkg/clients/xsql" ) @@ -93,8 +93,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.Database{ Spec: v1alpha1.DatabaseSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, @@ -112,8 +112,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.Database{ Spec: v1alpha1.DatabaseSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, @@ -134,8 +134,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.Database{ Spec: v1alpha1.DatabaseSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, @@ -149,7 +149,7 @@ func TestConnect(t *testing.T) { MockGet: test.NewMockGetFn(nil, func(obj client.Object) error { switch o := obj.(type) { case *v1alpha1.ProviderConfig: - o.Spec.Credentials.ConnectionSecretRef = &xpv1.SecretReference{} + o.Spec.Credentials.ConnectionSecretRef = &xpv2.SecretReference{} case *corev1.Secret: return errBoom } @@ -161,8 +161,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.Database{ Spec: v1alpha1.DatabaseSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, diff --git a/pkg/controller/cluster/mssql/grant/reconciler.go b/pkg/controller/cluster/mssql/grant/reconciler.go index 7549077b..8184d51e 100644 --- a/pkg/controller/cluster/mssql/grant/reconciler.go +++ b/pkg/controller/cluster/mssql/grant/reconciler.go @@ -31,12 +31,12 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" xpcontroller "github.com/crossplane/crossplane-runtime/v2/pkg/controller" "github.com/crossplane/crossplane-runtime/v2/pkg/event" "github.com/crossplane/crossplane-runtime/v2/pkg/feature" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/apis/cluster/mssql/v1alpha1" "github.com/crossplane-contrib/provider-sql/pkg/clients/mssql" @@ -141,7 +141,7 @@ func (c *external) Observe(ctx context.Context, mg *v1alpha1.Grant) (managed.Ext return managed.ExternalObservation{}, nil } - mg.SetConditions(xpv1.Available()) + mg.SetConditions(xpv2.Available()) g, r := diffPermissions(mg.Spec.ForProvider.Permissions.ToStringSlice(), permissions) return managed.ExternalObservation{ diff --git a/pkg/controller/cluster/mssql/grant/reconciler_test.go b/pkg/controller/cluster/mssql/grant/reconciler_test.go index b47ea255..c5379242 100644 --- a/pkg/controller/cluster/mssql/grant/reconciler_test.go +++ b/pkg/controller/cluster/mssql/grant/reconciler_test.go @@ -30,10 +30,10 @@ import ( "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" "github.com/crossplane/crossplane-runtime/v2/pkg/test" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/apis/cluster/mssql/v1alpha1" "github.com/crossplane-contrib/provider-sql/pkg/clients/xsql" @@ -113,8 +113,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.Grant{ Spec: v1alpha1.GrantSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, @@ -135,8 +135,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.Grant{ Spec: v1alpha1.GrantSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, @@ -150,7 +150,7 @@ func TestConnect(t *testing.T) { MockGet: test.NewMockGetFn(nil, func(obj client.Object) error { switch o := obj.(type) { case *v1alpha1.ProviderConfig: - o.Spec.Credentials.ConnectionSecretRef = &xpv1.SecretReference{} + o.Spec.Credentials.ConnectionSecretRef = &xpv2.SecretReference{} case *corev1.Secret: return errBoom } @@ -162,8 +162,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.Grant{ Spec: v1alpha1.GrantSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, diff --git a/pkg/controller/cluster/mssql/user/reconciler.go b/pkg/controller/cluster/mssql/user/reconciler.go index 71b983c7..e83f8c47 100644 --- a/pkg/controller/cluster/mssql/user/reconciler.go +++ b/pkg/controller/cluster/mssql/user/reconciler.go @@ -29,7 +29,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" xpcontroller "github.com/crossplane/crossplane-runtime/v2/pkg/controller" "github.com/crossplane/crossplane-runtime/v2/pkg/event" "github.com/crossplane/crossplane-runtime/v2/pkg/feature" @@ -37,6 +36,7 @@ import ( "github.com/crossplane/crossplane-runtime/v2/pkg/password" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/apis/cluster/mssql/v1alpha1" "github.com/crossplane-contrib/provider-sql/pkg/clients/mssql" @@ -169,7 +169,7 @@ func (c *external) Observe(ctx context.Context, mg *v1alpha1.User) (managed.Exte return managed.ExternalObservation{}, errors.Wrap(err, errSelectUser) } - mg.SetConditions(xpv1.Available()) + mg.SetConditions(xpv2.Available()) _, pwdChanged, err := c.getPassword(ctx, mg) if err != nil { diff --git a/pkg/controller/cluster/mssql/user/reconciler_test.go b/pkg/controller/cluster/mssql/user/reconciler_test.go index 267cfba2..ac69dcff 100644 --- a/pkg/controller/cluster/mssql/user/reconciler_test.go +++ b/pkg/controller/cluster/mssql/user/reconciler_test.go @@ -32,11 +32,11 @@ import ( "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" "github.com/crossplane/crossplane-runtime/v2/pkg/meta" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" "github.com/crossplane/crossplane-runtime/v2/pkg/test" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/pkg/clients/xsql" ) @@ -64,10 +64,10 @@ func (m mockDB) Query(ctx context.Context, q xsql.Query) (*sql.Rows, error) { } func (m mockDB) GetConnectionDetails(username, password string) managed.ConnectionDetails { return managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte(username), - xpv1.ResourceCredentialsSecretPasswordKey: []byte(password), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("3306"), + xpv2.CredentialsSecretUserKey: []byte(username), + xpv2.CredentialsSecretPasswordKey: []byte(password), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("3306"), } } func (m mockDB) GetServerVersion(ctx context.Context) (int, error) { @@ -134,8 +134,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.User{ Spec: v1alpha1.UserSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, @@ -158,8 +158,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.User{ Spec: v1alpha1.UserSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, @@ -175,7 +175,7 @@ func TestConnect(t *testing.T) { MockGet: test.NewMockGetFn(nil, func(obj client.Object) error { switch o := obj.(type) { case *v1alpha1.ProviderConfig: - o.Spec.Credentials.ConnectionSecretRef = &xpv1.SecretReference{} + o.Spec.Credentials.ConnectionSecretRef = &xpv2.SecretReference{} case *corev1.Secret: return errBoom } @@ -187,8 +187,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.User{ Spec: v1alpha1.UserSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, @@ -204,7 +204,7 @@ func TestConnect(t *testing.T) { MockGet: test.NewMockGetFn(nil, func(obj client.Object) error { switch o := obj.(type) { case *v1alpha1.ProviderConfig: - o.Spec.Credentials.ConnectionSecretRef = &xpv1.SecretReference{} + o.Spec.Credentials.ConnectionSecretRef = &xpv2.SecretReference{} case *corev1.Secret: secret := corev1.Secret{ Data: map[string][]byte{}, @@ -220,8 +220,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.User{ Spec: v1alpha1.UserSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, ForProvider: v1alpha1.UserParameters{ Database: ptr.To("success-database"), @@ -241,7 +241,7 @@ func TestConnect(t *testing.T) { MockGet: test.NewMockGetFn(nil, func(obj client.Object) error { switch o := obj.(type) { case *v1alpha1.ProviderConfig: - o.Spec.Credentials.ConnectionSecretRef = &xpv1.SecretReference{} + o.Spec.Credentials.ConnectionSecretRef = &xpv2.SecretReference{} case *corev1.Secret: secret := corev1.Secret{ Data: map[string][]byte{}, @@ -257,8 +257,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.User{ Spec: v1alpha1.UserSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, ForProvider: v1alpha1.UserParameters{ Database: ptr.To("success-database"), @@ -379,7 +379,7 @@ func TestObserve(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte(key.Name) + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte(key.Name) secret.DeepCopyInto(obj.(*corev1.Secret)) return nil }, @@ -389,15 +389,15 @@ func TestObserve(t *testing.T) { mg: &v1alpha1.User{ Spec: v1alpha1.UserSpec{ ForProvider: v1alpha1.UserParameters{ - PasswordSecretRef: &xpv1.SecretKeySelector{ - SecretReference: xpv1.SecretReference{ + PasswordSecretRef: &xpv2.SecretKeySelector{ + SecretReference: xpv2.SecretReference{ Name: "example", }, Key: "password", }, }, - ResourceSpec: xpv1.ResourceSpec{ - WriteConnectionSecretToReference: &xpv1.SecretReference{ + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + WriteConnectionSecretToReference: &xpv2.SecretReference{ Name: "connection-secret", }, }, @@ -508,10 +508,10 @@ func TestCreate(t *testing.T) { err: nil, c: managed.ExternalCreation{ ConnectionDetails: managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte("example"), - xpv1.ResourceCredentialsSecretPasswordKey: []byte(""), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("3306"), + xpv2.CredentialsSecretUserKey: []byte("example"), + xpv2.CredentialsSecretPasswordKey: []byte(""), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("3306"), }, }, }, @@ -544,10 +544,10 @@ func TestCreate(t *testing.T) { err: nil, c: managed.ExternalCreation{ ConnectionDetails: managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte("example"), - xpv1.ResourceCredentialsSecretPasswordKey: []byte(""), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("3306"), + xpv2.CredentialsSecretUserKey: []byte("example"), + xpv2.CredentialsSecretPasswordKey: []byte(""), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("3306"), }, }, }, @@ -585,8 +585,8 @@ func TestCreate(t *testing.T) { }, Spec: v1alpha1.UserSpec{ ForProvider: v1alpha1.UserParameters{ - PasswordSecretRef: &xpv1.SecretKeySelector{ - SecretReference: xpv1.SecretReference{ + PasswordSecretRef: &xpv2.SecretKeySelector{ + SecretReference: xpv2.SecretReference{ Name: "example", }, Key: "password-custom", @@ -599,10 +599,10 @@ func TestCreate(t *testing.T) { err: nil, c: managed.ExternalCreation{ ConnectionDetails: managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte("example"), - xpv1.ResourceCredentialsSecretPasswordKey: []byte("test1234"), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("3306"), + xpv2.CredentialsSecretUserKey: []byte("example"), + xpv2.CredentialsSecretPasswordKey: []byte("test1234"), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("3306"), }, }, }, @@ -666,15 +666,15 @@ func TestUpdate(t *testing.T) { mg: &v1alpha1.User{ Spec: v1alpha1.UserSpec{ ForProvider: v1alpha1.UserParameters{ - PasswordSecretRef: &xpv1.SecretKeySelector{ - SecretReference: xpv1.SecretReference{ + PasswordSecretRef: &xpv2.SecretKeySelector{ + SecretReference: xpv2.SecretReference{ Name: "connection-secret", }, - Key: xpv1.ResourceCredentialsSecretPasswordKey, + Key: xpv2.CredentialsSecretPasswordKey, }, }, - ResourceSpec: xpv1.ResourceSpec{ - WriteConnectionSecretToReference: &xpv1.SecretReference{ + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + WriteConnectionSecretToReference: &xpv2.SecretReference{ Name: "password-secret", }, }, @@ -685,7 +685,7 @@ func TestUpdate(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte(key.Name) + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte(key.Name) secret.DeepCopyInto(obj.(*corev1.Secret)) return nil }, @@ -725,15 +725,15 @@ func TestUpdate(t *testing.T) { mg: &v1alpha1.User{ Spec: v1alpha1.UserSpec{ ForProvider: v1alpha1.UserParameters{ - PasswordSecretRef: &xpv1.SecretKeySelector{ - SecretReference: xpv1.SecretReference{ + PasswordSecretRef: &xpv2.SecretKeySelector{ + SecretReference: xpv2.SecretReference{ Name: "connection-secret", }, - Key: xpv1.ResourceCredentialsSecretPasswordKey, + Key: xpv2.CredentialsSecretPasswordKey, }, }, - ResourceSpec: xpv1.ResourceSpec{ - WriteConnectionSecretToReference: &xpv1.SecretReference{ + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + WriteConnectionSecretToReference: &xpv2.SecretReference{ Name: "connection-secret", }, }, @@ -744,7 +744,7 @@ func TestUpdate(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte("samesame") + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte("samesame") secret.DeepCopyInto(obj.(*corev1.Secret)) return nil }, @@ -768,15 +768,15 @@ func TestUpdate(t *testing.T) { }, Spec: v1alpha1.UserSpec{ ForProvider: v1alpha1.UserParameters{ - PasswordSecretRef: &xpv1.SecretKeySelector{ - SecretReference: xpv1.SecretReference{ + PasswordSecretRef: &xpv2.SecretKeySelector{ + SecretReference: xpv2.SecretReference{ Name: "example", }, Key: "password-custom", }, }, - ResourceSpec: xpv1.ResourceSpec{ - WriteConnectionSecretToReference: &xpv1.SecretReference{ + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + WriteConnectionSecretToReference: &xpv2.SecretReference{ Name: "connection-secret", }, }, @@ -796,7 +796,7 @@ func TestUpdate(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte("oldpassword") + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte("oldpassword") secret.DeepCopyInto(obj.(*corev1.Secret)) return nil default: @@ -809,10 +809,10 @@ func TestUpdate(t *testing.T) { err: nil, c: managed.ExternalUpdate{ ConnectionDetails: managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte("example"), - xpv1.ResourceCredentialsSecretPasswordKey: []byte("newpassword"), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("3306"), + xpv2.CredentialsSecretUserKey: []byte("example"), + xpv2.CredentialsSecretPasswordKey: []byte("newpassword"), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("3306"), }, }, }, diff --git a/pkg/controller/cluster/mssql/user/utils.go b/pkg/controller/cluster/mssql/user/utils.go index 411ffd63..ae782dbd 100644 --- a/pkg/controller/cluster/mssql/user/utils.go +++ b/pkg/controller/cluster/mssql/user/utils.go @@ -24,8 +24,8 @@ import ( "github.com/pkg/errors" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/apis/cluster/mssql/v1alpha1" ) @@ -60,7 +60,7 @@ func (c *external) getPassword(ctx context.Context, user *v1alpha1.User) (newPwd } // if newPwd was set to some value, compare value in output secret with // newPwd - changed = newPwd != "" && newPwd != string(s.Data[xpv1.ResourceCredentialsSecretPasswordKey]) + changed = newPwd != "" && newPwd != string(s.Data[xpv2.CredentialsSecretPasswordKey]) return newPwd, changed, nil } diff --git a/pkg/controller/cluster/mysql/database/reconciler.go b/pkg/controller/cluster/mysql/database/reconciler.go index 86443b59..5d353b3b 100644 --- a/pkg/controller/cluster/mysql/database/reconciler.go +++ b/pkg/controller/cluster/mysql/database/reconciler.go @@ -27,13 +27,13 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" xpcontroller "github.com/crossplane/crossplane-runtime/v2/pkg/controller" "github.com/crossplane/crossplane-runtime/v2/pkg/event" "github.com/crossplane/crossplane-runtime/v2/pkg/feature" "github.com/crossplane/crossplane-runtime/v2/pkg/meta" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/apis/cluster/mysql/v1alpha1" "github.com/crossplane-contrib/provider-sql/pkg/clients/mysql" @@ -170,7 +170,7 @@ func (c *external) Observe(ctx context.Context, mg *v1alpha1.Database) (managed. lateInitialized = true } - mg.SetConditions(xpv1.Available()) + mg.SetConditions(xpv2.Available()) return managed.ExternalObservation{ ResourceExists: true, diff --git a/pkg/controller/cluster/mysql/database/reconciler_test.go b/pkg/controller/cluster/mysql/database/reconciler_test.go index 2928bda1..4df7cf65 100644 --- a/pkg/controller/cluster/mysql/database/reconciler_test.go +++ b/pkg/controller/cluster/mysql/database/reconciler_test.go @@ -27,10 +27,10 @@ import ( corev1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" "github.com/crossplane/crossplane-runtime/v2/pkg/test" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/pkg/clients/xsql" ) @@ -104,8 +104,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.Database{ Spec: v1alpha1.DatabaseSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, @@ -126,8 +126,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.Database{ Spec: v1alpha1.DatabaseSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, @@ -141,7 +141,7 @@ func TestConnect(t *testing.T) { MockGet: test.NewMockGetFn(nil, func(obj client.Object) error { switch o := obj.(type) { case *v1alpha1.ProviderConfig: - o.Spec.Credentials.ConnectionSecretRef = &xpv1.SecretReference{} + o.Spec.Credentials.ConnectionSecretRef = &xpv2.SecretReference{} case *corev1.Secret: return errBoom } @@ -153,8 +153,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.Database{ Spec: v1alpha1.DatabaseSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, diff --git a/pkg/controller/cluster/mysql/grant/reconciler.go b/pkg/controller/cluster/mysql/grant/reconciler.go index 50546675..9c358aa4 100644 --- a/pkg/controller/cluster/mysql/grant/reconciler.go +++ b/pkg/controller/cluster/mysql/grant/reconciler.go @@ -32,12 +32,12 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" xpcontroller "github.com/crossplane/crossplane-runtime/v2/pkg/controller" "github.com/crossplane/crossplane-runtime/v2/pkg/event" "github.com/crossplane/crossplane-runtime/v2/pkg/feature" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/apis/cluster/mysql/v1alpha1" "github.com/crossplane-contrib/provider-sql/pkg/clients/mysql" @@ -164,7 +164,7 @@ func (c *external) Observe(ctx context.Context, mg *v1alpha1.Grant) (managed.Ext desiredPrivileges := mg.Spec.ForProvider.Privileges.ToStringSlice() toGrant, toRevoke := diffPermissions(desiredPrivileges, observedPrivileges) - mg.SetConditions(xpv1.Available()) + mg.SetConditions(xpv2.Available()) return managed.ExternalObservation{ ResourceExists: true, diff --git a/pkg/controller/cluster/mysql/grant/reconciler_test.go b/pkg/controller/cluster/mysql/grant/reconciler_test.go index 39d95b3a..ccddbcda 100644 --- a/pkg/controller/cluster/mysql/grant/reconciler_test.go +++ b/pkg/controller/cluster/mysql/grant/reconciler_test.go @@ -32,10 +32,10 @@ import ( "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" "github.com/crossplane/crossplane-runtime/v2/pkg/test" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/pkg/clients/xsql" ) @@ -114,8 +114,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.Grant{ Spec: v1alpha1.GrantSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, @@ -136,8 +136,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.Grant{ Spec: v1alpha1.GrantSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, @@ -151,7 +151,7 @@ func TestConnect(t *testing.T) { MockGet: test.NewMockGetFn(nil, func(obj client.Object) error { switch o := obj.(type) { case *v1alpha1.ProviderConfig: - o.Spec.Credentials.ConnectionSecretRef = &xpv1.SecretReference{} + o.Spec.Credentials.ConnectionSecretRef = &xpv2.SecretReference{} case *corev1.Secret: return errBoom } @@ -163,8 +163,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.Grant{ Spec: v1alpha1.GrantSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, diff --git a/pkg/controller/cluster/mysql/tls/tls.go b/pkg/controller/cluster/mysql/tls/tls.go index 8985e064..56d46060 100644 --- a/pkg/controller/cluster/mysql/tls/tls.go +++ b/pkg/controller/cluster/mysql/tls/tls.go @@ -7,7 +7,7 @@ import ( "fmt" "github.com/crossplane-contrib/provider-sql/apis/cluster/mysql/v1alpha1" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/go-sql-driver/mysql" "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" @@ -95,7 +95,7 @@ func getClientKeyPair(ctx context.Context, kube client.Client, cfg *v1alpha1.TLS return keyPair, nil } -func getSecret(ctx context.Context, kube client.Client, sel xpv1.SecretKeySelector) ([]byte, error) { +func getSecret(ctx context.Context, kube client.Client, sel xpv2.SecretKeySelector) ([]byte, error) { secret := &corev1.Secret{} if err := kube.Get(ctx, types.NamespacedName{ Namespace: sel.Namespace, diff --git a/pkg/controller/cluster/mysql/user/reconciler.go b/pkg/controller/cluster/mysql/user/reconciler.go index a7ef0cd9..93b46d2f 100644 --- a/pkg/controller/cluster/mysql/user/reconciler.go +++ b/pkg/controller/cluster/mysql/user/reconciler.go @@ -29,7 +29,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" xpcontroller "github.com/crossplane/crossplane-runtime/v2/pkg/controller" "github.com/crossplane/crossplane-runtime/v2/pkg/event" "github.com/crossplane/crossplane-runtime/v2/pkg/feature" @@ -37,6 +36,7 @@ import ( "github.com/crossplane/crossplane-runtime/v2/pkg/password" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/apis/cluster/mysql/v1alpha1" "github.com/crossplane-contrib/provider-sql/pkg/clients/mysql" @@ -267,7 +267,7 @@ func (c *external) Observe(ctx context.Context, mg *v1alpha1.User) (managed.Exte mg.Status.AtProvider.ResourceOptionsAsClauses = resourceOptionsToClauses(observed.ResourceOptions) mg.Status.AtProvider.AuthenticationPlugin = observed.AuthenticationPlugin - mg.SetConditions(xpv1.Available()) + mg.SetConditions(xpv2.Available()) return managed.ExternalObservation{ ResourceExists: true, @@ -313,7 +313,7 @@ func authPluginEqual(observed, desired *v1alpha1.AuthenticationPlugin) bool { } func (c *external) Create(ctx context.Context, mg *v1alpha1.User) (managed.ExternalCreation, error) { - mg.SetConditions(xpv1.Creating()) + mg.SetConditions(xpv2.Creating()) username, host := mysql.SplitUserHost(meta.GetExternalName(mg)) ro := resourceOptionsToClauses(mg.Spec.ForProvider.ResourceOptions) @@ -541,7 +541,7 @@ func (c *external) Disconnect(ctx context.Context) error { } func (c *external) Delete(ctx context.Context, mg *v1alpha1.User) (managed.ExternalDelete, error) { - mg.SetConditions(xpv1.Deleting()) + mg.SetConditions(xpv2.Deleting()) username, host := mysql.SplitUserHost(meta.GetExternalName(mg)) diff --git a/pkg/controller/cluster/mysql/user/reconciler_test.go b/pkg/controller/cluster/mysql/user/reconciler_test.go index 0d256a84..b6baca70 100644 --- a/pkg/controller/cluster/mysql/user/reconciler_test.go +++ b/pkg/controller/cluster/mysql/user/reconciler_test.go @@ -30,11 +30,11 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" "github.com/crossplane/crossplane-runtime/v2/pkg/meta" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" "github.com/crossplane/crossplane-runtime/v2/pkg/test" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/pkg/clients/xsql" ) @@ -60,10 +60,10 @@ func (m mockDB) Query(ctx context.Context, q xsql.Query) (*sql.Rows, error) { } func (m mockDB) GetConnectionDetails(username, password string) managed.ConnectionDetails { return managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte(username), - xpv1.ResourceCredentialsSecretPasswordKey: []byte(password), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("3306"), + xpv2.CredentialsSecretUserKey: []byte(username), + xpv2.CredentialsSecretPasswordKey: []byte(password), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("3306"), } } func (m mockDB) GetServerVersion(ctx context.Context) (int, error) { @@ -114,8 +114,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.User{ Spec: v1alpha1.UserSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, @@ -136,8 +136,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.User{ Spec: v1alpha1.UserSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, @@ -151,7 +151,7 @@ func TestConnect(t *testing.T) { MockGet: test.NewMockGetFn(nil, func(obj client.Object) error { switch o := obj.(type) { case *v1alpha1.ProviderConfig: - o.Spec.Credentials.ConnectionSecretRef = &xpv1.SecretReference{} + o.Spec.Credentials.ConnectionSecretRef = &xpv2.SecretReference{} case *corev1.Secret: return errBoom } @@ -163,8 +163,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.User{ Spec: v1alpha1.UserSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, @@ -273,7 +273,7 @@ func TestObserve(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte(key.Name) + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte(key.Name) secret.DeepCopyInto(obj.(*corev1.Secret)) return nil }, @@ -283,15 +283,15 @@ func TestObserve(t *testing.T) { mg: &v1alpha1.User{ Spec: v1alpha1.UserSpec{ ForProvider: v1alpha1.UserParameters{ - PasswordSecretRef: &xpv1.SecretKeySelector{ - SecretReference: xpv1.SecretReference{ + PasswordSecretRef: &xpv2.SecretKeySelector{ + SecretReference: xpv2.SecretReference{ Name: "example", }, Key: "password", }, }, - ResourceSpec: xpv1.ResourceSpec{ - WriteConnectionSecretToReference: &xpv1.SecretReference{ + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + WriteConnectionSecretToReference: &xpv2.SecretReference{ Name: "connection-secret", }, }, @@ -424,10 +424,10 @@ func TestCreate(t *testing.T) { err: nil, c: managed.ExternalCreation{ ConnectionDetails: managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte("example"), - xpv1.ResourceCredentialsSecretPasswordKey: []byte(""), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("3306"), + xpv2.CredentialsSecretUserKey: []byte("example"), + xpv2.CredentialsSecretPasswordKey: []byte(""), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("3306"), }, }, }, @@ -452,10 +452,10 @@ func TestCreate(t *testing.T) { err: nil, c: managed.ExternalCreation{ ConnectionDetails: managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte("example"), - xpv1.ResourceCredentialsSecretPasswordKey: []byte(""), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("3306"), + xpv2.CredentialsSecretUserKey: []byte("example"), + xpv2.CredentialsSecretPasswordKey: []byte(""), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("3306"), }, }, }, @@ -492,8 +492,8 @@ func TestCreate(t *testing.T) { }, Spec: v1alpha1.UserSpec{ ForProvider: v1alpha1.UserParameters{ - PasswordSecretRef: &xpv1.SecretKeySelector{ - SecretReference: xpv1.SecretReference{ + PasswordSecretRef: &xpv2.SecretKeySelector{ + SecretReference: xpv2.SecretReference{ Name: "example", }, Key: "password-custom", @@ -506,10 +506,10 @@ func TestCreate(t *testing.T) { err: nil, c: managed.ExternalCreation{ ConnectionDetails: managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte("example"), - xpv1.ResourceCredentialsSecretPasswordKey: []byte("test1234"), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("3306"), + xpv2.CredentialsSecretUserKey: []byte("example"), + xpv2.CredentialsSecretPasswordKey: []byte("test1234"), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("3306"), }, }, }, @@ -554,10 +554,10 @@ func TestCreate(t *testing.T) { err: nil, c: managed.ExternalCreation{ ConnectionDetails: managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte("example"), - xpv1.ResourceCredentialsSecretPasswordKey: []byte(""), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("3306"), + xpv2.CredentialsSecretUserKey: []byte("example"), + xpv2.CredentialsSecretPasswordKey: []byte(""), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("3306"), }, }, }, @@ -601,10 +601,10 @@ func TestCreate(t *testing.T) { err: nil, c: managed.ExternalCreation{ ConnectionDetails: managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte("example"), - xpv1.ResourceCredentialsSecretPasswordKey: []byte(""), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("3306"), + xpv2.CredentialsSecretUserKey: []byte("example"), + xpv2.CredentialsSecretPasswordKey: []byte(""), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("3306"), }, }, }, @@ -673,15 +673,15 @@ func TestUpdate(t *testing.T) { mg: &v1alpha1.User{ Spec: v1alpha1.UserSpec{ ForProvider: v1alpha1.UserParameters{ - PasswordSecretRef: &xpv1.SecretKeySelector{ - SecretReference: xpv1.SecretReference{ + PasswordSecretRef: &xpv2.SecretKeySelector{ + SecretReference: xpv2.SecretReference{ Name: "connection-secret", }, - Key: xpv1.ResourceCredentialsSecretPasswordKey, + Key: xpv2.CredentialsSecretPasswordKey, }, }, - ResourceSpec: xpv1.ResourceSpec{ - WriteConnectionSecretToReference: &xpv1.SecretReference{ + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + WriteConnectionSecretToReference: &xpv2.SecretReference{ Name: "password-secret", }, }, @@ -692,7 +692,7 @@ func TestUpdate(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte(key.Name) + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte(key.Name) secret.DeepCopyInto(obj.(*corev1.Secret)) return nil }, @@ -732,15 +732,15 @@ func TestUpdate(t *testing.T) { mg: &v1alpha1.User{ Spec: v1alpha1.UserSpec{ ForProvider: v1alpha1.UserParameters{ - PasswordSecretRef: &xpv1.SecretKeySelector{ - SecretReference: xpv1.SecretReference{ + PasswordSecretRef: &xpv2.SecretKeySelector{ + SecretReference: xpv2.SecretReference{ Name: "connection-secret", }, - Key: xpv1.ResourceCredentialsSecretPasswordKey, + Key: xpv2.CredentialsSecretPasswordKey, }, }, - ResourceSpec: xpv1.ResourceSpec{ - WriteConnectionSecretToReference: &xpv1.SecretReference{ + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + WriteConnectionSecretToReference: &xpv2.SecretReference{ Name: "connection-secret", }, }, @@ -751,7 +751,7 @@ func TestUpdate(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte("samesame") + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte("samesame") secret.DeepCopyInto(obj.(*corev1.Secret)) return nil }, @@ -836,10 +836,10 @@ func TestUpdate(t *testing.T) { want: want{ c: managed.ExternalUpdate{ ConnectionDetails: managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte("example"), - xpv1.ResourceCredentialsSecretPasswordKey: []byte(""), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("3306"), + xpv2.CredentialsSecretUserKey: []byte("example"), + xpv2.CredentialsSecretPasswordKey: []byte(""), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("3306"), }, }, }, @@ -884,10 +884,10 @@ func TestUpdate(t *testing.T) { want: want{ c: managed.ExternalUpdate{ ConnectionDetails: managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte("example"), - xpv1.ResourceCredentialsSecretPasswordKey: []byte(""), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("3306"), + xpv2.CredentialsSecretUserKey: []byte("example"), + xpv2.CredentialsSecretPasswordKey: []byte(""), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("3306"), }, }, }, @@ -908,15 +908,15 @@ func TestUpdate(t *testing.T) { }, Spec: v1alpha1.UserSpec{ ForProvider: v1alpha1.UserParameters{ - PasswordSecretRef: &xpv1.SecretKeySelector{ - SecretReference: xpv1.SecretReference{ + PasswordSecretRef: &xpv2.SecretKeySelector{ + SecretReference: xpv2.SecretReference{ Name: "example", }, Key: "password-custom", }, }, - ResourceSpec: xpv1.ResourceSpec{ - WriteConnectionSecretToReference: &xpv1.SecretReference{ + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + WriteConnectionSecretToReference: &xpv2.SecretReference{ Name: "connection-secret", }, }, @@ -936,7 +936,7 @@ func TestUpdate(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte("oldpassword") + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte("oldpassword") secret.DeepCopyInto(obj.(*corev1.Secret)) return nil default: @@ -949,10 +949,10 @@ func TestUpdate(t *testing.T) { err: nil, c: managed.ExternalUpdate{ ConnectionDetails: managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte("example"), - xpv1.ResourceCredentialsSecretPasswordKey: []byte("newpassword"), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("3306"), + xpv2.CredentialsSecretUserKey: []byte("example"), + xpv2.CredentialsSecretPasswordKey: []byte("newpassword"), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("3306"), }, }, }, @@ -979,11 +979,11 @@ func TestUpdate(t *testing.T) { }, Spec: v1alpha1.UserSpec{ ForProvider: v1alpha1.UserParameters{ - PasswordSecretRef: &xpv1.SecretKeySelector{ - SecretReference: xpv1.SecretReference{ + PasswordSecretRef: &xpv2.SecretKeySelector{ + SecretReference: xpv2.SecretReference{ Name: "connection-secret", }, - Key: xpv1.ResourceCredentialsSecretPasswordKey, + Key: xpv2.CredentialsSecretPasswordKey, }, ResourceOptions: &v1alpha1.ResourceOptions{ MaxQueriesPerHour: new(int), @@ -1009,7 +1009,7 @@ func TestUpdate(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte("samesame") + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte("samesame") secret.DeepCopyInto(obj.(*corev1.Secret)) return nil }, diff --git a/pkg/controller/cluster/mysql/user/utils.go b/pkg/controller/cluster/mysql/user/utils.go index 13dd5050..23a48c04 100644 --- a/pkg/controller/cluster/mysql/user/utils.go +++ b/pkg/controller/cluster/mysql/user/utils.go @@ -24,8 +24,8 @@ import ( "github.com/pkg/errors" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/apis/cluster/mysql/v1alpha1" ) @@ -60,7 +60,7 @@ func (c *external) getPassword(ctx context.Context, user *v1alpha1.User) (newPwd } // if newPwd was set to some value, compare value in output secret with // newPwd - changed = newPwd != "" && newPwd != string(s.Data[xpv1.ResourceCredentialsSecretPasswordKey]) + changed = newPwd != "" && newPwd != string(s.Data[xpv2.CredentialsSecretPasswordKey]) return newPwd, changed, nil } diff --git a/pkg/controller/cluster/postgresql/database/reconciler.go b/pkg/controller/cluster/postgresql/database/reconciler.go index 0bcafae5..362d7de7 100644 --- a/pkg/controller/cluster/postgresql/database/reconciler.go +++ b/pkg/controller/cluster/postgresql/database/reconciler.go @@ -32,13 +32,13 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" xpcontroller "github.com/crossplane/crossplane-runtime/v2/pkg/controller" "github.com/crossplane/crossplane-runtime/v2/pkg/event" "github.com/crossplane/crossplane-runtime/v2/pkg/feature" "github.com/crossplane/crossplane-runtime/v2/pkg/meta" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/apis/cluster/postgresql/v1alpha1" "github.com/crossplane-contrib/provider-sql/pkg/clients" @@ -181,7 +181,7 @@ func (c *external) Observe(ctx context.Context, mg *v1alpha1.Database) (managed. return managed.ExternalObservation{}, errors.Wrap(err, errSelectDB) } - mg.SetConditions(xpv1.Available()) + mg.SetConditions(xpv2.Available()) return managed.ExternalObservation{ ResourceExists: true, diff --git a/pkg/controller/cluster/postgresql/database/reconciler_test.go b/pkg/controller/cluster/postgresql/database/reconciler_test.go index 711418e1..1b761dc3 100644 --- a/pkg/controller/cluster/postgresql/database/reconciler_test.go +++ b/pkg/controller/cluster/postgresql/database/reconciler_test.go @@ -27,10 +27,10 @@ import ( corev1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" "github.com/crossplane/crossplane-runtime/v2/pkg/test" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/pkg/clients/xsql" ) @@ -111,8 +111,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.Database{ Spec: v1alpha1.DatabaseSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, @@ -133,8 +133,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.Database{ Spec: v1alpha1.DatabaseSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, @@ -148,7 +148,7 @@ func TestConnect(t *testing.T) { MockGet: test.NewMockGetFn(nil, func(obj client.Object) error { switch o := obj.(type) { case *v1alpha1.ProviderConfig: - o.Spec.Credentials.ConnectionSecretRef = &xpv1.SecretReference{} + o.Spec.Credentials.ConnectionSecretRef = &xpv2.SecretReference{} case *corev1.Secret: return errBoom } @@ -160,8 +160,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.Database{ Spec: v1alpha1.DatabaseSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, diff --git a/pkg/controller/cluster/postgresql/default_privileges/reconciler.go b/pkg/controller/cluster/postgresql/default_privileges/reconciler.go index ec25e701..410c385d 100644 --- a/pkg/controller/cluster/postgresql/default_privileges/reconciler.go +++ b/pkg/controller/cluster/postgresql/default_privileges/reconciler.go @@ -31,12 +31,12 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" xpcontroller "github.com/crossplane/crossplane-runtime/v2/pkg/controller" "github.com/crossplane/crossplane-runtime/v2/pkg/event" "github.com/crossplane/crossplane-runtime/v2/pkg/feature" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/apis/cluster/postgresql/v1alpha1" "github.com/crossplane-contrib/provider-sql/pkg/clients" @@ -293,7 +293,7 @@ func (c *external) Observe(ctx context.Context, mg *v1alpha1.DefaultPrivileges) return managed.ExternalObservation{ResourceExists: false}, nil } - mg.SetConditions(xpv1.Available()) + mg.SetConditions(xpv2.Available()) resourceMatches := matchingGrants(defaultPrivileges, gp.Privileges.ToStringSlice()) return managed.ExternalObservation{ @@ -309,7 +309,7 @@ func (c *external) Observe(ctx context.Context, mg *v1alpha1.DefaultPrivileges) func (c *external) Create(ctx context.Context, mg *v1alpha1.DefaultPrivileges) (managed.ExternalCreation, error) { - mg.SetConditions(xpv1.Creating()) + mg.SetConditions(xpv2.Creating()) var createQuery xsql.Query createDefaultPrivilegesQuery(mg.Spec.ForProvider, &createQuery) @@ -334,7 +334,7 @@ func (c *external) Update( func (c *external) Delete(ctx context.Context, mg *v1alpha1.DefaultPrivileges) (managed.ExternalDelete, error) { var query xsql.Query - mg.SetConditions(xpv1.Deleting()) + mg.SetConditions(xpv2.Deleting()) deleteDefaultPrivilegesQuery(mg.Spec.ForProvider, &query) diff --git a/pkg/controller/cluster/postgresql/default_privileges/reconciler_test.go b/pkg/controller/cluster/postgresql/default_privileges/reconciler_test.go index f41f378a..93f61906 100644 --- a/pkg/controller/cluster/postgresql/default_privileges/reconciler_test.go +++ b/pkg/controller/cluster/postgresql/default_privileges/reconciler_test.go @@ -31,10 +31,10 @@ import ( "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" "github.com/crossplane/crossplane-runtime/v2/pkg/test" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/pkg/clients/xsql" ) @@ -116,8 +116,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.DefaultPrivileges{ Spec: v1alpha1.DefaultPrivilegesSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, @@ -138,8 +138,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.DefaultPrivileges{ Spec: v1alpha1.DefaultPrivilegesSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, @@ -153,7 +153,7 @@ func TestConnect(t *testing.T) { MockGet: test.NewMockGetFn(nil, func(obj client.Object) error { switch o := obj.(type) { case *v1alpha1.ProviderConfig: - o.Spec.Credentials.ConnectionSecretRef = &xpv1.SecretReference{} + o.Spec.Credentials.ConnectionSecretRef = &xpv2.SecretReference{} case *corev1.Secret: return errBoom } @@ -165,8 +165,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.DefaultPrivileges{ Spec: v1alpha1.DefaultPrivilegesSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, @@ -205,8 +205,8 @@ func TestConnectDatabaseSelection(t *testing.T) { args: args{ mg: &v1alpha1.DefaultPrivileges{ Spec: v1alpha1.DefaultPrivilegesSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, ForProvider: v1alpha1.DefaultPrivilegesParameters{ Database: ptr.To("mydb"), @@ -221,8 +221,8 @@ func TestConnectDatabaseSelection(t *testing.T) { args: args{ mg: &v1alpha1.DefaultPrivileges{ Spec: v1alpha1.DefaultPrivilegesSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, ForProvider: v1alpha1.DefaultPrivilegesParameters{}, }, @@ -241,7 +241,7 @@ func TestConnectDatabaseSelection(t *testing.T) { switch o := obj.(type) { case *v1alpha1.ProviderConfig: o.Spec.DefaultDatabase = "default-db" - o.Spec.Credentials.ConnectionSecretRef = &xpv1.SecretReference{} + o.Spec.Credentials.ConnectionSecretRef = &xpv2.SecretReference{} case *corev1.Secret: // Return empty secret data } diff --git a/pkg/controller/cluster/postgresql/extension/reconciler.go b/pkg/controller/cluster/postgresql/extension/reconciler.go index be93e002..e76665bd 100644 --- a/pkg/controller/cluster/postgresql/extension/reconciler.go +++ b/pkg/controller/cluster/postgresql/extension/reconciler.go @@ -29,12 +29,12 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" xpcontroller "github.com/crossplane/crossplane-runtime/v2/pkg/controller" "github.com/crossplane/crossplane-runtime/v2/pkg/event" "github.com/crossplane/crossplane-runtime/v2/pkg/feature" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/apis/cluster/postgresql/v1alpha1" "github.com/crossplane-contrib/provider-sql/pkg/clients" @@ -163,7 +163,7 @@ func (c *external) Observe(ctx context.Context, mg *v1alpha1.Extension) (managed return managed.ExternalObservation{}, errors.Wrap(err, errSelectExtension) } - mg.SetConditions(xpv1.Available()) + mg.SetConditions(xpv2.Available()) return managed.ExternalObservation{ ResourceExists: true, diff --git a/pkg/controller/cluster/postgresql/extension/reconciler_test.go b/pkg/controller/cluster/postgresql/extension/reconciler_test.go index 20ed6d76..2baeceac 100644 --- a/pkg/controller/cluster/postgresql/extension/reconciler_test.go +++ b/pkg/controller/cluster/postgresql/extension/reconciler_test.go @@ -27,10 +27,10 @@ import ( corev1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" "github.com/crossplane/crossplane-runtime/v2/pkg/test" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/pkg/clients/xsql" ) @@ -108,8 +108,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.Extension{ Spec: v1alpha1.ExtensionSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, @@ -130,8 +130,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.Extension{ Spec: v1alpha1.ExtensionSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, @@ -145,7 +145,7 @@ func TestConnect(t *testing.T) { MockGet: test.NewMockGetFn(nil, func(obj client.Object) error { switch o := obj.(type) { case *v1alpha1.ProviderConfig: - o.Spec.Credentials.ConnectionSecretRef = &xpv1.SecretReference{} + o.Spec.Credentials.ConnectionSecretRef = &xpv2.SecretReference{} case *corev1.Secret: return errBoom } @@ -157,8 +157,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.Extension{ Spec: v1alpha1.ExtensionSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, diff --git a/pkg/controller/cluster/postgresql/grant/connect_test.go b/pkg/controller/cluster/postgresql/grant/connect_test.go index 23dd02f1..0fa49a76 100644 --- a/pkg/controller/cluster/postgresql/grant/connect_test.go +++ b/pkg/controller/cluster/postgresql/grant/connect_test.go @@ -25,10 +25,10 @@ import ( "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" "github.com/crossplane/crossplane-runtime/v2/pkg/logging" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" "github.com/crossplane/crossplane-runtime/v2/pkg/test" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/apis/cluster/postgresql/v1alpha1" "github.com/crossplane-contrib/provider-sql/pkg/clients/xsql" @@ -40,7 +40,7 @@ func kubeWithSecret(defaultDB string) client.Client { return &test.MockClient{ MockGet: test.NewMockGetFn(nil, func(obj client.Object) error { if o, ok := obj.(*v1alpha1.ProviderConfig); ok { - o.Spec.Credentials.ConnectionSecretRef = &xpv1.SecretReference{} + o.Spec.Credentials.ConnectionSecretRef = &xpv2.SecretReference{} o.Spec.DefaultDatabase = defaultDB } return nil @@ -51,8 +51,8 @@ func kubeWithSecret(defaultDB string) client.Client { func databaseGrant(db string) *v1alpha1.Grant { return &v1alpha1.Grant{ Spec: v1alpha1.GrantSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, ForProvider: v1alpha1.GrantParameters{ Role: ptr.To("appuser"), diff --git a/pkg/controller/cluster/postgresql/grant/reconciler.go b/pkg/controller/cluster/postgresql/grant/reconciler.go index d23f07e9..b017b447 100644 --- a/pkg/controller/cluster/postgresql/grant/reconciler.go +++ b/pkg/controller/cluster/postgresql/grant/reconciler.go @@ -30,7 +30,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" xpcontroller "github.com/crossplane/crossplane-runtime/v2/pkg/controller" "github.com/crossplane/crossplane-runtime/v2/pkg/event" "github.com/crossplane/crossplane-runtime/v2/pkg/feature" @@ -38,6 +37,7 @@ import ( "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/reference" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/apis/cluster/postgresql/v1alpha1" "github.com/crossplane-contrib/provider-sql/pkg/clients" @@ -187,7 +187,7 @@ func (c *external) Create(ctx context.Context, mg *v1alpha1.Grant) (managed.Exte var queries []xsql.Query - mg.SetConditions(xpv1.Creating()) + mg.SetConditions(xpv2.Creating()) if err := createGrantQueriesWithVersion(mg.Spec.ForProvider, &queries, c.serverVersion); err != nil { return managed.ExternalCreation{}, errors.Wrap(err, errCreateGrant) @@ -498,7 +498,7 @@ func (c *external) Delete(ctx context.Context, mg *v1alpha1.Grant) (managed.Exte var query xsql.Query - mg.SetConditions(xpv1.Deleting()) + mg.SetConditions(xpv2.Deleting()) err := deleteGrantQuery(mg.Spec.ForProvider, &query) if err != nil { @@ -615,7 +615,7 @@ func (c *external) Observe(ctx context.Context, mg *v1alpha1.Grant) (managed.Ext } // Grants have no way of being 'not up to date' - if they exist, they are up to date - mg.SetConditions(xpv1.Available()) + mg.SetConditions(xpv2.Available()) return managed.ExternalObservation{ ResourceExists: true, diff --git a/pkg/controller/cluster/postgresql/grant/reconciler_test.go b/pkg/controller/cluster/postgresql/grant/reconciler_test.go index 61ec6a93..e0b73522 100644 --- a/pkg/controller/cluster/postgresql/grant/reconciler_test.go +++ b/pkg/controller/cluster/postgresql/grant/reconciler_test.go @@ -33,11 +33,11 @@ import ( "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" "github.com/crossplane/crossplane-runtime/v2/pkg/logging" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" "github.com/crossplane/crossplane-runtime/v2/pkg/test" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/pkg/clients/xsql" ) @@ -120,8 +120,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.Grant{ Spec: v1alpha1.GrantSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, @@ -142,8 +142,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.Grant{ Spec: v1alpha1.GrantSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, @@ -157,7 +157,7 @@ func TestConnect(t *testing.T) { MockGet: test.NewMockGetFn(nil, func(obj client.Object) error { switch o := obj.(type) { case *v1alpha1.ProviderConfig: - o.Spec.Credentials.ConnectionSecretRef = &xpv1.SecretReference{} + o.Spec.Credentials.ConnectionSecretRef = &xpv2.SecretReference{} case *corev1.Secret: return errBoom } @@ -169,8 +169,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.Grant{ Spec: v1alpha1.GrantSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, diff --git a/pkg/controller/cluster/postgresql/role/reconciler.go b/pkg/controller/cluster/postgresql/role/reconciler.go index 1b5346cf..2da5d98f 100644 --- a/pkg/controller/cluster/postgresql/role/reconciler.go +++ b/pkg/controller/cluster/postgresql/role/reconciler.go @@ -34,7 +34,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" xpcontroller "github.com/crossplane/crossplane-runtime/v2/pkg/controller" "github.com/crossplane/crossplane-runtime/v2/pkg/event" "github.com/crossplane/crossplane-runtime/v2/pkg/feature" @@ -42,6 +41,7 @@ import ( "github.com/crossplane/crossplane-runtime/v2/pkg/password" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/apis/cluster/postgresql/v1alpha1" "github.com/crossplane-contrib/provider-sql/pkg/clients" @@ -267,7 +267,7 @@ func (c *external) Observe(ctx context.Context, mg *v1alpha1.Role) (managed.Exte return managed.ExternalObservation{}, err } - mg.SetConditions(xpv1.Available()) + mg.SetConditions(xpv2.Available()) // PrivilegesAsClauses is used as role status output mg.Status.AtProvider.PrivilegesAsClauses = privilegesToClauses(observed.Privileges) @@ -280,7 +280,7 @@ func (c *external) Observe(ctx context.Context, mg *v1alpha1.Role) (managed.Exte } func (c *external) Create(ctx context.Context, mg *v1alpha1.Role) (managed.ExternalCreation, error) { - mg.SetConditions(xpv1.Creating()) + mg.SetConditions(xpv2.Creating()) crn := pq.QuoteIdentifier(meta.GetExternalName(mg)) privs := privilegesToClauses(mg.Spec.ForProvider.Privileges) @@ -426,7 +426,7 @@ func (c *external) Update(ctx context.Context, mg *v1alpha1.Role) (managed.Exter } func (c *external) Delete(ctx context.Context, mg *v1alpha1.Role) (managed.ExternalDelete, error) { - mg.SetConditions(xpv1.Deleting()) + mg.SetConditions(xpv2.Deleting()) err := c.db.Exec(ctx, xsql.Query{ String: "DROP ROLE IF EXISTS " + pq.QuoteIdentifier(meta.GetExternalName(mg)), }) diff --git a/pkg/controller/cluster/postgresql/role/reconciler_test.go b/pkg/controller/cluster/postgresql/role/reconciler_test.go index f385787b..263d2847 100644 --- a/pkg/controller/cluster/postgresql/role/reconciler_test.go +++ b/pkg/controller/cluster/postgresql/role/reconciler_test.go @@ -35,11 +35,11 @@ import ( "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" "github.com/crossplane/crossplane-runtime/v2/pkg/meta" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" "github.com/crossplane/crossplane-runtime/v2/pkg/test" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/pkg/clients/xsql" ) @@ -69,10 +69,10 @@ func (m mockDB) Query(ctx context.Context, q xsql.Query) (*sql.Rows, error) { func (m mockDB) GetConnectionDetails(rolename, password string) managed.ConnectionDetails { return managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte(rolename), - xpv1.ResourceCredentialsSecretPasswordKey: []byte(password), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("5432"), + xpv2.CredentialsSecretUserKey: []byte(rolename), + xpv2.CredentialsSecretPasswordKey: []byte(password), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("5432"), } } @@ -125,8 +125,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.Role{ Spec: v1alpha1.RoleSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, @@ -147,8 +147,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.Role{ Spec: v1alpha1.RoleSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, @@ -162,7 +162,7 @@ func TestConnect(t *testing.T) { MockGet: test.NewMockGetFn(nil, func(obj client.Object) error { switch o := obj.(type) { case *v1alpha1.ProviderConfig: - o.Spec.Credentials.ConnectionSecretRef = &xpv1.SecretReference{} + o.Spec.Credentials.ConnectionSecretRef = &xpv2.SecretReference{} case *corev1.Secret: return errBoom } @@ -174,8 +174,8 @@ func TestConnect(t *testing.T) { args: args{ mg: &v1alpha1.Role{ Spec: v1alpha1.RoleSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, @@ -289,7 +289,7 @@ func TestObserve(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte(key.Name) + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte(key.Name) secret.DeepCopyInto(obj.(*corev1.Secret)) return nil }, @@ -299,8 +299,8 @@ func TestObserve(t *testing.T) { mg: &v1alpha1.Role{ Spec: v1alpha1.RoleSpec{ ForProvider: v1alpha1.RoleParameters{ - PasswordSecretRef: &xpv1.SecretKeySelector{ - SecretReference: xpv1.SecretReference{ + PasswordSecretRef: &xpv2.SecretKeySelector{ + SecretReference: xpv2.SecretReference{ Name: "example", }, Key: "password", @@ -308,8 +308,8 @@ func TestObserve(t *testing.T) { Privileges: v1alpha1.RolePrivilege{}, ConnectionLimit: ptr.To(int32(10)), }, - ResourceSpec: xpv1.ResourceSpec{ - WriteConnectionSecretToReference: &xpv1.SecretReference{ + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + WriteConnectionSecretToReference: &xpv2.SecretReference{ Name: "connection-secret", }, }, @@ -452,10 +452,10 @@ func TestCreate(t *testing.T) { err: nil, c: managed.ExternalCreation{ ConnectionDetails: managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte("example"), - xpv1.ResourceCredentialsSecretPasswordKey: []byte(""), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("5432"), + xpv2.CredentialsSecretUserKey: []byte("example"), + xpv2.CredentialsSecretPasswordKey: []byte(""), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("5432"), }, }, }, @@ -492,8 +492,8 @@ func TestCreate(t *testing.T) { }, Spec: v1alpha1.RoleSpec{ ForProvider: v1alpha1.RoleParameters{ - PasswordSecretRef: &xpv1.SecretKeySelector{ - SecretReference: xpv1.SecretReference{ + PasswordSecretRef: &xpv2.SecretKeySelector{ + SecretReference: xpv2.SecretReference{ Name: "example", }, Key: "password-custom", @@ -506,10 +506,10 @@ func TestCreate(t *testing.T) { err: nil, c: managed.ExternalCreation{ ConnectionDetails: managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte("example"), - xpv1.ResourceCredentialsSecretPasswordKey: []byte("test1234"), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("5432"), + xpv2.CredentialsSecretUserKey: []byte("example"), + xpv2.CredentialsSecretPasswordKey: []byte("test1234"), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("5432"), }, }, }, @@ -572,15 +572,15 @@ func TestUpdate(t *testing.T) { mg: &v1alpha1.Role{ Spec: v1alpha1.RoleSpec{ ForProvider: v1alpha1.RoleParameters{ - PasswordSecretRef: &xpv1.SecretKeySelector{ - SecretReference: xpv1.SecretReference{ + PasswordSecretRef: &xpv2.SecretKeySelector{ + SecretReference: xpv2.SecretReference{ Name: "connection-secret", }, - Key: xpv1.ResourceCredentialsSecretPasswordKey, + Key: xpv2.CredentialsSecretPasswordKey, }, }, - ResourceSpec: xpv1.ResourceSpec{ - WriteConnectionSecretToReference: &xpv1.SecretReference{ + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + WriteConnectionSecretToReference: &xpv2.SecretReference{ Name: "password-secret", }, }, @@ -591,7 +591,7 @@ func TestUpdate(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte(key.Name) + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte(key.Name) secret.DeepCopyInto(obj.(*corev1.Secret)) return nil }, @@ -641,15 +641,15 @@ func TestUpdate(t *testing.T) { }, Spec: v1alpha1.RoleSpec{ ForProvider: v1alpha1.RoleParameters{ - PasswordSecretRef: &xpv1.SecretKeySelector{ - SecretReference: xpv1.SecretReference{ + PasswordSecretRef: &xpv2.SecretKeySelector{ + SecretReference: xpv2.SecretReference{ Name: "connection-secret", }, - Key: xpv1.ResourceCredentialsSecretPasswordKey, + Key: xpv2.CredentialsSecretPasswordKey, }, }, - ResourceSpec: xpv1.ResourceSpec{ - WriteConnectionSecretToReference: &xpv1.SecretReference{ + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + WriteConnectionSecretToReference: &xpv2.SecretReference{ Name: "connection-secret", }, }, @@ -660,7 +660,7 @@ func TestUpdate(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte("samesame") + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte("samesame") secret.DeepCopyInto(obj.(*corev1.Secret)) return nil }, @@ -684,15 +684,15 @@ func TestUpdate(t *testing.T) { }, Spec: v1alpha1.RoleSpec{ ForProvider: v1alpha1.RoleParameters{ - PasswordSecretRef: &xpv1.SecretKeySelector{ - SecretReference: xpv1.SecretReference{ + PasswordSecretRef: &xpv2.SecretKeySelector{ + SecretReference: xpv2.SecretReference{ Name: "example", }, Key: "password-custom", }, }, - ResourceSpec: xpv1.ResourceSpec{ - WriteConnectionSecretToReference: &xpv1.SecretReference{ + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + WriteConnectionSecretToReference: &xpv2.SecretReference{ Name: "connection-secret", }, }, @@ -712,7 +712,7 @@ func TestUpdate(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte("oldpassword") + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte("oldpassword") secret.DeepCopyInto(obj.(*corev1.Secret)) return nil default: @@ -725,10 +725,10 @@ func TestUpdate(t *testing.T) { err: nil, c: managed.ExternalUpdate{ ConnectionDetails: managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte("example"), - xpv1.ResourceCredentialsSecretPasswordKey: []byte("newpassword"), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("5432"), + xpv2.CredentialsSecretUserKey: []byte("example"), + xpv2.CredentialsSecretPasswordKey: []byte("newpassword"), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("5432"), }, }, }, @@ -757,11 +757,11 @@ func TestUpdate(t *testing.T) { }, Spec: v1alpha1.RoleSpec{ ForProvider: v1alpha1.RoleParameters{ - PasswordSecretRef: &xpv1.SecretKeySelector{ - SecretReference: xpv1.SecretReference{ + PasswordSecretRef: &xpv2.SecretKeySelector{ + SecretReference: xpv2.SecretReference{ Name: "connection-secret", }, - Key: xpv1.ResourceCredentialsSecretPasswordKey, + Key: xpv2.CredentialsSecretPasswordKey, }, Privileges: v1alpha1.RolePrivilege{ Login: ptr.To(true), @@ -783,7 +783,7 @@ func TestUpdate(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte("samesame") + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte("samesame") secret.DeepCopyInto(obj.(*corev1.Secret)) return nil }, @@ -809,11 +809,11 @@ func TestUpdate(t *testing.T) { }, Spec: v1alpha1.RoleSpec{ ForProvider: v1alpha1.RoleParameters{ - PasswordSecretRef: &xpv1.SecretKeySelector{ - SecretReference: xpv1.SecretReference{ + PasswordSecretRef: &xpv2.SecretKeySelector{ + SecretReference: xpv2.SecretReference{ Name: "connection-secret", }, - Key: xpv1.ResourceCredentialsSecretPasswordKey, + Key: xpv2.CredentialsSecretPasswordKey, }, Privileges: v1alpha1.RolePrivilege{ Login: ptr.To(true), @@ -835,7 +835,7 @@ func TestUpdate(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte("samesame") + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte("samesame") secret.DeepCopyInto(obj.(*corev1.Secret)) return nil }, @@ -863,11 +863,11 @@ func TestUpdate(t *testing.T) { }, Spec: v1alpha1.RoleSpec{ ForProvider: v1alpha1.RoleParameters{ - PasswordSecretRef: &xpv1.SecretKeySelector{ - SecretReference: xpv1.SecretReference{ + PasswordSecretRef: &xpv2.SecretKeySelector{ + SecretReference: xpv2.SecretReference{ Name: "connection-secret", }, - Key: xpv1.ResourceCredentialsSecretPasswordKey, + Key: xpv2.CredentialsSecretPasswordKey, }, Privileges: v1alpha1.RolePrivilege{ Login: ptr.To(true), @@ -889,7 +889,7 @@ func TestUpdate(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte("samesame") + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte("samesame") secret.DeepCopyInto(obj.(*corev1.Secret)) return nil }, @@ -930,11 +930,11 @@ func TestUpdate(t *testing.T) { }, Spec: v1alpha1.RoleSpec{ ForProvider: v1alpha1.RoleParameters{ - PasswordSecretRef: &xpv1.SecretKeySelector{ - SecretReference: xpv1.SecretReference{ + PasswordSecretRef: &xpv2.SecretKeySelector{ + SecretReference: xpv2.SecretReference{ Name: "connection-secret", }, - Key: xpv1.ResourceCredentialsSecretPasswordKey, + Key: xpv2.CredentialsSecretPasswordKey, }, ConfigurationParameters: &[]v1alpha1.RoleConfigurationParameter{ { @@ -968,7 +968,7 @@ func TestUpdate(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte("samesame") + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte("samesame") secret.DeepCopyInto(obj.(*corev1.Secret)) return nil }, @@ -994,11 +994,11 @@ func TestUpdate(t *testing.T) { }, Spec: v1alpha1.RoleSpec{ ForProvider: v1alpha1.RoleParameters{ - PasswordSecretRef: &xpv1.SecretKeySelector{ - SecretReference: xpv1.SecretReference{ + PasswordSecretRef: &xpv2.SecretKeySelector{ + SecretReference: xpv2.SecretReference{ Name: "connection-secret", }, - Key: xpv1.ResourceCredentialsSecretPasswordKey, + Key: xpv2.CredentialsSecretPasswordKey, }, ConfigurationParameters: &[]v1alpha1.RoleConfigurationParameter{ { @@ -1035,7 +1035,7 @@ func TestUpdate(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte("samesame") + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte("samesame") secret.DeepCopyInto(obj.(*corev1.Secret)) return nil }, @@ -1096,8 +1096,8 @@ func TestGetPassword(t *testing.T) { ForProvider: v1alpha1.RoleParameters{ PasswordRotationTrigger: &v1.Time{Time: time.Now()}, }, - ResourceSpec: xpv1.ResourceSpec{ - WriteConnectionSecretToReference: &xpv1.SecretReference{ + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + WriteConnectionSecretToReference: &xpv2.SecretReference{ Name: "test-secret", Namespace: "test-ns", }, @@ -1108,7 +1108,7 @@ func TestGetPassword(t *testing.T) { MockGet: func(_ context.Context, _ client.ObjectKey, obj client.Object) error { secret := corev1.Secret{ Data: map[string][]byte{ - xpv1.ResourceCredentialsSecretPasswordKey: []byte("existing-password"), + xpv2.CredentialsSecretPasswordKey: []byte("existing-password"), }, } secret.DeepCopyInto(obj.(*corev1.Secret)) @@ -1123,8 +1123,8 @@ func TestGetPassword(t *testing.T) { args: args{ role: &v1alpha1.Role{ Spec: v1alpha1.RoleSpec{ - ResourceSpec: xpv1.ResourceSpec{ - WriteConnectionSecretToReference: &xpv1.SecretReference{ + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + WriteConnectionSecretToReference: &xpv2.SecretReference{ Name: "test-secret", Namespace: "test-ns", }, @@ -1142,8 +1142,8 @@ func TestGetPassword(t *testing.T) { args: args{ role: &v1alpha1.Role{ Spec: v1alpha1.RoleSpec{ - ResourceSpec: xpv1.ResourceSpec{ - WriteConnectionSecretToReference: &xpv1.SecretReference{ + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + WriteConnectionSecretToReference: &xpv2.SecretReference{ Name: "test-secret", Namespace: "test-ns", }, @@ -1154,7 +1154,7 @@ func TestGetPassword(t *testing.T) { MockGet: func(_ context.Context, _ client.ObjectKey, obj client.Object) error { secret := corev1.Secret{ Data: map[string][]byte{ - xpv1.ResourceCredentialsSecretPasswordKey: []byte("existing-password"), + xpv2.CredentialsSecretPasswordKey: []byte("existing-password"), }, } secret.DeepCopyInto(obj.(*corev1.Secret)) @@ -1267,8 +1267,8 @@ func TestUpdatePasswordReset(t *testing.T) { }, }, Spec: v1alpha1.RoleSpec{ - ResourceSpec: xpv1.ResourceSpec{ - WriteConnectionSecretToReference: &xpv1.SecretReference{ + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + WriteConnectionSecretToReference: &xpv2.SecretReference{ Name: "test-secret", Namespace: "test-ns", }, @@ -1335,7 +1335,7 @@ func TestUpdatePasswordReset(t *testing.T) { } else if *execQuery == fmt.Sprintf("ALTER ROLE %s PASSWORD ''", pq.QuoteIdentifier("example")) { t.Errorf("\n%s\ne.Update(...): ALTER ROLE PASSWORD query contained an empty password\n", tc.reason) } - if pw := got.ConnectionDetails[xpv1.ResourceCredentialsSecretPasswordKey]; len(pw) == 0 { + if pw := got.ConnectionDetails[xpv2.CredentialsSecretPasswordKey]; len(pw) == 0 { t.Errorf("\n%s\ne.Update(...): expected non-empty password in ConnectionDetails\n", tc.reason) } } @@ -1423,7 +1423,7 @@ func TestConnectWithSecretKeyMapping(t *testing.T) { MockGet: func(_ context.Context, key client.ObjectKey, obj client.Object) error { switch o := obj.(type) { case *v1alpha1.ProviderConfig: - o.Spec.Credentials.ConnectionSecretRef = &xpv1.SecretReference{ + o.Spec.Credentials.ConnectionSecretRef = &xpv2.SecretReference{ Name: "pg-secret", Namespace: "default", } @@ -1446,8 +1446,8 @@ func TestConnectWithSecretKeyMapping(t *testing.T) { }, mg: &v1alpha1.Role{ Spec: v1alpha1.RoleSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, @@ -1467,7 +1467,7 @@ func TestConnectWithSecretKeyMapping(t *testing.T) { MockGet: func(_ context.Context, key client.ObjectKey, obj client.Object) error { switch o := obj.(type) { case *v1alpha1.ProviderConfig: - o.Spec.Credentials.ConnectionSecretRef = &xpv1.SecretReference{ + o.Spec.Credentials.ConnectionSecretRef = &xpv2.SecretReference{ Name: "pg-secret", Namespace: "default", } @@ -1486,8 +1486,8 @@ func TestConnectWithSecretKeyMapping(t *testing.T) { }, mg: &v1alpha1.Role{ Spec: v1alpha1.RoleSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, diff --git a/pkg/controller/cluster/postgresql/role/utils.go b/pkg/controller/cluster/postgresql/role/utils.go index 70186d29..87b75328 100644 --- a/pkg/controller/cluster/postgresql/role/utils.go +++ b/pkg/controller/cluster/postgresql/role/utils.go @@ -24,8 +24,8 @@ import ( "github.com/pkg/errors" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/apis/cluster/postgresql/v1alpha1" ) @@ -58,7 +58,7 @@ func (c *external) getPassword(ctx context.Context, role *v1alpha1.Role) (newPwd } // if newPwd was set to some value, compare value in output secret with // newPwd - changed = newPwd != "" && newPwd != string(s.Data[xpv1.ResourceCredentialsSecretPasswordKey]) + changed = newPwd != "" && newPwd != string(s.Data[xpv2.CredentialsSecretPasswordKey]) return newPwd, changed, nil } @@ -96,5 +96,5 @@ func (c *external) shouldResetPassword(ctx context.Context, role *v1alpha1.Role) } return true, nil } - return len(s.Data[xpv1.ResourceCredentialsSecretPasswordKey]) == 0, nil + return len(s.Data[xpv2.CredentialsSecretPasswordKey]) == 0, nil } diff --git a/pkg/controller/cluster/postgresql/schema/reconciler.go b/pkg/controller/cluster/postgresql/schema/reconciler.go index 6fd4e769..7d616c9c 100644 --- a/pkg/controller/cluster/postgresql/schema/reconciler.go +++ b/pkg/controller/cluster/postgresql/schema/reconciler.go @@ -30,13 +30,13 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" xpcontroller "github.com/crossplane/crossplane-runtime/v2/pkg/controller" "github.com/crossplane/crossplane-runtime/v2/pkg/event" "github.com/crossplane/crossplane-runtime/v2/pkg/feature" "github.com/crossplane/crossplane-runtime/v2/pkg/meta" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/apis/cluster/postgresql/v1alpha1" "github.com/crossplane-contrib/provider-sql/pkg/clients" @@ -165,7 +165,7 @@ func (c *external) Observe(ctx context.Context, mg *v1alpha1.Schema) (managed.Ex return managed.ExternalObservation{}, errors.Wrap(err, errSelectSchema) } - mg.SetConditions(xpv1.Available()) + mg.SetConditions(xpv2.Available()) return managed.ExternalObservation{ ResourceExists: true, @@ -177,7 +177,7 @@ func (c *external) Observe(ctx context.Context, mg *v1alpha1.Schema) (managed.Ex func (c *external) Create(ctx context.Context, mg *v1alpha1.Schema) (managed.ExternalCreation, error) { //nolint:gocyclo var queries []xsql.Query - mg.SetConditions(xpv1.Creating()) + mg.SetConditions(xpv2.Creating()) createSchemaQueries(mg.Spec.ForProvider, &queries, meta.GetExternalName(mg)) diff --git a/pkg/controller/cluster/postgresql/schema/reconciler_test.go b/pkg/controller/cluster/postgresql/schema/reconciler_test.go index 47dde675..e469b3ba 100644 --- a/pkg/controller/cluster/postgresql/schema/reconciler_test.go +++ b/pkg/controller/cluster/postgresql/schema/reconciler_test.go @@ -29,11 +29,11 @@ import ( "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" "github.com/crossplane/crossplane-runtime/v2/pkg/meta" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" "github.com/crossplane/crossplane-runtime/v2/pkg/test" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/pkg/clients/xsql" ) @@ -119,8 +119,8 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.Schema{ ObjectMeta: cr.ObjectMeta, Spec: v1alpha1.SchemaSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, @@ -142,8 +142,8 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.Schema{ ObjectMeta: cr.ObjectMeta, Spec: v1alpha1.SchemaSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, @@ -157,7 +157,7 @@ func TestConnect(t *testing.T) { MockGet: test.NewMockGetFn(nil, func(obj client.Object) error { switch o := obj.(type) { case *v1alpha1.ProviderConfig: - o.Spec.Credentials.ConnectionSecretRef = &xpv1.SecretReference{} + o.Spec.Credentials.ConnectionSecretRef = &xpv2.SecretReference{} case *corev1.Secret: return errBoom } @@ -170,8 +170,8 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.Schema{ ObjectMeta: cr.ObjectMeta, Spec: v1alpha1.SchemaSpec{ - ResourceSpec: xpv1.ResourceSpec{ - ProviderConfigReference: &xpv1.Reference{}, + ClusterManagedResourceSpec: xpv2.ClusterManagedResourceSpec{ + ProviderConfigReference: &xpv2.Reference{}, }, }, }, diff --git a/pkg/controller/namespaced/mssql/database/reconciler.go b/pkg/controller/namespaced/mssql/database/reconciler.go index fcad40b7..d5f66622 100644 --- a/pkg/controller/namespaced/mssql/database/reconciler.go +++ b/pkg/controller/namespaced/mssql/database/reconciler.go @@ -25,13 +25,13 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" xpcontroller "github.com/crossplane/crossplane-runtime/v2/pkg/controller" "github.com/crossplane/crossplane-runtime/v2/pkg/event" "github.com/crossplane/crossplane-runtime/v2/pkg/feature" "github.com/crossplane/crossplane-runtime/v2/pkg/meta" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" namespacedv1alpha1 "github.com/crossplane-contrib/provider-sql/apis/namespaced/mssql/v1alpha1" "github.com/crossplane-contrib/provider-sql/pkg/clients/mssql" @@ -128,7 +128,7 @@ func (c *external) Observe(ctx context.Context, mg *namespacedv1alpha1.Database) return managed.ExternalObservation{}, errors.Wrap(err, errSelectDB) } - mg.SetConditions(xpv1.Available()) + mg.SetConditions(xpv2.Available()) return managed.ExternalObservation{ ResourceExists: true, diff --git a/pkg/controller/namespaced/mssql/database/reconciler_test.go b/pkg/controller/namespaced/mssql/database/reconciler_test.go index bfee3cee..c84cec1c 100644 --- a/pkg/controller/namespaced/mssql/database/reconciler_test.go +++ b/pkg/controller/namespaced/mssql/database/reconciler_test.go @@ -28,11 +28,10 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/crossplane/crossplane-runtime/v2/apis/common" - xpv2 "github.com/crossplane/crossplane-runtime/v2/apis/common/v2" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" "github.com/crossplane/crossplane-runtime/v2/pkg/test" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/pkg/clients/xsql" provErrors "github.com/crossplane-contrib/provider-sql/pkg/controller/namespaced/errors" @@ -103,7 +102,7 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.Database{ Spec: v1alpha1.DatabaseSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: "Invalid", }, }, @@ -124,7 +123,7 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.Database{ Spec: v1alpha1.DatabaseSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, @@ -146,7 +145,7 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.Database{ Spec: v1alpha1.DatabaseSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ClusterProviderConfigKind, Name: "example", }, @@ -174,7 +173,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.DatabaseSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, @@ -191,7 +190,7 @@ func TestConnect(t *testing.T) { MockGet: test.NewMockGetFn(nil, func(obj client.Object) error { switch o := obj.(type) { case *v1alpha1.ProviderConfig: - o.Spec.Credentials.ConnectionSecretRef = common.LocalSecretReference{Name: "example"} + o.Spec.Credentials.ConnectionSecretRef = xpv2.LocalSecretReference{Name: "example"} case *corev1.Secret: return errBoom } @@ -207,7 +206,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.DatabaseSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, diff --git a/pkg/controller/namespaced/mssql/grant/reconciler.go b/pkg/controller/namespaced/mssql/grant/reconciler.go index bba34f77..a2095af7 100644 --- a/pkg/controller/namespaced/mssql/grant/reconciler.go +++ b/pkg/controller/namespaced/mssql/grant/reconciler.go @@ -29,12 +29,12 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" xpcontroller "github.com/crossplane/crossplane-runtime/v2/pkg/controller" "github.com/crossplane/crossplane-runtime/v2/pkg/event" "github.com/crossplane/crossplane-runtime/v2/pkg/feature" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" namespacedv1alpha1 "github.com/crossplane-contrib/provider-sql/apis/namespaced/mssql/v1alpha1" "github.com/crossplane-contrib/provider-sql/pkg/clients/mssql" @@ -123,7 +123,7 @@ func (c *external) Observe(ctx context.Context, mg *namespacedv1alpha1.Grant) (m return managed.ExternalObservation{}, nil } - mg.SetConditions(xpv1.Available()) + mg.SetConditions(xpv2.Available()) g, r := diffPermissions(mg.Spec.ForProvider.Permissions.ToStringSlice(), permissions) return managed.ExternalObservation{ diff --git a/pkg/controller/namespaced/mssql/grant/reconciler_test.go b/pkg/controller/namespaced/mssql/grant/reconciler_test.go index 7cddc966..bf6bda2b 100644 --- a/pkg/controller/namespaced/mssql/grant/reconciler_test.go +++ b/pkg/controller/namespaced/mssql/grant/reconciler_test.go @@ -31,11 +31,10 @@ import ( "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/crossplane/crossplane-runtime/v2/apis/common" - xpv2 "github.com/crossplane/crossplane-runtime/v2/apis/common/v2" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" "github.com/crossplane/crossplane-runtime/v2/pkg/test" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/apis/namespaced/mssql/v1alpha1" "github.com/crossplane-contrib/provider-sql/pkg/clients/xsql" @@ -113,7 +112,7 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.Grant{ Spec: v1alpha1.GrantSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{Kind: "Invalid"}, + ProviderConfigReference: &xpv2.ProviderConfigReference{Kind: "Invalid"}, }, }, }, @@ -135,7 +134,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.GrantSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, @@ -157,7 +156,7 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.Grant{ Spec: v1alpha1.GrantSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ClusterProviderConfigKind, Name: "example", }, @@ -182,7 +181,7 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.Grant{ Spec: v1alpha1.GrantSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, @@ -199,7 +198,7 @@ func TestConnect(t *testing.T) { MockGet: test.NewMockGetFn(nil, func(obj client.Object) error { switch o := obj.(type) { case *v1alpha1.ProviderConfig: - o.Spec.Credentials.ConnectionSecretRef = common.LocalSecretReference{Name: "example"} + o.Spec.Credentials.ConnectionSecretRef = xpv2.LocalSecretReference{Name: "example"} case *corev1.Secret: return errBoom } @@ -215,7 +214,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.GrantSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, diff --git a/pkg/controller/namespaced/mssql/user/reconciler.go b/pkg/controller/namespaced/mssql/user/reconciler.go index 9946d3e6..405a9cfd 100644 --- a/pkg/controller/namespaced/mssql/user/reconciler.go +++ b/pkg/controller/namespaced/mssql/user/reconciler.go @@ -27,7 +27,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" xpcontroller "github.com/crossplane/crossplane-runtime/v2/pkg/controller" "github.com/crossplane/crossplane-runtime/v2/pkg/event" "github.com/crossplane/crossplane-runtime/v2/pkg/feature" @@ -35,6 +34,7 @@ import ( "github.com/crossplane/crossplane-runtime/v2/pkg/password" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" namespacedv1alpha1 "github.com/crossplane-contrib/provider-sql/apis/namespaced/mssql/v1alpha1" "github.com/crossplane-contrib/provider-sql/pkg/clients/mssql" @@ -151,7 +151,7 @@ func (c *external) Observe(ctx context.Context, mg *namespacedv1alpha1.User) (ma return managed.ExternalObservation{}, errors.Wrap(err, errSelectUser) } - mg.SetConditions(xpv1.Available()) + mg.SetConditions(xpv2.Available()) _, pwdChanged, err := c.getPassword(ctx, mg) if err != nil { diff --git a/pkg/controller/namespaced/mssql/user/reconciler_test.go b/pkg/controller/namespaced/mssql/user/reconciler_test.go index c74d049e..0a308ce8 100644 --- a/pkg/controller/namespaced/mssql/user/reconciler_test.go +++ b/pkg/controller/namespaced/mssql/user/reconciler_test.go @@ -32,13 +32,11 @@ import ( "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/crossplane/crossplane-runtime/v2/apis/common" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" - xpv2 "github.com/crossplane/crossplane-runtime/v2/apis/common/v2" "github.com/crossplane/crossplane-runtime/v2/pkg/meta" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" "github.com/crossplane/crossplane-runtime/v2/pkg/test" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/pkg/clients/xsql" provErrors "github.com/crossplane-contrib/provider-sql/pkg/controller/namespaced/errors" @@ -67,10 +65,10 @@ func (m mockDB) Query(ctx context.Context, q xsql.Query) (*sql.Rows, error) { } func (m mockDB) GetConnectionDetails(username, password string) managed.ConnectionDetails { return managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte(username), - xpv1.ResourceCredentialsSecretPasswordKey: []byte(password), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("3306"), + xpv2.CredentialsSecretUserKey: []byte(username), + xpv2.CredentialsSecretPasswordKey: []byte(password), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("3306"), } } func (m mockDB) GetServerVersion(ctx context.Context) (int, error) { @@ -134,7 +132,7 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.User{ Spec: v1alpha1.UserSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{Kind: "InvalidKind"}, + ProviderConfigReference: &xpv2.ProviderConfigReference{Kind: "InvalidKind"}, }, }, }, @@ -158,7 +156,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.UserSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, @@ -182,7 +180,7 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.User{ Spec: v1alpha1.UserSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ClusterProviderConfigKind, Name: "example", }, @@ -212,7 +210,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.UserSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, @@ -231,7 +229,7 @@ func TestConnect(t *testing.T) { MockGet: test.NewMockGetFn(nil, func(obj client.Object) error { switch o := obj.(type) { case *v1alpha1.ProviderConfig: - o.Spec.Credentials.ConnectionSecretRef = common.LocalSecretReference{Name: "example"} + o.Spec.Credentials.ConnectionSecretRef = xpv2.LocalSecretReference{Name: "example"} case *corev1.Secret: return errBoom } @@ -247,7 +245,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.UserSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, @@ -266,7 +264,7 @@ func TestConnect(t *testing.T) { MockGet: test.NewMockGetFn(nil, func(obj client.Object) error { switch o := obj.(type) { case *v1alpha1.ProviderConfig: - o.Spec.Credentials.ConnectionSecretRef = common.LocalSecretReference{Name: "example"} + o.Spec.Credentials.ConnectionSecretRef = xpv2.LocalSecretReference{Name: "example"} case *corev1.Secret: secret := corev1.Secret{ Data: map[string][]byte{}, @@ -286,7 +284,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.UserSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, @@ -309,7 +307,7 @@ func TestConnect(t *testing.T) { MockGet: test.NewMockGetFn(nil, func(obj client.Object) error { switch o := obj.(type) { case *v1alpha1.ProviderConfig: - o.Spec.Credentials.ConnectionSecretRef = common.LocalSecretReference{Name: "example"} + o.Spec.Credentials.ConnectionSecretRef = xpv2.LocalSecretReference{Name: "example"} case *corev1.Secret: secret := corev1.Secret{ Data: map[string][]byte{}, @@ -329,7 +327,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.UserSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, @@ -453,7 +451,7 @@ func TestObserve(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte(key.Name) + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte(key.Name) secret.DeepCopyInto(obj.(*corev1.Secret)) return nil }, @@ -463,15 +461,15 @@ func TestObserve(t *testing.T) { mg: &v1alpha1.User{ Spec: v1alpha1.UserSpec{ ForProvider: v1alpha1.UserParameters{ - PasswordSecretRef: &common.LocalSecretKeySelector{ - LocalSecretReference: common.LocalSecretReference{ + PasswordSecretRef: &xpv2.LocalSecretKeySelector{ + LocalSecretReference: xpv2.LocalSecretReference{ Name: "example", }, Key: "password", }, }, ManagedResourceSpec: xpv2.ManagedResourceSpec{ - WriteConnectionSecretToReference: &common.LocalSecretReference{ + WriteConnectionSecretToReference: &xpv2.LocalSecretReference{ Name: "connection-secret", }, }, @@ -582,10 +580,10 @@ func TestCreate(t *testing.T) { err: nil, c: managed.ExternalCreation{ ConnectionDetails: managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte("example"), - xpv1.ResourceCredentialsSecretPasswordKey: []byte(""), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("3306"), + xpv2.CredentialsSecretUserKey: []byte("example"), + xpv2.CredentialsSecretPasswordKey: []byte(""), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("3306"), }, }, }, @@ -618,10 +616,10 @@ func TestCreate(t *testing.T) { err: nil, c: managed.ExternalCreation{ ConnectionDetails: managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte("example"), - xpv1.ResourceCredentialsSecretPasswordKey: []byte(""), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("3306"), + xpv2.CredentialsSecretUserKey: []byte("example"), + xpv2.CredentialsSecretPasswordKey: []byte(""), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("3306"), }, }, }, @@ -659,8 +657,8 @@ func TestCreate(t *testing.T) { }, Spec: v1alpha1.UserSpec{ ForProvider: v1alpha1.UserParameters{ - PasswordSecretRef: &common.LocalSecretKeySelector{ - LocalSecretReference: common.LocalSecretReference{ + PasswordSecretRef: &xpv2.LocalSecretKeySelector{ + LocalSecretReference: xpv2.LocalSecretReference{ Name: "example", }, Key: "password-custom", @@ -673,10 +671,10 @@ func TestCreate(t *testing.T) { err: nil, c: managed.ExternalCreation{ ConnectionDetails: managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte("example"), - xpv1.ResourceCredentialsSecretPasswordKey: []byte("test1234"), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("3306"), + xpv2.CredentialsSecretUserKey: []byte("example"), + xpv2.CredentialsSecretPasswordKey: []byte("test1234"), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("3306"), }, }, }, @@ -740,15 +738,15 @@ func TestUpdate(t *testing.T) { mg: &v1alpha1.User{ Spec: v1alpha1.UserSpec{ ForProvider: v1alpha1.UserParameters{ - PasswordSecretRef: &common.LocalSecretKeySelector{ - LocalSecretReference: common.LocalSecretReference{ + PasswordSecretRef: &xpv2.LocalSecretKeySelector{ + LocalSecretReference: xpv2.LocalSecretReference{ Name: "connection-secret", }, - Key: xpv1.ResourceCredentialsSecretPasswordKey, + Key: xpv2.CredentialsSecretPasswordKey, }, }, ManagedResourceSpec: xpv2.ManagedResourceSpec{ - WriteConnectionSecretToReference: &common.LocalSecretReference{ + WriteConnectionSecretToReference: &xpv2.LocalSecretReference{ Name: "password-secret", }, }, @@ -759,7 +757,7 @@ func TestUpdate(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte(key.Name) + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte(key.Name) secret.DeepCopyInto(obj.(*corev1.Secret)) return nil }, @@ -799,15 +797,15 @@ func TestUpdate(t *testing.T) { mg: &v1alpha1.User{ Spec: v1alpha1.UserSpec{ ForProvider: v1alpha1.UserParameters{ - PasswordSecretRef: &common.LocalSecretKeySelector{ - LocalSecretReference: common.LocalSecretReference{ + PasswordSecretRef: &xpv2.LocalSecretKeySelector{ + LocalSecretReference: xpv2.LocalSecretReference{ Name: "connection-secret", }, - Key: xpv1.ResourceCredentialsSecretPasswordKey, + Key: xpv2.CredentialsSecretPasswordKey, }, }, ManagedResourceSpec: xpv2.ManagedResourceSpec{ - WriteConnectionSecretToReference: &common.LocalSecretReference{ + WriteConnectionSecretToReference: &xpv2.LocalSecretReference{ Name: "connection-secret", }, }, @@ -818,7 +816,7 @@ func TestUpdate(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte("samesame") + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte("samesame") secret.DeepCopyInto(obj.(*corev1.Secret)) return nil }, @@ -842,15 +840,15 @@ func TestUpdate(t *testing.T) { }, Spec: v1alpha1.UserSpec{ ForProvider: v1alpha1.UserParameters{ - PasswordSecretRef: &common.LocalSecretKeySelector{ - LocalSecretReference: common.LocalSecretReference{ + PasswordSecretRef: &xpv2.LocalSecretKeySelector{ + LocalSecretReference: xpv2.LocalSecretReference{ Name: "example", }, Key: "password-custom", }, }, ManagedResourceSpec: xpv2.ManagedResourceSpec{ - WriteConnectionSecretToReference: &common.LocalSecretReference{ + WriteConnectionSecretToReference: &xpv2.LocalSecretReference{ Name: "connection-secret", }, }, @@ -870,7 +868,7 @@ func TestUpdate(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte("oldpassword") + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte("oldpassword") secret.DeepCopyInto(obj.(*corev1.Secret)) return nil default: @@ -883,10 +881,10 @@ func TestUpdate(t *testing.T) { err: nil, c: managed.ExternalUpdate{ ConnectionDetails: managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte("example"), - xpv1.ResourceCredentialsSecretPasswordKey: []byte("newpassword"), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("3306"), + xpv2.CredentialsSecretUserKey: []byte("example"), + xpv2.CredentialsSecretPasswordKey: []byte("newpassword"), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("3306"), }, }, }, diff --git a/pkg/controller/namespaced/mssql/user/utils.go b/pkg/controller/namespaced/mssql/user/utils.go index 53d53dd9..a17b7b42 100644 --- a/pkg/controller/namespaced/mssql/user/utils.go +++ b/pkg/controller/namespaced/mssql/user/utils.go @@ -24,8 +24,8 @@ import ( "github.com/pkg/errors" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/apis/namespaced/mssql/v1alpha1" ) @@ -60,7 +60,7 @@ func (c *external) getPassword(ctx context.Context, user *v1alpha1.User) (newPwd } // if newPwd was set to some value, compare value in output secret with // newPwd - changed = newPwd != "" && newPwd != string(s.Data[xpv1.ResourceCredentialsSecretPasswordKey]) + changed = newPwd != "" && newPwd != string(s.Data[xpv2.CredentialsSecretPasswordKey]) return newPwd, changed, nil } diff --git a/pkg/controller/namespaced/mysql/database/reconciler.go b/pkg/controller/namespaced/mysql/database/reconciler.go index 55d94991..5d356023 100644 --- a/pkg/controller/namespaced/mysql/database/reconciler.go +++ b/pkg/controller/namespaced/mysql/database/reconciler.go @@ -25,13 +25,13 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" xpcontroller "github.com/crossplane/crossplane-runtime/v2/pkg/controller" "github.com/crossplane/crossplane-runtime/v2/pkg/event" "github.com/crossplane/crossplane-runtime/v2/pkg/feature" "github.com/crossplane/crossplane-runtime/v2/pkg/meta" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" namespacedv1alpha1 "github.com/crossplane-contrib/provider-sql/apis/namespaced/mysql/v1alpha1" "github.com/crossplane-contrib/provider-sql/pkg/clients/mysql" @@ -151,7 +151,7 @@ func (c *external) Observe(ctx context.Context, mg *namespacedv1alpha1.Database) lateInitialized = true } - mg.SetConditions(xpv1.Available()) + mg.SetConditions(xpv2.Available()) return managed.ExternalObservation{ ResourceExists: true, diff --git a/pkg/controller/namespaced/mysql/database/reconciler_test.go b/pkg/controller/namespaced/mysql/database/reconciler_test.go index 8d0abd2c..dd4d3acf 100644 --- a/pkg/controller/namespaced/mysql/database/reconciler_test.go +++ b/pkg/controller/namespaced/mysql/database/reconciler_test.go @@ -28,11 +28,10 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/crossplane/crossplane-runtime/v2/apis/common" - xpv2 "github.com/crossplane/crossplane-runtime/v2/apis/common/v2" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" "github.com/crossplane/crossplane-runtime/v2/pkg/test" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/pkg/clients/xsql" provErrors "github.com/crossplane-contrib/provider-sql/pkg/controller/namespaced/errors" @@ -104,7 +103,7 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.Database{ Spec: v1alpha1.DatabaseSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{Kind: "NotValid"}, + ProviderConfigReference: &xpv2.ProviderConfigReference{Kind: "NotValid"}, }, }, }, @@ -126,7 +125,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.DatabaseSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, @@ -148,7 +147,7 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.Database{ Spec: v1alpha1.DatabaseSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ClusterProviderConfigKind, Name: "example", }, @@ -173,7 +172,7 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.Database{ Spec: v1alpha1.DatabaseSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{Kind: v1alpha1.ProviderConfigKind}, + ProviderConfigReference: &xpv2.ProviderConfigReference{Kind: v1alpha1.ProviderConfigKind}, }, }, }, @@ -187,7 +186,7 @@ func TestConnect(t *testing.T) { MockGet: test.NewMockGetFn(nil, func(obj client.Object) error { switch o := obj.(type) { case *v1alpha1.ProviderConfig: - o.Spec.Credentials.ConnectionSecretRef = common.LocalSecretReference{Name: "example"} + o.Spec.Credentials.ConnectionSecretRef = xpv2.LocalSecretReference{Name: "example"} case *corev1.Secret: return errBoom } @@ -203,7 +202,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.DatabaseSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{Kind: v1alpha1.ProviderConfigKind}, + ProviderConfigReference: &xpv2.ProviderConfigReference{Kind: v1alpha1.ProviderConfigKind}, }, }, }, diff --git a/pkg/controller/namespaced/mysql/grant/reconciler.go b/pkg/controller/namespaced/mysql/grant/reconciler.go index fd431e85..38f892c2 100644 --- a/pkg/controller/namespaced/mysql/grant/reconciler.go +++ b/pkg/controller/namespaced/mysql/grant/reconciler.go @@ -30,12 +30,12 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" xpcontroller "github.com/crossplane/crossplane-runtime/v2/pkg/controller" "github.com/crossplane/crossplane-runtime/v2/pkg/event" "github.com/crossplane/crossplane-runtime/v2/pkg/feature" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" namespacedv1alpha1 "github.com/crossplane-contrib/provider-sql/apis/namespaced/mysql/v1alpha1" "github.com/crossplane-contrib/provider-sql/pkg/clients/mysql" @@ -146,7 +146,7 @@ func (c *external) Observe(ctx context.Context, mg *namespacedv1alpha1.Grant) (m desiredPrivileges := mg.Spec.ForProvider.Privileges.ToStringSlice() toGrant, toRevoke := diffPermissions(desiredPrivileges, observedPrivileges) - mg.SetConditions(xpv1.Available()) + mg.SetConditions(xpv2.Available()) return managed.ExternalObservation{ ResourceExists: true, diff --git a/pkg/controller/namespaced/mysql/grant/reconciler_test.go b/pkg/controller/namespaced/mysql/grant/reconciler_test.go index 41fb1802..774cb182 100644 --- a/pkg/controller/namespaced/mysql/grant/reconciler_test.go +++ b/pkg/controller/namespaced/mysql/grant/reconciler_test.go @@ -32,11 +32,10 @@ import ( "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/crossplane/crossplane-runtime/v2/apis/common" - xpv2 "github.com/crossplane/crossplane-runtime/v2/apis/common/v2" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" "github.com/crossplane/crossplane-runtime/v2/pkg/test" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/pkg/clients/xsql" provErrors "github.com/crossplane-contrib/provider-sql/pkg/controller/namespaced/errors" @@ -113,7 +112,7 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.Grant{ Spec: v1alpha1.GrantSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{Kind: "NotValid"}, + ProviderConfigReference: &xpv2.ProviderConfigReference{Kind: "NotValid"}, }, }, }, @@ -132,7 +131,7 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.Grant{ Spec: v1alpha1.GrantSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, @@ -154,7 +153,7 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.Grant{ Spec: v1alpha1.GrantSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ClusterProviderConfigKind, Name: "example", }, @@ -179,7 +178,7 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.Grant{ Spec: v1alpha1.GrantSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ClusterProviderConfigKind, Name: "example", }, @@ -196,7 +195,7 @@ func TestConnect(t *testing.T) { MockGet: test.NewMockGetFn(nil, func(obj client.Object) error { switch o := obj.(type) { case *v1alpha1.ClusterProviderConfig: - o.Spec.Credentials.ConnectionSecretRef = common.SecretReference{ + o.Spec.Credentials.ConnectionSecretRef = xpv2.SecretReference{ Name: "example", Namespace: "default", } @@ -212,7 +211,7 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.Grant{ Spec: v1alpha1.GrantSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ClusterProviderConfigKind, Name: "example", }, diff --git a/pkg/controller/namespaced/mysql/tls/tls.go b/pkg/controller/namespaced/mysql/tls/tls.go index 0bdb1531..2daa7120 100644 --- a/pkg/controller/namespaced/mysql/tls/tls.go +++ b/pkg/controller/namespaced/mysql/tls/tls.go @@ -7,7 +7,7 @@ import ( "fmt" namespacedv1alpha1 "github.com/crossplane-contrib/provider-sql/apis/namespaced/mysql/v1alpha1" - "github.com/crossplane/crossplane-runtime/v2/apis/common" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/go-sql-driver/mysql" "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" @@ -102,7 +102,7 @@ func getClientKeyPair(ctx context.Context, kube client.Client, cfg *namespacedv1 return keyPair, nil } -func getSecret(ctx context.Context, kube client.Client, sel common.SecretKeySelector) ([]byte, error) { +func getSecret(ctx context.Context, kube client.Client, sel xpv2.SecretKeySelector) ([]byte, error) { secret := &corev1.Secret{} if err := kube.Get(ctx, types.NamespacedName{ Namespace: sel.Namespace, diff --git a/pkg/controller/namespaced/mysql/user/reconciler.go b/pkg/controller/namespaced/mysql/user/reconciler.go index 07fc1c57..0ebdc073 100644 --- a/pkg/controller/namespaced/mysql/user/reconciler.go +++ b/pkg/controller/namespaced/mysql/user/reconciler.go @@ -27,7 +27,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" xpcontroller "github.com/crossplane/crossplane-runtime/v2/pkg/controller" "github.com/crossplane/crossplane-runtime/v2/pkg/event" "github.com/crossplane/crossplane-runtime/v2/pkg/feature" @@ -35,6 +34,7 @@ import ( "github.com/crossplane/crossplane-runtime/v2/pkg/password" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" namespacedv1alpha1 "github.com/crossplane-contrib/provider-sql/apis/namespaced/mysql/v1alpha1" "github.com/crossplane-contrib/provider-sql/pkg/clients/mysql" @@ -249,7 +249,7 @@ func (c *external) Observe(ctx context.Context, mg *namespacedv1alpha1.User) (ma mg.Status.AtProvider.ResourceOptionsAsClauses = resourceOptionsToClauses(observed.ResourceOptions) mg.Status.AtProvider.AuthenticationPlugin = observed.AuthenticationPlugin - mg.SetConditions(xpv1.Available()) + mg.SetConditions(xpv2.Available()) return managed.ExternalObservation{ ResourceExists: true, @@ -295,7 +295,7 @@ func authPluginEqual(observed, desired *namespacedv1alpha1.AuthenticationPlugin) } func (c *external) Create(ctx context.Context, mg *namespacedv1alpha1.User) (managed.ExternalCreation, error) { - mg.SetConditions(xpv1.Creating()) + mg.SetConditions(xpv2.Creating()) username, host := mysql.SplitUserHost(meta.GetExternalName(mg)) ro := resourceOptionsToClauses(mg.Spec.ForProvider.ResourceOptions) @@ -522,7 +522,7 @@ func (c *external) Disconnect(ctx context.Context) error { } func (c *external) Delete(ctx context.Context, mg *namespacedv1alpha1.User) (managed.ExternalDelete, error) { - mg.SetConditions(xpv1.Deleting()) + mg.SetConditions(xpv2.Deleting()) username, host := mysql.SplitUserHost(meta.GetExternalName(mg)) diff --git a/pkg/controller/namespaced/mysql/user/reconciler_test.go b/pkg/controller/namespaced/mysql/user/reconciler_test.go index 5f9ce7d6..772f481c 100644 --- a/pkg/controller/namespaced/mysql/user/reconciler_test.go +++ b/pkg/controller/namespaced/mysql/user/reconciler_test.go @@ -30,13 +30,11 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/crossplane/crossplane-runtime/v2/apis/common" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" - xpv2 "github.com/crossplane/crossplane-runtime/v2/apis/common/v2" "github.com/crossplane/crossplane-runtime/v2/pkg/meta" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" "github.com/crossplane/crossplane-runtime/v2/pkg/test" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/pkg/clients/xsql" provErrors "github.com/crossplane-contrib/provider-sql/pkg/controller/namespaced/errors" @@ -63,10 +61,10 @@ func (m mockDB) Query(ctx context.Context, q xsql.Query) (*sql.Rows, error) { } func (m mockDB) GetConnectionDetails(username, password string) managed.ConnectionDetails { return managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte(username), - xpv1.ResourceCredentialsSecretPasswordKey: []byte(password), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("3306"), + xpv2.CredentialsSecretUserKey: []byte(username), + xpv2.CredentialsSecretPasswordKey: []byte(password), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("3306"), } } func (m mockDB) GetServerVersion(ctx context.Context) (int, error) { @@ -114,7 +112,7 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.User{ Spec: v1alpha1.UserSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{Kind: "NotValid"}, + ProviderConfigReference: &xpv2.ProviderConfigReference{Kind: "NotValid"}, }, }, }, @@ -136,7 +134,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.UserSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{Kind: v1alpha1.ProviderConfigKind}, + ProviderConfigReference: &xpv2.ProviderConfigReference{Kind: v1alpha1.ProviderConfigKind}, }, }, }, @@ -158,7 +156,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.UserSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{Kind: v1alpha1.ClusterProviderConfigKind}, + ProviderConfigReference: &xpv2.ProviderConfigReference{Kind: v1alpha1.ClusterProviderConfigKind}, }, }, }, @@ -183,7 +181,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.UserSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, @@ -200,7 +198,7 @@ func TestConnect(t *testing.T) { MockGet: test.NewMockGetFn(nil, func(obj client.Object) error { switch o := obj.(type) { case *v1alpha1.ProviderConfig: - o.Spec.Credentials.ConnectionSecretRef = common.LocalSecretReference{Name: "example"} + o.Spec.Credentials.ConnectionSecretRef = xpv2.LocalSecretReference{Name: "example"} case *corev1.Secret: return errBoom } @@ -214,7 +212,7 @@ func TestConnect(t *testing.T) { ObjectMeta: metav1.ObjectMeta{Namespace: "default"}, Spec: v1alpha1.UserSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, @@ -326,7 +324,7 @@ func TestObserve(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte(key.Name) + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte(key.Name) secret.DeepCopyInto(obj.(*corev1.Secret)) return nil }, @@ -336,15 +334,15 @@ func TestObserve(t *testing.T) { mg: &v1alpha1.User{ Spec: v1alpha1.UserSpec{ ForProvider: v1alpha1.UserParameters{ - PasswordSecretRef: &common.LocalSecretKeySelector{ - LocalSecretReference: common.LocalSecretReference{ + PasswordSecretRef: &xpv2.LocalSecretKeySelector{ + LocalSecretReference: xpv2.LocalSecretReference{ Name: "example", }, Key: "password", }, }, ManagedResourceSpec: xpv2.ManagedResourceSpec{ - WriteConnectionSecretToReference: &common.LocalSecretReference{ + WriteConnectionSecretToReference: &xpv2.LocalSecretReference{ Name: "connection-secret", }, }, @@ -477,10 +475,10 @@ func TestCreate(t *testing.T) { err: nil, c: managed.ExternalCreation{ ConnectionDetails: managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte("example"), - xpv1.ResourceCredentialsSecretPasswordKey: []byte(""), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("3306"), + xpv2.CredentialsSecretUserKey: []byte("example"), + xpv2.CredentialsSecretPasswordKey: []byte(""), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("3306"), }, }, }, @@ -505,10 +503,10 @@ func TestCreate(t *testing.T) { err: nil, c: managed.ExternalCreation{ ConnectionDetails: managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte("example"), - xpv1.ResourceCredentialsSecretPasswordKey: []byte(""), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("3306"), + xpv2.CredentialsSecretUserKey: []byte("example"), + xpv2.CredentialsSecretPasswordKey: []byte(""), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("3306"), }, }, }, @@ -545,8 +543,8 @@ func TestCreate(t *testing.T) { }, Spec: v1alpha1.UserSpec{ ForProvider: v1alpha1.UserParameters{ - PasswordSecretRef: &common.LocalSecretKeySelector{ - LocalSecretReference: common.LocalSecretReference{ + PasswordSecretRef: &xpv2.LocalSecretKeySelector{ + LocalSecretReference: xpv2.LocalSecretReference{ Name: "example", }, Key: "password-custom", @@ -559,10 +557,10 @@ func TestCreate(t *testing.T) { err: nil, c: managed.ExternalCreation{ ConnectionDetails: managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte("example"), - xpv1.ResourceCredentialsSecretPasswordKey: []byte("test1234"), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("3306"), + xpv2.CredentialsSecretUserKey: []byte("example"), + xpv2.CredentialsSecretPasswordKey: []byte("test1234"), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("3306"), }, }, }, @@ -607,10 +605,10 @@ func TestCreate(t *testing.T) { err: nil, c: managed.ExternalCreation{ ConnectionDetails: managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte("example"), - xpv1.ResourceCredentialsSecretPasswordKey: []byte(""), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("3306"), + xpv2.CredentialsSecretUserKey: []byte("example"), + xpv2.CredentialsSecretPasswordKey: []byte(""), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("3306"), }, }, }, @@ -654,10 +652,10 @@ func TestCreate(t *testing.T) { err: nil, c: managed.ExternalCreation{ ConnectionDetails: managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte("example"), - xpv1.ResourceCredentialsSecretPasswordKey: []byte(""), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("3306"), + xpv2.CredentialsSecretUserKey: []byte("example"), + xpv2.CredentialsSecretPasswordKey: []byte(""), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("3306"), }, }, }, @@ -726,15 +724,15 @@ func TestUpdate(t *testing.T) { mg: &v1alpha1.User{ Spec: v1alpha1.UserSpec{ ForProvider: v1alpha1.UserParameters{ - PasswordSecretRef: &common.LocalSecretKeySelector{ - LocalSecretReference: common.LocalSecretReference{ + PasswordSecretRef: &xpv2.LocalSecretKeySelector{ + LocalSecretReference: xpv2.LocalSecretReference{ Name: "connection-secret", }, - Key: xpv1.ResourceCredentialsSecretPasswordKey, + Key: xpv2.CredentialsSecretPasswordKey, }, }, ManagedResourceSpec: xpv2.ManagedResourceSpec{ - WriteConnectionSecretToReference: &common.LocalSecretReference{ + WriteConnectionSecretToReference: &xpv2.LocalSecretReference{ Name: "password-secret", }, }, @@ -745,7 +743,7 @@ func TestUpdate(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte(key.Name) + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte(key.Name) secret.DeepCopyInto(obj.(*corev1.Secret)) return nil }, @@ -785,15 +783,15 @@ func TestUpdate(t *testing.T) { mg: &v1alpha1.User{ Spec: v1alpha1.UserSpec{ ForProvider: v1alpha1.UserParameters{ - PasswordSecretRef: &common.LocalSecretKeySelector{ - LocalSecretReference: common.LocalSecretReference{ + PasswordSecretRef: &xpv2.LocalSecretKeySelector{ + LocalSecretReference: xpv2.LocalSecretReference{ Name: "connection-secret", }, - Key: xpv1.ResourceCredentialsSecretPasswordKey, + Key: xpv2.CredentialsSecretPasswordKey, }, }, ManagedResourceSpec: xpv2.ManagedResourceSpec{ - WriteConnectionSecretToReference: &common.LocalSecretReference{ + WriteConnectionSecretToReference: &xpv2.LocalSecretReference{ Name: "connection-secret", }, }, @@ -804,7 +802,7 @@ func TestUpdate(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte("samesame") + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte("samesame") secret.DeepCopyInto(obj.(*corev1.Secret)) return nil }, @@ -886,10 +884,10 @@ func TestUpdate(t *testing.T) { want: want{ c: managed.ExternalUpdate{ ConnectionDetails: managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte("example"), - xpv1.ResourceCredentialsSecretPasswordKey: []byte(""), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("3306"), + xpv2.CredentialsSecretUserKey: []byte("example"), + xpv2.CredentialsSecretPasswordKey: []byte(""), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("3306"), }, }, }, @@ -934,10 +932,10 @@ func TestUpdate(t *testing.T) { want: want{ c: managed.ExternalUpdate{ ConnectionDetails: managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte("example"), - xpv1.ResourceCredentialsSecretPasswordKey: []byte(""), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("3306"), + xpv2.CredentialsSecretUserKey: []byte("example"), + xpv2.CredentialsSecretPasswordKey: []byte(""), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("3306"), }, }, }, @@ -958,15 +956,15 @@ func TestUpdate(t *testing.T) { }, Spec: v1alpha1.UserSpec{ ForProvider: v1alpha1.UserParameters{ - PasswordSecretRef: &common.LocalSecretKeySelector{ - LocalSecretReference: common.LocalSecretReference{ + PasswordSecretRef: &xpv2.LocalSecretKeySelector{ + LocalSecretReference: xpv2.LocalSecretReference{ Name: "example", }, Key: "password-custom", }, }, ManagedResourceSpec: xpv2.ManagedResourceSpec{ - WriteConnectionSecretToReference: &common.LocalSecretReference{ + WriteConnectionSecretToReference: &xpv2.LocalSecretReference{ Name: "connection-secret", }, }, @@ -986,7 +984,7 @@ func TestUpdate(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte("oldpassword") + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte("oldpassword") secret.DeepCopyInto(obj.(*corev1.Secret)) return nil default: @@ -999,10 +997,10 @@ func TestUpdate(t *testing.T) { err: nil, c: managed.ExternalUpdate{ ConnectionDetails: managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte("example"), - xpv1.ResourceCredentialsSecretPasswordKey: []byte("newpassword"), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("3306"), + xpv2.CredentialsSecretUserKey: []byte("example"), + xpv2.CredentialsSecretPasswordKey: []byte("newpassword"), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("3306"), }, }, }, @@ -1029,11 +1027,11 @@ func TestUpdate(t *testing.T) { }, Spec: v1alpha1.UserSpec{ ForProvider: v1alpha1.UserParameters{ - PasswordSecretRef: &common.LocalSecretKeySelector{ - LocalSecretReference: common.LocalSecretReference{ + PasswordSecretRef: &xpv2.LocalSecretKeySelector{ + LocalSecretReference: xpv2.LocalSecretReference{ Name: "connection-secret", }, - Key: xpv1.ResourceCredentialsSecretPasswordKey, + Key: xpv2.CredentialsSecretPasswordKey, }, ResourceOptions: &v1alpha1.ResourceOptions{ MaxQueriesPerHour: new(int), @@ -1059,7 +1057,7 @@ func TestUpdate(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte("samesame") + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte("samesame") secret.DeepCopyInto(obj.(*corev1.Secret)) return nil }, diff --git a/pkg/controller/namespaced/mysql/user/utils.go b/pkg/controller/namespaced/mysql/user/utils.go index 2e7335c2..74f13159 100644 --- a/pkg/controller/namespaced/mysql/user/utils.go +++ b/pkg/controller/namespaced/mysql/user/utils.go @@ -24,8 +24,8 @@ import ( "github.com/pkg/errors" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/apis/namespaced/mysql/v1alpha1" ) @@ -60,7 +60,7 @@ func (c *external) getPassword(ctx context.Context, user *v1alpha1.User) (newPwd } // if newPwd was set to some value, compare value in output secret with // newPwd - changed = newPwd != "" && newPwd != string(s.Data[xpv1.ResourceCredentialsSecretPasswordKey]) + changed = newPwd != "" && newPwd != string(s.Data[xpv2.CredentialsSecretPasswordKey]) return newPwd, changed, nil } diff --git a/pkg/controller/namespaced/postgresql/database/reconciler.go b/pkg/controller/namespaced/postgresql/database/reconciler.go index 534a9c63..cb57d912 100644 --- a/pkg/controller/namespaced/postgresql/database/reconciler.go +++ b/pkg/controller/namespaced/postgresql/database/reconciler.go @@ -30,13 +30,13 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" xpcontroller "github.com/crossplane/crossplane-runtime/v2/pkg/controller" "github.com/crossplane/crossplane-runtime/v2/pkg/event" "github.com/crossplane/crossplane-runtime/v2/pkg/feature" "github.com/crossplane/crossplane-runtime/v2/pkg/meta" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" namespacedv1alpha1 "github.com/crossplane-contrib/provider-sql/apis/namespaced/postgresql/v1alpha1" "github.com/crossplane-contrib/provider-sql/pkg/clients" @@ -164,7 +164,7 @@ func (c *external) Observe(ctx context.Context, mg *namespacedv1alpha1.Database) return managed.ExternalObservation{}, errors.Wrap(err, errSelectDB) } - mg.SetConditions(xpv1.Available()) + mg.SetConditions(xpv2.Available()) return managed.ExternalObservation{ ResourceExists: true, diff --git a/pkg/controller/namespaced/postgresql/database/reconciler_test.go b/pkg/controller/namespaced/postgresql/database/reconciler_test.go index b8e632f4..c7dca4b8 100644 --- a/pkg/controller/namespaced/postgresql/database/reconciler_test.go +++ b/pkg/controller/namespaced/postgresql/database/reconciler_test.go @@ -28,11 +28,10 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/crossplane/crossplane-runtime/v2/apis/common" - xpv2 "github.com/crossplane/crossplane-runtime/v2/apis/common/v2" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" "github.com/crossplane/crossplane-runtime/v2/pkg/test" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/pkg/clients/xsql" provErrors "github.com/crossplane-contrib/provider-sql/pkg/controller/namespaced/errors" @@ -112,7 +111,7 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.Database{ Spec: v1alpha1.DatabaseSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{Kind: "Invalid"}, + ProviderConfigReference: &xpv2.ProviderConfigReference{Kind: "Invalid"}, }, }, }, @@ -134,7 +133,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.DatabaseSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, @@ -156,7 +155,7 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.Database{ Spec: v1alpha1.DatabaseSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ClusterProviderConfigKind, Name: "example", }, @@ -184,7 +183,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.DatabaseSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, @@ -201,7 +200,7 @@ func TestConnect(t *testing.T) { MockGet: test.NewMockGetFn(nil, func(obj client.Object) error { switch o := obj.(type) { case *v1alpha1.ProviderConfig: - o.Spec.Credentials.ConnectionSecretRef = common.LocalSecretReference{Name: "example"} + o.Spec.Credentials.ConnectionSecretRef = xpv2.LocalSecretReference{Name: "example"} case *corev1.Secret: return errBoom } @@ -217,7 +216,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.DatabaseSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, diff --git a/pkg/controller/namespaced/postgresql/default_privileges/reconciler.go b/pkg/controller/namespaced/postgresql/default_privileges/reconciler.go index cbe5026d..637fb72b 100644 --- a/pkg/controller/namespaced/postgresql/default_privileges/reconciler.go +++ b/pkg/controller/namespaced/postgresql/default_privileges/reconciler.go @@ -29,12 +29,12 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" xpcontroller "github.com/crossplane/crossplane-runtime/v2/pkg/controller" "github.com/crossplane/crossplane-runtime/v2/pkg/event" "github.com/crossplane/crossplane-runtime/v2/pkg/feature" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/apis/namespaced/postgresql/v1alpha1" "github.com/crossplane-contrib/provider-sql/pkg/clients" @@ -279,7 +279,7 @@ func (c *external) Observe(ctx context.Context, mg *v1alpha1.DefaultPrivileges) return managed.ExternalObservation{ResourceExists: false}, nil } - mg.SetConditions(xpv1.Available()) + mg.SetConditions(xpv2.Available()) resourceMatches := matchingGrants(defaultPrivileges, gp.Privileges.ToStringSlice()) return managed.ExternalObservation{ @@ -295,7 +295,7 @@ func (c *external) Observe(ctx context.Context, mg *v1alpha1.DefaultPrivileges) func (c *external) Create(ctx context.Context, mg *v1alpha1.DefaultPrivileges) (managed.ExternalCreation, error) { - mg.SetConditions(xpv1.Creating()) + mg.SetConditions(xpv2.Creating()) var createQuery xsql.Query createDefaultPrivilegesQuery(mg.Spec.ForProvider, &createQuery) @@ -320,7 +320,7 @@ func (c *external) Update( func (c *external) Delete(ctx context.Context, mg *v1alpha1.DefaultPrivileges) (managed.ExternalDelete, error) { var query xsql.Query - mg.SetConditions(xpv1.Deleting()) + mg.SetConditions(xpv2.Deleting()) deleteDefaultPrivilegesQuery(mg.Spec.ForProvider, &query) diff --git a/pkg/controller/namespaced/postgresql/default_privileges/reconciler_test.go b/pkg/controller/namespaced/postgresql/default_privileges/reconciler_test.go index 1287908d..f5ee9885 100644 --- a/pkg/controller/namespaced/postgresql/default_privileges/reconciler_test.go +++ b/pkg/controller/namespaced/postgresql/default_privileges/reconciler_test.go @@ -32,12 +32,10 @@ import ( "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/crossplane/crossplane-runtime/v2/apis/common" - xpv2 "github.com/crossplane/crossplane-runtime/v2/apis/common/v2" - "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" "github.com/crossplane/crossplane-runtime/v2/pkg/test" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/pkg/clients/xsql" provErrors "github.com/crossplane-contrib/provider-sql/pkg/controller/namespaced/errors" @@ -118,7 +116,7 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.DefaultPrivileges{ Spec: v1alpha1.DefaultPrivilegesSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{Kind: "Invalid"}, + ProviderConfigReference: &xpv2.ProviderConfigReference{Kind: "Invalid"}, }, }, }, @@ -140,7 +138,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.DefaultPrivilegesSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, @@ -168,7 +166,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.DefaultPrivilegesSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, @@ -185,7 +183,7 @@ func TestConnect(t *testing.T) { MockGet: test.NewMockGetFn(nil, func(obj client.Object) error { switch o := obj.(type) { case *v1alpha1.ProviderConfig: - o.Spec.Credentials.ConnectionSecretRef = common.LocalSecretReference{Name: "example"} + o.Spec.Credentials.ConnectionSecretRef = xpv2.LocalSecretReference{Name: "example"} case *corev1.Secret: return errBoom } @@ -201,7 +199,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.DefaultPrivilegesSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, @@ -247,7 +245,7 @@ func TestConnectDatabaseSelection(t *testing.T) { }, Spec: v1alpha1.DefaultPrivilegesSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, @@ -269,7 +267,7 @@ func TestConnectDatabaseSelection(t *testing.T) { }, Spec: v1alpha1.DefaultPrivilegesSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, @@ -291,7 +289,7 @@ func TestConnectDatabaseSelection(t *testing.T) { switch o := obj.(type) { case *v1alpha1.ProviderConfig: o.Spec.DefaultDatabase = "default-db" - o.Spec.Credentials.ConnectionSecretRef = common.LocalSecretReference{Name: "secret"} + o.Spec.Credentials.ConnectionSecretRef = xpv2.LocalSecretReference{Name: "secret"} case *corev1.Secret: // Return empty secret data } diff --git a/pkg/controller/namespaced/postgresql/extension/reconciler.go b/pkg/controller/namespaced/postgresql/extension/reconciler.go index 3cee5076..ab4cffec 100644 --- a/pkg/controller/namespaced/postgresql/extension/reconciler.go +++ b/pkg/controller/namespaced/postgresql/extension/reconciler.go @@ -27,12 +27,12 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" xpcontroller "github.com/crossplane/crossplane-runtime/v2/pkg/controller" "github.com/crossplane/crossplane-runtime/v2/pkg/event" "github.com/crossplane/crossplane-runtime/v2/pkg/feature" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" namespacedv1alpha1 "github.com/crossplane-contrib/provider-sql/apis/namespaced/postgresql/v1alpha1" "github.com/crossplane-contrib/provider-sql/pkg/clients" @@ -145,7 +145,7 @@ func (c *external) Observe(ctx context.Context, mg *namespacedv1alpha1.Extension return managed.ExternalObservation{}, errors.Wrap(err, errSelectExtension) } - mg.SetConditions(xpv1.Available()) + mg.SetConditions(xpv2.Available()) return managed.ExternalObservation{ ResourceExists: true, diff --git a/pkg/controller/namespaced/postgresql/extension/reconciler_test.go b/pkg/controller/namespaced/postgresql/extension/reconciler_test.go index 05f3c2c5..321889ac 100644 --- a/pkg/controller/namespaced/postgresql/extension/reconciler_test.go +++ b/pkg/controller/namespaced/postgresql/extension/reconciler_test.go @@ -28,11 +28,10 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/crossplane/crossplane-runtime/v2/apis/common" - xpv2 "github.com/crossplane/crossplane-runtime/v2/apis/common/v2" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" "github.com/crossplane/crossplane-runtime/v2/pkg/test" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/pkg/clients/xsql" provErrors "github.com/crossplane-contrib/provider-sql/pkg/controller/namespaced/errors" @@ -108,7 +107,7 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.Extension{ Spec: v1alpha1.ExtensionSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{Kind: "Invalid"}, + ProviderConfigReference: &xpv2.ProviderConfigReference{Kind: "Invalid"}, }, }, }, @@ -130,7 +129,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.ExtensionSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, @@ -152,7 +151,7 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.Extension{ Spec: v1alpha1.ExtensionSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ClusterProviderConfigKind, Name: "example", }, @@ -180,7 +179,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.ExtensionSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, @@ -197,7 +196,7 @@ func TestConnect(t *testing.T) { MockGet: test.NewMockGetFn(nil, func(obj client.Object) error { switch o := obj.(type) { case *v1alpha1.ProviderConfig: - o.Spec.Credentials.ConnectionSecretRef = common.LocalSecretReference{Name: "example"} + o.Spec.Credentials.ConnectionSecretRef = xpv2.LocalSecretReference{Name: "example"} case *corev1.Secret: return errBoom } @@ -213,7 +212,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.ExtensionSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, diff --git a/pkg/controller/namespaced/postgresql/grant/connect_test.go b/pkg/controller/namespaced/postgresql/grant/connect_test.go index 9a24000a..6dc66297 100644 --- a/pkg/controller/namespaced/postgresql/grant/connect_test.go +++ b/pkg/controller/namespaced/postgresql/grant/connect_test.go @@ -25,11 +25,10 @@ import ( "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/crossplane/crossplane-runtime/v2/apis/common" - xpv2 "github.com/crossplane/crossplane-runtime/v2/apis/common/v2" "github.com/crossplane/crossplane-runtime/v2/pkg/logging" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" "github.com/crossplane/crossplane-runtime/v2/pkg/test" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/apis/namespaced/postgresql/v1alpha1" "github.com/crossplane-contrib/provider-sql/pkg/clients/xsql" @@ -41,7 +40,7 @@ func kubeWithSecret(defaultDB string) client.Client { return &test.MockClient{ MockGet: test.NewMockGetFn(nil, func(obj client.Object) error { if o, ok := obj.(*v1alpha1.ProviderConfig); ok { - o.Spec.Credentials.ConnectionSecretRef = common.LocalSecretReference{Name: "example"} + o.Spec.Credentials.ConnectionSecretRef = xpv2.LocalSecretReference{Name: "example"} o.Spec.DefaultDatabase = defaultDB } return nil @@ -56,7 +55,7 @@ func databaseGrant(db string) *v1alpha1.Grant { }, Spec: v1alpha1.GrantSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, diff --git a/pkg/controller/namespaced/postgresql/grant/reconciler.go b/pkg/controller/namespaced/postgresql/grant/reconciler.go index be51c940..39e01cfc 100644 --- a/pkg/controller/namespaced/postgresql/grant/reconciler.go +++ b/pkg/controller/namespaced/postgresql/grant/reconciler.go @@ -28,7 +28,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" xpcontroller "github.com/crossplane/crossplane-runtime/v2/pkg/controller" "github.com/crossplane/crossplane-runtime/v2/pkg/event" "github.com/crossplane/crossplane-runtime/v2/pkg/feature" @@ -36,6 +35,7 @@ import ( "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/reference" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/apis/namespaced/postgresql/v1alpha1" "github.com/crossplane-contrib/provider-sql/pkg/clients" @@ -170,7 +170,7 @@ func (c *external) Create(ctx context.Context, mg *v1alpha1.Grant) (managed.Exte var queries []xsql.Query - mg.SetConditions(xpv1.Creating()) + mg.SetConditions(xpv2.Creating()) if err := createGrantQueriesWithVersion(mg.Spec.ForProvider, &queries, c.serverVersion); err != nil { return managed.ExternalCreation{}, errors.Wrap(err, errCreateGrant) @@ -453,7 +453,7 @@ func (c *external) Delete(ctx context.Context, mg *v1alpha1.Grant) (managed.Exte var query xsql.Query - mg.SetConditions(xpv1.Deleting()) + mg.SetConditions(xpv2.Deleting()) err := deleteGrantQuery(mg.Spec.ForProvider, &query) if err != nil { @@ -570,7 +570,7 @@ func (c *external) Observe(ctx context.Context, mg *v1alpha1.Grant) (managed.Ext } // Grants have no way of being 'not up to date' - if they exist, they are up to date - mg.SetConditions(xpv1.Available()) + mg.SetConditions(xpv2.Available()) return managed.ExternalObservation{ ResourceExists: true, diff --git a/pkg/controller/namespaced/postgresql/grant/reconciler_test.go b/pkg/controller/namespaced/postgresql/grant/reconciler_test.go index 5649ba3d..127a4bc8 100644 --- a/pkg/controller/namespaced/postgresql/grant/reconciler_test.go +++ b/pkg/controller/namespaced/postgresql/grant/reconciler_test.go @@ -34,12 +34,11 @@ import ( "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/crossplane/crossplane-runtime/v2/apis/common" - xpv2 "github.com/crossplane/crossplane-runtime/v2/apis/common/v2" "github.com/crossplane/crossplane-runtime/v2/pkg/logging" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" "github.com/crossplane/crossplane-runtime/v2/pkg/test" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/pkg/clients/xsql" provErrors "github.com/crossplane-contrib/provider-sql/pkg/controller/namespaced/errors" @@ -121,7 +120,7 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.Grant{ Spec: v1alpha1.GrantSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{Kind: "Invalid"}, + ProviderConfigReference: &xpv2.ProviderConfigReference{Kind: "Invalid"}, }, }, }, @@ -143,7 +142,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.GrantSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, @@ -165,7 +164,7 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.Grant{ Spec: v1alpha1.GrantSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ClusterProviderConfigKind, Name: "example", }, @@ -193,7 +192,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.GrantSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, @@ -210,7 +209,7 @@ func TestConnect(t *testing.T) { MockGet: test.NewMockGetFn(nil, func(obj client.Object) error { switch o := obj.(type) { case *v1alpha1.ProviderConfig: - o.Spec.Credentials.ConnectionSecretRef = common.LocalSecretReference{Name: "example"} + o.Spec.Credentials.ConnectionSecretRef = xpv2.LocalSecretReference{Name: "example"} case *corev1.Secret: return errBoom } @@ -226,7 +225,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.GrantSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, diff --git a/pkg/controller/namespaced/postgresql/role/reconciler.go b/pkg/controller/namespaced/postgresql/role/reconciler.go index 54c4377e..41990982 100644 --- a/pkg/controller/namespaced/postgresql/role/reconciler.go +++ b/pkg/controller/namespaced/postgresql/role/reconciler.go @@ -32,7 +32,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" xpcontroller "github.com/crossplane/crossplane-runtime/v2/pkg/controller" "github.com/crossplane/crossplane-runtime/v2/pkg/event" "github.com/crossplane/crossplane-runtime/v2/pkg/feature" @@ -40,6 +39,7 @@ import ( "github.com/crossplane/crossplane-runtime/v2/pkg/password" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" namespacedv1alpha1 "github.com/crossplane-contrib/provider-sql/apis/namespaced/postgresql/v1alpha1" "github.com/crossplane-contrib/provider-sql/pkg/clients" @@ -250,7 +250,7 @@ func (c *external) Observe(ctx context.Context, mg *namespacedv1alpha1.Role) (ma return managed.ExternalObservation{}, err } - mg.SetConditions(xpv1.Available()) + mg.SetConditions(xpv2.Available()) // PrivilegesAsClauses is used as role status output mg.Status.AtProvider.PrivilegesAsClauses = privilegesToClauses(observed.Privileges) @@ -263,7 +263,7 @@ func (c *external) Observe(ctx context.Context, mg *namespacedv1alpha1.Role) (ma } func (c *external) Create(ctx context.Context, mg *namespacedv1alpha1.Role) (managed.ExternalCreation, error) { - mg.SetConditions(xpv1.Creating()) + mg.SetConditions(xpv2.Creating()) crn := pq.QuoteIdentifier(meta.GetExternalName(mg)) privs := privilegesToClauses(mg.Spec.ForProvider.Privileges) @@ -409,7 +409,7 @@ func (c *external) Update(ctx context.Context, mg *namespacedv1alpha1.Role) (man } func (c *external) Delete(ctx context.Context, mg *namespacedv1alpha1.Role) (managed.ExternalDelete, error) { - mg.SetConditions(xpv1.Deleting()) + mg.SetConditions(xpv2.Deleting()) err := c.db.Exec(ctx, xsql.Query{ String: "DROP ROLE IF EXISTS " + pq.QuoteIdentifier(meta.GetExternalName(mg)), }) diff --git a/pkg/controller/namespaced/postgresql/role/reconciler_test.go b/pkg/controller/namespaced/postgresql/role/reconciler_test.go index a3da581e..36769a48 100644 --- a/pkg/controller/namespaced/postgresql/role/reconciler_test.go +++ b/pkg/controller/namespaced/postgresql/role/reconciler_test.go @@ -35,13 +35,11 @@ import ( "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/crossplane/crossplane-runtime/v2/apis/common" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" - xpv2 "github.com/crossplane/crossplane-runtime/v2/apis/common/v2" "github.com/crossplane/crossplane-runtime/v2/pkg/meta" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" "github.com/crossplane/crossplane-runtime/v2/pkg/test" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/pkg/clients/xsql" provErrors "github.com/crossplane-contrib/provider-sql/pkg/controller/namespaced/errors" @@ -72,10 +70,10 @@ func (m mockDB) Query(ctx context.Context, q xsql.Query) (*sql.Rows, error) { func (m mockDB) GetConnectionDetails(rolename, password string) managed.ConnectionDetails { return managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte(rolename), - xpv1.ResourceCredentialsSecretPasswordKey: []byte(password), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("5432"), + xpv2.CredentialsSecretUserKey: []byte(rolename), + xpv2.CredentialsSecretPasswordKey: []byte(password), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("5432"), } } @@ -126,7 +124,7 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.Role{ Spec: v1alpha1.RoleSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{Kind: "Invalid"}, + ProviderConfigReference: &xpv2.ProviderConfigReference{Kind: "Invalid"}, }, }, }, @@ -148,7 +146,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.RoleSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, @@ -170,7 +168,7 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.Role{ Spec: v1alpha1.RoleSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ClusterProviderConfigKind, Name: "example", }, @@ -198,7 +196,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.RoleSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, @@ -215,7 +213,7 @@ func TestConnect(t *testing.T) { MockGet: test.NewMockGetFn(nil, func(obj client.Object) error { switch o := obj.(type) { case *v1alpha1.ProviderConfig: - o.Spec.Credentials.ConnectionSecretRef = common.LocalSecretReference{Name: "example"} + o.Spec.Credentials.ConnectionSecretRef = xpv2.LocalSecretReference{Name: "example"} case *corev1.Secret: return errBoom } @@ -231,7 +229,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.RoleSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, @@ -348,7 +346,7 @@ func TestObserve(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte(key.Name) + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte(key.Name) secret.DeepCopyInto(obj.(*corev1.Secret)) return nil }, @@ -358,8 +356,8 @@ func TestObserve(t *testing.T) { mg: &v1alpha1.Role{ Spec: v1alpha1.RoleSpec{ ForProvider: v1alpha1.RoleParameters{ - PasswordSecretRef: &common.LocalSecretKeySelector{ - LocalSecretReference: common.LocalSecretReference{ + PasswordSecretRef: &xpv2.LocalSecretKeySelector{ + LocalSecretReference: xpv2.LocalSecretReference{ Name: "example", }, Key: "password", @@ -368,7 +366,7 @@ func TestObserve(t *testing.T) { ConnectionLimit: ptr.To(int32(10)), }, ManagedResourceSpec: xpv2.ManagedResourceSpec{ - WriteConnectionSecretToReference: &common.LocalSecretReference{ + WriteConnectionSecretToReference: &xpv2.LocalSecretReference{ Name: "connection-secret", }, }, @@ -511,10 +509,10 @@ func TestCreate(t *testing.T) { err: nil, c: managed.ExternalCreation{ ConnectionDetails: managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte("example"), - xpv1.ResourceCredentialsSecretPasswordKey: []byte(""), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("5432"), + xpv2.CredentialsSecretUserKey: []byte("example"), + xpv2.CredentialsSecretPasswordKey: []byte(""), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("5432"), }, }, }, @@ -551,8 +549,8 @@ func TestCreate(t *testing.T) { }, Spec: v1alpha1.RoleSpec{ ForProvider: v1alpha1.RoleParameters{ - PasswordSecretRef: &common.LocalSecretKeySelector{ - LocalSecretReference: common.LocalSecretReference{ + PasswordSecretRef: &xpv2.LocalSecretKeySelector{ + LocalSecretReference: xpv2.LocalSecretReference{ Name: "example", }, Key: "password-custom", @@ -565,10 +563,10 @@ func TestCreate(t *testing.T) { err: nil, c: managed.ExternalCreation{ ConnectionDetails: managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte("example"), - xpv1.ResourceCredentialsSecretPasswordKey: []byte("test1234"), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("5432"), + xpv2.CredentialsSecretUserKey: []byte("example"), + xpv2.CredentialsSecretPasswordKey: []byte("test1234"), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("5432"), }, }, }, @@ -631,15 +629,15 @@ func TestUpdate(t *testing.T) { mg: &v1alpha1.Role{ Spec: v1alpha1.RoleSpec{ ForProvider: v1alpha1.RoleParameters{ - PasswordSecretRef: &common.LocalSecretKeySelector{ - LocalSecretReference: common.LocalSecretReference{ + PasswordSecretRef: &xpv2.LocalSecretKeySelector{ + LocalSecretReference: xpv2.LocalSecretReference{ Name: "connection-secret", }, - Key: xpv1.ResourceCredentialsSecretPasswordKey, + Key: xpv2.CredentialsSecretPasswordKey, }, }, ManagedResourceSpec: xpv2.ManagedResourceSpec{ - WriteConnectionSecretToReference: &common.LocalSecretReference{ + WriteConnectionSecretToReference: &xpv2.LocalSecretReference{ Name: "password-secret", }, }, @@ -650,7 +648,7 @@ func TestUpdate(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte(key.Name) + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte(key.Name) secret.DeepCopyInto(obj.(*corev1.Secret)) return nil }, @@ -700,15 +698,15 @@ func TestUpdate(t *testing.T) { }, Spec: v1alpha1.RoleSpec{ ForProvider: v1alpha1.RoleParameters{ - PasswordSecretRef: &common.LocalSecretKeySelector{ - LocalSecretReference: common.LocalSecretReference{ + PasswordSecretRef: &xpv2.LocalSecretKeySelector{ + LocalSecretReference: xpv2.LocalSecretReference{ Name: "connection-secret", }, - Key: xpv1.ResourceCredentialsSecretPasswordKey, + Key: xpv2.CredentialsSecretPasswordKey, }, }, ManagedResourceSpec: xpv2.ManagedResourceSpec{ - WriteConnectionSecretToReference: &common.LocalSecretReference{ + WriteConnectionSecretToReference: &xpv2.LocalSecretReference{ Name: "connection-secret", }, }, @@ -719,7 +717,7 @@ func TestUpdate(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte("samesame") + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte("samesame") secret.DeepCopyInto(obj.(*corev1.Secret)) return nil }, @@ -745,15 +743,15 @@ func TestUpdate(t *testing.T) { }, Spec: v1alpha1.RoleSpec{ ForProvider: v1alpha1.RoleParameters{ - PasswordSecretRef: &common.LocalSecretKeySelector{ - LocalSecretReference: common.LocalSecretReference{ + PasswordSecretRef: &xpv2.LocalSecretKeySelector{ + LocalSecretReference: xpv2.LocalSecretReference{ Name: "example", }, Key: "password-custom", }, }, ManagedResourceSpec: xpv2.ManagedResourceSpec{ - WriteConnectionSecretToReference: &common.LocalSecretReference{ + WriteConnectionSecretToReference: &xpv2.LocalSecretReference{ Name: "connection-secret", }, }, @@ -773,7 +771,7 @@ func TestUpdate(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte("oldpassword") + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte("oldpassword") secret.DeepCopyInto(obj.(*corev1.Secret)) return nil default: @@ -786,10 +784,10 @@ func TestUpdate(t *testing.T) { err: nil, c: managed.ExternalUpdate{ ConnectionDetails: managed.ConnectionDetails{ - xpv1.ResourceCredentialsSecretUserKey: []byte("example"), - xpv1.ResourceCredentialsSecretPasswordKey: []byte("newpassword"), - xpv1.ResourceCredentialsSecretEndpointKey: []byte("localhost"), - xpv1.ResourceCredentialsSecretPortKey: []byte("5432"), + xpv2.CredentialsSecretUserKey: []byte("example"), + xpv2.CredentialsSecretPasswordKey: []byte("newpassword"), + xpv2.CredentialsSecretEndpointKey: []byte("localhost"), + xpv2.CredentialsSecretPortKey: []byte("5432"), }, }, }, @@ -818,11 +816,11 @@ func TestUpdate(t *testing.T) { }, Spec: v1alpha1.RoleSpec{ ForProvider: v1alpha1.RoleParameters{ - PasswordSecretRef: &common.LocalSecretKeySelector{ - LocalSecretReference: common.LocalSecretReference{ + PasswordSecretRef: &xpv2.LocalSecretKeySelector{ + LocalSecretReference: xpv2.LocalSecretReference{ Name: "connection-secret", }, - Key: xpv1.ResourceCredentialsSecretPasswordKey, + Key: xpv2.CredentialsSecretPasswordKey, }, Privileges: v1alpha1.RolePrivilege{ Login: ptr.To(true), @@ -844,7 +842,7 @@ func TestUpdate(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte("samesame") + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte("samesame") secret.DeepCopyInto(obj.(*corev1.Secret)) return nil }, @@ -870,11 +868,11 @@ func TestUpdate(t *testing.T) { }, Spec: v1alpha1.RoleSpec{ ForProvider: v1alpha1.RoleParameters{ - PasswordSecretRef: &common.LocalSecretKeySelector{ - LocalSecretReference: common.LocalSecretReference{ + PasswordSecretRef: &xpv2.LocalSecretKeySelector{ + LocalSecretReference: xpv2.LocalSecretReference{ Name: "connection-secret", }, - Key: xpv1.ResourceCredentialsSecretPasswordKey, + Key: xpv2.CredentialsSecretPasswordKey, }, Privileges: v1alpha1.RolePrivilege{ Login: ptr.To(true), @@ -896,7 +894,7 @@ func TestUpdate(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte("samesame") + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte("samesame") secret.DeepCopyInto(obj.(*corev1.Secret)) return nil }, @@ -924,11 +922,11 @@ func TestUpdate(t *testing.T) { }, Spec: v1alpha1.RoleSpec{ ForProvider: v1alpha1.RoleParameters{ - PasswordSecretRef: &common.LocalSecretKeySelector{ - LocalSecretReference: common.LocalSecretReference{ + PasswordSecretRef: &xpv2.LocalSecretKeySelector{ + LocalSecretReference: xpv2.LocalSecretReference{ Name: "connection-secret", }, - Key: xpv1.ResourceCredentialsSecretPasswordKey, + Key: xpv2.CredentialsSecretPasswordKey, }, Privileges: v1alpha1.RolePrivilege{ Login: ptr.To(true), @@ -950,7 +948,7 @@ func TestUpdate(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte("samesame") + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte("samesame") secret.DeepCopyInto(obj.(*corev1.Secret)) return nil }, @@ -991,11 +989,11 @@ func TestUpdate(t *testing.T) { }, Spec: v1alpha1.RoleSpec{ ForProvider: v1alpha1.RoleParameters{ - PasswordSecretRef: &common.LocalSecretKeySelector{ - LocalSecretReference: common.LocalSecretReference{ + PasswordSecretRef: &xpv2.LocalSecretKeySelector{ + LocalSecretReference: xpv2.LocalSecretReference{ Name: "connection-secret", }, - Key: xpv1.ResourceCredentialsSecretPasswordKey, + Key: xpv2.CredentialsSecretPasswordKey, }, ConfigurationParameters: &[]v1alpha1.RoleConfigurationParameter{ { @@ -1029,7 +1027,7 @@ func TestUpdate(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte("samesame") + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte("samesame") secret.DeepCopyInto(obj.(*corev1.Secret)) return nil }, @@ -1057,11 +1055,11 @@ func TestUpdate(t *testing.T) { }, Spec: v1alpha1.RoleSpec{ ForProvider: v1alpha1.RoleParameters{ - PasswordSecretRef: &common.LocalSecretKeySelector{ - LocalSecretReference: common.LocalSecretReference{ + PasswordSecretRef: &xpv2.LocalSecretKeySelector{ + LocalSecretReference: xpv2.LocalSecretReference{ Name: "connection-secret", }, - Key: xpv1.ResourceCredentialsSecretPasswordKey, + Key: xpv2.CredentialsSecretPasswordKey, }, ConfigurationParameters: &[]v1alpha1.RoleConfigurationParameter{ { @@ -1098,7 +1096,7 @@ func TestUpdate(t *testing.T) { secret := corev1.Secret{ Data: map[string][]byte{}, } - secret.Data[xpv1.ResourceCredentialsSecretPasswordKey] = []byte("samesame") + secret.Data[xpv2.CredentialsSecretPasswordKey] = []byte("samesame") secret.DeepCopyInto(obj.(*corev1.Secret)) return nil }, @@ -1163,7 +1161,7 @@ func TestGetPassword(t *testing.T) { PasswordRotationTrigger: &metav1.Time{Time: time.Now()}, }, ManagedResourceSpec: xpv2.ManagedResourceSpec{ - WriteConnectionSecretToReference: &common.LocalSecretReference{ + WriteConnectionSecretToReference: &xpv2.LocalSecretReference{ Name: "test-secret", }, }, @@ -1173,7 +1171,7 @@ func TestGetPassword(t *testing.T) { MockGet: func(_ context.Context, _ client.ObjectKey, obj client.Object) error { secret := corev1.Secret{ Data: map[string][]byte{ - xpv1.ResourceCredentialsSecretPasswordKey: []byte("existing-password"), + xpv2.CredentialsSecretPasswordKey: []byte("existing-password"), }, } secret.DeepCopyInto(obj.(*corev1.Secret)) @@ -1192,7 +1190,7 @@ func TestGetPassword(t *testing.T) { }, Spec: v1alpha1.RoleSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - WriteConnectionSecretToReference: &common.LocalSecretReference{ + WriteConnectionSecretToReference: &xpv2.LocalSecretReference{ Name: "test-secret", }, }, @@ -1213,7 +1211,7 @@ func TestGetPassword(t *testing.T) { }, Spec: v1alpha1.RoleSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - WriteConnectionSecretToReference: &common.LocalSecretReference{ + WriteConnectionSecretToReference: &xpv2.LocalSecretReference{ Name: "test-secret", }, }, @@ -1223,7 +1221,7 @@ func TestGetPassword(t *testing.T) { MockGet: func(_ context.Context, _ client.ObjectKey, obj client.Object) error { secret := corev1.Secret{ Data: map[string][]byte{ - xpv1.ResourceCredentialsSecretPasswordKey: []byte("existing-password"), + xpv2.CredentialsSecretPasswordKey: []byte("existing-password"), }, } secret.DeepCopyInto(obj.(*corev1.Secret)) @@ -1341,7 +1339,7 @@ func TestUpdatePasswordReset(t *testing.T) { }, Spec: v1alpha1.RoleSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - WriteConnectionSecretToReference: &common.LocalSecretReference{ + WriteConnectionSecretToReference: &xpv2.LocalSecretReference{ Name: "test-secret", }, }, @@ -1410,7 +1408,7 @@ func TestUpdatePasswordReset(t *testing.T) { t.Errorf("\n%s\ne.Update(...): ALTER ROLE PASSWORD query contained an empty password\n", tc.reason) } // Verify the returned ConnectionDetails carry a non-empty password. - if pw := got.ConnectionDetails[xpv1.ResourceCredentialsSecretPasswordKey]; len(pw) == 0 { + if pw := got.ConnectionDetails[xpv2.CredentialsSecretPasswordKey]; len(pw) == 0 { t.Errorf("\n%s\ne.Update(...): expected non-empty password in ConnectionDetails\n", tc.reason) } } diff --git a/pkg/controller/namespaced/postgresql/role/utils.go b/pkg/controller/namespaced/postgresql/role/utils.go index 5583b7b6..b24b0837 100644 --- a/pkg/controller/namespaced/postgresql/role/utils.go +++ b/pkg/controller/namespaced/postgresql/role/utils.go @@ -24,8 +24,8 @@ import ( "github.com/pkg/errors" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/apis/namespaced/postgresql/v1alpha1" ) @@ -58,7 +58,7 @@ func (c *external) getPassword(ctx context.Context, role *v1alpha1.Role) (newPwd } // if newPwd was set to some value, compare value in output secret with // newPwd - changed = newPwd != "" && newPwd != string(s.Data[xpv1.ResourceCredentialsSecretPasswordKey]) + changed = newPwd != "" && newPwd != string(s.Data[xpv2.CredentialsSecretPasswordKey]) return newPwd, changed, nil } @@ -96,5 +96,5 @@ func (c *external) shouldResetPassword(ctx context.Context, role *v1alpha1.Role) } return true, nil } - return len(s.Data[xpv1.ResourceCredentialsSecretPasswordKey]) == 0, nil + return len(s.Data[xpv2.CredentialsSecretPasswordKey]) == 0, nil } diff --git a/pkg/controller/namespaced/postgresql/schema/reconciler.go b/pkg/controller/namespaced/postgresql/schema/reconciler.go index 7d27dbfd..53766580 100644 --- a/pkg/controller/namespaced/postgresql/schema/reconciler.go +++ b/pkg/controller/namespaced/postgresql/schema/reconciler.go @@ -28,13 +28,13 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" - xpv1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" xpcontroller "github.com/crossplane/crossplane-runtime/v2/pkg/controller" "github.com/crossplane/crossplane-runtime/v2/pkg/event" "github.com/crossplane/crossplane-runtime/v2/pkg/feature" "github.com/crossplane/crossplane-runtime/v2/pkg/meta" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" namespacedv1alpha1 "github.com/crossplane-contrib/provider-sql/apis/namespaced/postgresql/v1alpha1" "github.com/crossplane-contrib/provider-sql/pkg/clients" @@ -148,7 +148,7 @@ func (c *external) Observe(ctx context.Context, mg *namespacedv1alpha1.Schema) ( return managed.ExternalObservation{}, errors.Wrap(err, errSelectSchema) } - mg.SetConditions(xpv1.Available()) + mg.SetConditions(xpv2.Available()) return managed.ExternalObservation{ ResourceExists: true, @@ -160,7 +160,7 @@ func (c *external) Observe(ctx context.Context, mg *namespacedv1alpha1.Schema) ( func (c *external) Create(ctx context.Context, mg *namespacedv1alpha1.Schema) (managed.ExternalCreation, error) { //nolint:gocyclo var queries []xsql.Query - mg.SetConditions(xpv1.Creating()) + mg.SetConditions(xpv2.Creating()) createSchemaQueries(mg.Spec.ForProvider, &queries, meta.GetExternalName(mg)) diff --git a/pkg/controller/namespaced/postgresql/schema/reconciler_test.go b/pkg/controller/namespaced/postgresql/schema/reconciler_test.go index 42a87d7b..601c3554 100644 --- a/pkg/controller/namespaced/postgresql/schema/reconciler_test.go +++ b/pkg/controller/namespaced/postgresql/schema/reconciler_test.go @@ -30,12 +30,11 @@ import ( "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/crossplane/crossplane-runtime/v2/apis/common" - xpv2 "github.com/crossplane/crossplane-runtime/v2/apis/common/v2" "github.com/crossplane/crossplane-runtime/v2/pkg/meta" "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/v2/pkg/resource" "github.com/crossplane/crossplane-runtime/v2/pkg/test" + xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" "github.com/crossplane-contrib/provider-sql/pkg/clients/xsql" provErrors "github.com/crossplane-contrib/provider-sql/pkg/controller/namespaced/errors" @@ -119,7 +118,7 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.Schema{ Spec: v1alpha1.SchemaSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{Kind: "Invalid"}, + ProviderConfigReference: &xpv2.ProviderConfigReference{Kind: "Invalid"}, }, }, }, @@ -141,7 +140,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.SchemaSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, @@ -163,7 +162,7 @@ func TestConnect(t *testing.T) { mg: &v1alpha1.Schema{ Spec: v1alpha1.SchemaSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ClusterProviderConfigKind, Name: "example", }, @@ -191,7 +190,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.SchemaSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", }, @@ -208,7 +207,7 @@ func TestConnect(t *testing.T) { MockGet: test.NewMockGetFn(nil, func(obj client.Object) error { switch o := obj.(type) { case *v1alpha1.ProviderConfig: - o.Spec.Credentials.ConnectionSecretRef = common.LocalSecretReference{Name: "example"} + o.Spec.Credentials.ConnectionSecretRef = xpv2.LocalSecretReference{Name: "example"} case *corev1.Secret: return errBoom } @@ -224,7 +223,7 @@ func TestConnect(t *testing.T) { }, Spec: v1alpha1.SchemaSpec{ ManagedResourceSpec: xpv2.ManagedResourceSpec{ - ProviderConfigReference: &common.ProviderConfigReference{ + ProviderConfigReference: &xpv2.ProviderConfigReference{ Kind: v1alpha1.ProviderConfigKind, Name: "example", },