From 6be1f8b67f8fe05896eee64e2fd7ced19138f907 Mon Sep 17 00:00:00 2001 From: ISMAIL KABOUBI Date: Sun, 7 Jan 2024 17:07:25 +0100 Subject: [PATCH] feat(registry): adapt container registry dependencies --- ...types.go => zz_containerregistry_types.go} | 115 ++-- ...s.go => zz_containerregistryoidc_types.go} | 56 +- ...s.go => zz_containerregistryuser_types.go} | 57 +- .../v1alpha1/zz_generated.deepcopy.go | 646 +++++++++--------- .../registry/v1alpha1/zz_generated.managed.go | 144 ++-- .../v1alpha1/zz_generated.managedlist.go | 12 +- .../v1alpha1/zz_generated.resolvers.go | 65 ++ .../v1alpha1/zz_generated_terraformed.go | 120 ++-- config/external_name.go | 8 +- config/registry/config.go | 19 + examples/registry/container_registry.yaml | 16 + examples/registry/user.yaml | 16 + .../kube/projectkubeoidc/zz_controller.go | 1 - .../zz_controller.go | 15 +- .../zz_controller.go | 15 +- .../zz_controller.go | 15 +- internal/controller/zz_setup.go | 12 +- ...ry.ovh.edixos.io_containerregistries.yaml} | 33 +- ...ovh.edixos.io_containerregistryoidcs.yaml} | 100 ++- ...ovh.edixos.io_containerregistryusers.yaml} | 101 ++- 20 files changed, 936 insertions(+), 630 deletions(-) rename apis/registry/v1alpha1/{zz_projectcontainerregistry_types.go => zz_containerregistry_types.go} (73%) rename apis/registry/v1alpha1/{zz_projectcontainerregistryoidc_types.go => zz_containerregistryoidc_types.go} (77%) rename apis/registry/v1alpha1/{zz_projectcontainerregistryuser_types.go => zz_containerregistryuser_types.go} (66%) create mode 100644 apis/registry/v1alpha1/zz_generated.resolvers.go create mode 100644 examples/registry/container_registry.yaml create mode 100644 examples/registry/user.yaml rename internal/controller/registry/{projectcontainerregistry => containerregistry}/zz_controller.go (81%) rename internal/controller/registry/{projectcontainerregistryoidc => containerregistryoidc}/zz_controller.go (81%) rename internal/controller/registry/{projectcontainerregistryuser => containerregistryuser}/zz_controller.go (81%) rename package/crds/{registry.ovh.edixos.io_projectcontainerregistries.yaml => registry.ovh.edixos.io_containerregistries.yaml} (93%) rename package/crds/{registry.ovh.edixos.io_projectcontainerregistryoidcs.yaml => registry.ovh.edixos.io_containerregistryoidcs.yaml} (80%) rename package/crds/{registry.ovh.edixos.io_projectcontainerregistryusers.yaml => registry.ovh.edixos.io_containerregistryusers.yaml} (78%) diff --git a/apis/registry/v1alpha1/zz_projectcontainerregistry_types.go b/apis/registry/v1alpha1/zz_containerregistry_types.go similarity index 73% rename from apis/registry/v1alpha1/zz_projectcontainerregistry_types.go rename to apis/registry/v1alpha1/zz_containerregistry_types.go index 98e43bc..cf888bb 100755 --- a/apis/registry/v1alpha1/zz_projectcontainerregistry_types.go +++ b/apis/registry/v1alpha1/zz_containerregistry_types.go @@ -17,40 +17,11 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) -type FeaturesInitParameters struct { -} - -type FeaturesObservation struct { - Vulnerability *bool `json:"vulnerability,omitempty" tf:"vulnerability,omitempty"` -} - -type FeaturesParameters struct { -} - -type PlanInitParameters struct { -} - -type PlanObservation struct { - Code *string `json:"code,omitempty" tf:"code,omitempty"` - - CreatedAt *string `json:"createdAt,omitempty" tf:"created_at,omitempty"` - - Features []FeaturesObservation `json:"features,omitempty" tf:"features,omitempty"` - - ID *string `json:"id,omitempty" tf:"id,omitempty"` +type ContainerRegistryInitParameters struct { + // Registry name Name *string `json:"name,omitempty" tf:"name,omitempty"` - RegistryLimits []RegistryLimitsObservation `json:"registryLimits,omitempty" tf:"registry_limits,omitempty"` - - UpdatedAt *string `json:"updatedAt,omitempty" tf:"updated_at,omitempty"` -} - -type PlanParameters struct { -} - -type ProjectContainerregistryInitParameters struct { - // Plan ID of the registry. PlanID *string `json:"planId,omitempty" tf:"plan_id,omitempty"` @@ -60,13 +31,16 @@ type ProjectContainerregistryInitParameters struct { ServiceName *string `json:"serviceName,omitempty" tf:"service_name,omitempty"` } -type ProjectContainerregistryObservation struct { +type ContainerRegistryObservation struct { // Registry creation date CreatedAt *string `json:"createdAt,omitempty" tf:"created_at,omitempty"` ID *string `json:"id,omitempty" tf:"id,omitempty"` + // Registry name + Name *string `json:"name,omitempty" tf:"name,omitempty"` + // Plan of the registry Plan []PlanObservation `json:"plan,omitempty" tf:"plan,omitempty"` @@ -97,7 +71,11 @@ type ProjectContainerregistryObservation struct { Version *string `json:"version,omitempty" tf:"version,omitempty"` } -type ProjectContainerregistryParameters struct { +type ContainerRegistryParameters struct { + + // Registry name + // +kubebuilder:validation:Optional + Name *string `json:"name,omitempty" tf:"name,omitempty"` // Plan ID of the registry. // +kubebuilder:validation:Optional @@ -111,6 +89,38 @@ type ProjectContainerregistryParameters struct { ServiceName *string `json:"serviceName,omitempty" tf:"service_name,omitempty"` } +type FeaturesInitParameters struct { +} + +type FeaturesObservation struct { + Vulnerability *bool `json:"vulnerability,omitempty" tf:"vulnerability,omitempty"` +} + +type FeaturesParameters struct { +} + +type PlanInitParameters struct { +} + +type PlanObservation struct { + Code *string `json:"code,omitempty" tf:"code,omitempty"` + + CreatedAt *string `json:"createdAt,omitempty" tf:"created_at,omitempty"` + + Features []FeaturesObservation `json:"features,omitempty" tf:"features,omitempty"` + + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + RegistryLimits []RegistryLimitsObservation `json:"registryLimits,omitempty" tf:"registry_limits,omitempty"` + + UpdatedAt *string `json:"updatedAt,omitempty" tf:"updated_at,omitempty"` +} + +type PlanParameters struct { +} + type RegistryLimitsInitParameters struct { } @@ -123,10 +133,10 @@ type RegistryLimitsObservation struct { type RegistryLimitsParameters struct { } -// ProjectContainerregistrySpec defines the desired state of ProjectContainerregistry -type ProjectContainerregistrySpec struct { +// ContainerRegistrySpec defines the desired state of ContainerRegistry +type ContainerRegistrySpec struct { v1.ResourceSpec `json:",inline"` - ForProvider ProjectContainerregistryParameters `json:"forProvider"` + ForProvider ContainerRegistryParameters `json:"forProvider"` // THIS IS A BETA FIELD. It will be honored // unless the Management Policies feature flag is disabled. // InitProvider holds the same fields as ForProvider, with the exception @@ -137,50 +147,51 @@ type ProjectContainerregistrySpec struct { // required on creation, but we do not desire to update them after creation, // for example because of an external controller is managing them, like an // autoscaler. - InitProvider ProjectContainerregistryInitParameters `json:"initProvider,omitempty"` + InitProvider ContainerRegistryInitParameters `json:"initProvider,omitempty"` } -// ProjectContainerregistryStatus defines the observed state of ProjectContainerregistry. -type ProjectContainerregistryStatus struct { +// ContainerRegistryStatus defines the observed state of ContainerRegistry. +type ContainerRegistryStatus struct { v1.ResourceStatus `json:",inline"` - AtProvider ProjectContainerregistryObservation `json:"atProvider,omitempty"` + AtProvider ContainerRegistryObservation `json:"atProvider,omitempty"` } // +kubebuilder:object:root=true -// ProjectContainerregistry is the Schema for the ProjectContainerregistrys API. +// ContainerRegistry is the Schema for the ContainerRegistrys API. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" // +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" // +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" // +kubebuilder:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,ovh} -type ProjectContainerregistry struct { +type ContainerRegistry struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.name) || (has(self.initProvider) && has(self.initProvider.name))",message="spec.forProvider.name is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.region) || (has(self.initProvider) && has(self.initProvider.region))",message="spec.forProvider.region is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.serviceName) || (has(self.initProvider) && has(self.initProvider.serviceName))",message="spec.forProvider.serviceName is a required parameter" - Spec ProjectContainerregistrySpec `json:"spec"` - Status ProjectContainerregistryStatus `json:"status,omitempty"` + Spec ContainerRegistrySpec `json:"spec"` + Status ContainerRegistryStatus `json:"status,omitempty"` } // +kubebuilder:object:root=true -// ProjectContainerregistryList contains a list of ProjectContainerregistrys -type ProjectContainerregistryList struct { +// ContainerRegistryList contains a list of ContainerRegistrys +type ContainerRegistryList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []ProjectContainerregistry `json:"items"` + Items []ContainerRegistry `json:"items"` } // Repository type metadata. var ( - ProjectContainerregistry_Kind = "ProjectContainerregistry" - ProjectContainerregistry_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: ProjectContainerregistry_Kind}.String() - ProjectContainerregistry_KindAPIVersion = ProjectContainerregistry_Kind + "." + CRDGroupVersion.String() - ProjectContainerregistry_GroupVersionKind = CRDGroupVersion.WithKind(ProjectContainerregistry_Kind) + ContainerRegistry_Kind = "ContainerRegistry" + ContainerRegistry_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: ContainerRegistry_Kind}.String() + ContainerRegistry_KindAPIVersion = ContainerRegistry_Kind + "." + CRDGroupVersion.String() + ContainerRegistry_GroupVersionKind = CRDGroupVersion.WithKind(ContainerRegistry_Kind) ) func init() { - SchemeBuilder.Register(&ProjectContainerregistry{}, &ProjectContainerregistryList{}) + SchemeBuilder.Register(&ContainerRegistry{}, &ContainerRegistryList{}) } diff --git a/apis/registry/v1alpha1/zz_projectcontainerregistryoidc_types.go b/apis/registry/v1alpha1/zz_containerregistryoidc_types.go similarity index 77% rename from apis/registry/v1alpha1/zz_projectcontainerregistryoidc_types.go rename to apis/registry/v1alpha1/zz_containerregistryoidc_types.go index 959febc..e3ab789 100755 --- a/apis/registry/v1alpha1/zz_projectcontainerregistryoidc_types.go +++ b/apis/registry/v1alpha1/zz_containerregistryoidc_types.go @@ -17,7 +17,7 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) -type ProjectContainerregistryOidcInitParameters struct { +type ContainerRegistryOIDCInitParameters struct { DeleteUsers *bool `json:"deleteUsers,omitempty" tf:"delete_users,omitempty"` OidcAdminGroup *string `json:"oidcAdminGroup,omitempty" tf:"oidc_admin_group,omitempty"` @@ -38,12 +38,10 @@ type ProjectContainerregistryOidcInitParameters struct { OidcVerifyCert *bool `json:"oidcVerifyCert,omitempty" tf:"oidc_verify_cert,omitempty"` - RegistryID *string `json:"registryId,omitempty" tf:"registry_id,omitempty"` - ServiceName *string `json:"serviceName,omitempty" tf:"service_name,omitempty"` } -type ProjectContainerregistryOidcObservation struct { +type ContainerRegistryOIDCObservation struct { DeleteUsers *bool `json:"deleteUsers,omitempty" tf:"delete_users,omitempty"` ID *string `json:"id,omitempty" tf:"id,omitempty"` @@ -71,7 +69,7 @@ type ProjectContainerregistryOidcObservation struct { ServiceName *string `json:"serviceName,omitempty" tf:"service_name,omitempty"` } -type ProjectContainerregistryOidcParameters struct { +type ContainerRegistryOIDCParameters struct { // +kubebuilder:validation:Optional DeleteUsers *bool `json:"deleteUsers,omitempty" tf:"delete_users,omitempty"` @@ -106,17 +104,26 @@ type ProjectContainerregistryOidcParameters struct { // +kubebuilder:validation:Optional OidcVerifyCert *bool `json:"oidcVerifyCert,omitempty" tf:"oidc_verify_cert,omitempty"` + // +crossplane:generate:reference:type=github.com/edixos/provider-ovh/apis/registry/v1alpha1.ContainerRegistry // +kubebuilder:validation:Optional RegistryID *string `json:"registryId,omitempty" tf:"registry_id,omitempty"` + // Reference to a ContainerRegistry in registry to populate registryId. + // +kubebuilder:validation:Optional + RegistryIDRef *v1.Reference `json:"registryIdRef,omitempty" tf:"-"` + + // Selector for a ContainerRegistry in registry to populate registryId. + // +kubebuilder:validation:Optional + RegistryIDSelector *v1.Selector `json:"registryIdSelector,omitempty" tf:"-"` + // +kubebuilder:validation:Optional ServiceName *string `json:"serviceName,omitempty" tf:"service_name,omitempty"` } -// ProjectContainerregistryOidcSpec defines the desired state of ProjectContainerregistryOidc -type ProjectContainerregistryOidcSpec struct { +// ContainerRegistryOIDCSpec defines the desired state of ContainerRegistryOIDC +type ContainerRegistryOIDCSpec struct { v1.ResourceSpec `json:",inline"` - ForProvider ProjectContainerregistryOidcParameters `json:"forProvider"` + ForProvider ContainerRegistryOIDCParameters `json:"forProvider"` // THIS IS A BETA FIELD. It will be honored // unless the Management Policies feature flag is disabled. // InitProvider holds the same fields as ForProvider, with the exception @@ -127,25 +134,25 @@ type ProjectContainerregistryOidcSpec struct { // required on creation, but we do not desire to update them after creation, // for example because of an external controller is managing them, like an // autoscaler. - InitProvider ProjectContainerregistryOidcInitParameters `json:"initProvider,omitempty"` + InitProvider ContainerRegistryOIDCInitParameters `json:"initProvider,omitempty"` } -// ProjectContainerregistryOidcStatus defines the observed state of ProjectContainerregistryOidc. -type ProjectContainerregistryOidcStatus struct { +// ContainerRegistryOIDCStatus defines the observed state of ContainerRegistryOIDC. +type ContainerRegistryOIDCStatus struct { v1.ResourceStatus `json:",inline"` - AtProvider ProjectContainerregistryOidcObservation `json:"atProvider,omitempty"` + AtProvider ContainerRegistryOIDCObservation `json:"atProvider,omitempty"` } // +kubebuilder:object:root=true -// ProjectContainerregistryOidc is the Schema for the ProjectContainerregistryOidcs API. +// ContainerRegistryOIDC is the Schema for the ContainerRegistryOIDCs API. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" // +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" // +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" // +kubebuilder:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,ovh} -type ProjectContainerregistryOidc struct { +type ContainerRegistryOIDC struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.oidcClientId) || (has(self.initProvider) && has(self.initProvider.oidcClientId))",message="spec.forProvider.oidcClientId is a required parameter" @@ -153,29 +160,28 @@ type ProjectContainerregistryOidc struct { // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.oidcEndpoint) || (has(self.initProvider) && has(self.initProvider.oidcEndpoint))",message="spec.forProvider.oidcEndpoint is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.oidcName) || (has(self.initProvider) && has(self.initProvider.oidcName))",message="spec.forProvider.oidcName is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.oidcScope) || (has(self.initProvider) && has(self.initProvider.oidcScope))",message="spec.forProvider.oidcScope is a required parameter" - // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.registryId) || (has(self.initProvider) && has(self.initProvider.registryId))",message="spec.forProvider.registryId is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.serviceName) || (has(self.initProvider) && has(self.initProvider.serviceName))",message="spec.forProvider.serviceName is a required parameter" - Spec ProjectContainerregistryOidcSpec `json:"spec"` - Status ProjectContainerregistryOidcStatus `json:"status,omitempty"` + Spec ContainerRegistryOIDCSpec `json:"spec"` + Status ContainerRegistryOIDCStatus `json:"status,omitempty"` } // +kubebuilder:object:root=true -// ProjectContainerregistryOidcList contains a list of ProjectContainerregistryOidcs -type ProjectContainerregistryOidcList struct { +// ContainerRegistryOIDCList contains a list of ContainerRegistryOIDCs +type ContainerRegistryOIDCList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []ProjectContainerregistryOidc `json:"items"` + Items []ContainerRegistryOIDC `json:"items"` } // Repository type metadata. var ( - ProjectContainerregistryOidc_Kind = "ProjectContainerregistryOidc" - ProjectContainerregistryOidc_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: ProjectContainerregistryOidc_Kind}.String() - ProjectContainerregistryOidc_KindAPIVersion = ProjectContainerregistryOidc_Kind + "." + CRDGroupVersion.String() - ProjectContainerregistryOidc_GroupVersionKind = CRDGroupVersion.WithKind(ProjectContainerregistryOidc_Kind) + ContainerRegistryOIDC_Kind = "ContainerRegistryOIDC" + ContainerRegistryOIDC_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: ContainerRegistryOIDC_Kind}.String() + ContainerRegistryOIDC_KindAPIVersion = ContainerRegistryOIDC_Kind + "." + CRDGroupVersion.String() + ContainerRegistryOIDC_GroupVersionKind = CRDGroupVersion.WithKind(ContainerRegistryOIDC_Kind) ) func init() { - SchemeBuilder.Register(&ProjectContainerregistryOidc{}, &ProjectContainerregistryOidcList{}) + SchemeBuilder.Register(&ContainerRegistryOIDC{}, &ContainerRegistryOIDCList{}) } diff --git a/apis/registry/v1alpha1/zz_projectcontainerregistryuser_types.go b/apis/registry/v1alpha1/zz_containerregistryuser_types.go similarity index 66% rename from apis/registry/v1alpha1/zz_projectcontainerregistryuser_types.go rename to apis/registry/v1alpha1/zz_containerregistryuser_types.go index e98fdd3..1299a65 100755 --- a/apis/registry/v1alpha1/zz_projectcontainerregistryuser_types.go +++ b/apis/registry/v1alpha1/zz_containerregistryuser_types.go @@ -17,7 +17,7 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) -type ProjectContainerregistryUserInitParameters struct { +type ContainerRegistryUserInitParameters struct { // User email. Email *string `json:"email,omitempty" tf:"email,omitempty"` @@ -25,14 +25,11 @@ type ProjectContainerregistryUserInitParameters struct { // Registry name Login *string `json:"login,omitempty" tf:"login,omitempty"` - // RegistryID - RegistryID *string `json:"registryId,omitempty" tf:"registry_id,omitempty"` - // Service name ServiceName *string `json:"serviceName,omitempty" tf:"service_name,omitempty"` } -type ProjectContainerregistryUserObservation struct { +type ContainerRegistryUserObservation struct { // User email. Email *string `json:"email,omitempty" tf:"email,omitempty"` @@ -52,7 +49,7 @@ type ProjectContainerregistryUserObservation struct { User *string `json:"user,omitempty" tf:"user,omitempty"` } -type ProjectContainerregistryUserParameters struct { +type ContainerRegistryUserParameters struct { // User email. // +kubebuilder:validation:Optional @@ -63,18 +60,27 @@ type ProjectContainerregistryUserParameters struct { Login *string `json:"login,omitempty" tf:"login,omitempty"` // RegistryID + // +crossplane:generate:reference:type=github.com/edixos/provider-ovh/apis/registry/v1alpha1.ContainerRegistry // +kubebuilder:validation:Optional RegistryID *string `json:"registryId,omitempty" tf:"registry_id,omitempty"` + // Reference to a ContainerRegistry in registry to populate registryId. + // +kubebuilder:validation:Optional + RegistryIDRef *v1.Reference `json:"registryIdRef,omitempty" tf:"-"` + + // Selector for a ContainerRegistry in registry to populate registryId. + // +kubebuilder:validation:Optional + RegistryIDSelector *v1.Selector `json:"registryIdSelector,omitempty" tf:"-"` + // Service name // +kubebuilder:validation:Optional ServiceName *string `json:"serviceName,omitempty" tf:"service_name,omitempty"` } -// ProjectContainerregistryUserSpec defines the desired state of ProjectContainerregistryUser -type ProjectContainerregistryUserSpec struct { +// ContainerRegistryUserSpec defines the desired state of ContainerRegistryUser +type ContainerRegistryUserSpec struct { v1.ResourceSpec `json:",inline"` - ForProvider ProjectContainerregistryUserParameters `json:"forProvider"` + ForProvider ContainerRegistryUserParameters `json:"forProvider"` // THIS IS A BETA FIELD. It will be honored // unless the Management Policies feature flag is disabled. // InitProvider holds the same fields as ForProvider, with the exception @@ -85,52 +91,51 @@ type ProjectContainerregistryUserSpec struct { // required on creation, but we do not desire to update them after creation, // for example because of an external controller is managing them, like an // autoscaler. - InitProvider ProjectContainerregistryUserInitParameters `json:"initProvider,omitempty"` + InitProvider ContainerRegistryUserInitParameters `json:"initProvider,omitempty"` } -// ProjectContainerregistryUserStatus defines the observed state of ProjectContainerregistryUser. -type ProjectContainerregistryUserStatus struct { +// ContainerRegistryUserStatus defines the observed state of ContainerRegistryUser. +type ContainerRegistryUserStatus struct { v1.ResourceStatus `json:",inline"` - AtProvider ProjectContainerregistryUserObservation `json:"atProvider,omitempty"` + AtProvider ContainerRegistryUserObservation `json:"atProvider,omitempty"` } // +kubebuilder:object:root=true -// ProjectContainerregistryUser is the Schema for the ProjectContainerregistryUsers API. +// ContainerRegistryUser is the Schema for the ContainerRegistryUsers API. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" // +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" // +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" // +kubebuilder:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,ovh} -type ProjectContainerregistryUser struct { +type ContainerRegistryUser struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.email) || (has(self.initProvider) && has(self.initProvider.email))",message="spec.forProvider.email is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.login) || (has(self.initProvider) && has(self.initProvider.login))",message="spec.forProvider.login is a required parameter" - // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.registryId) || (has(self.initProvider) && has(self.initProvider.registryId))",message="spec.forProvider.registryId is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.serviceName) || (has(self.initProvider) && has(self.initProvider.serviceName))",message="spec.forProvider.serviceName is a required parameter" - Spec ProjectContainerregistryUserSpec `json:"spec"` - Status ProjectContainerregistryUserStatus `json:"status,omitempty"` + Spec ContainerRegistryUserSpec `json:"spec"` + Status ContainerRegistryUserStatus `json:"status,omitempty"` } // +kubebuilder:object:root=true -// ProjectContainerregistryUserList contains a list of ProjectContainerregistryUsers -type ProjectContainerregistryUserList struct { +// ContainerRegistryUserList contains a list of ContainerRegistryUsers +type ContainerRegistryUserList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []ProjectContainerregistryUser `json:"items"` + Items []ContainerRegistryUser `json:"items"` } // Repository type metadata. var ( - ProjectContainerregistryUser_Kind = "ProjectContainerregistryUser" - ProjectContainerregistryUser_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: ProjectContainerregistryUser_Kind}.String() - ProjectContainerregistryUser_KindAPIVersion = ProjectContainerregistryUser_Kind + "." + CRDGroupVersion.String() - ProjectContainerregistryUser_GroupVersionKind = CRDGroupVersion.WithKind(ProjectContainerregistryUser_Kind) + ContainerRegistryUser_Kind = "ContainerRegistryUser" + ContainerRegistryUser_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: ContainerRegistryUser_Kind}.String() + ContainerRegistryUser_KindAPIVersion = ContainerRegistryUser_Kind + "." + CRDGroupVersion.String() + ContainerRegistryUser_GroupVersionKind = CRDGroupVersion.WithKind(ContainerRegistryUser_Kind) ) func init() { - SchemeBuilder.Register(&ProjectContainerregistryUser{}, &ProjectContainerregistryUserList{}) + SchemeBuilder.Register(&ContainerRegistryUser{}, &ContainerRegistryUserList{}) } diff --git a/apis/registry/v1alpha1/zz_generated.deepcopy.go b/apis/registry/v1alpha1/zz_generated.deepcopy.go index fc732e0..6c9b58e 100644 --- a/apis/registry/v1alpha1/zz_generated.deepcopy.go +++ b/apis/registry/v1alpha1/zz_generated.deepcopy.go @@ -9,145 +9,12 @@ Copyright 2022 Upbound Inc. package v1alpha1 import ( + "github.com/crossplane/crossplane-runtime/apis/common/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FeaturesInitParameters) DeepCopyInto(out *FeaturesInitParameters) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeaturesInitParameters. -func (in *FeaturesInitParameters) DeepCopy() *FeaturesInitParameters { - if in == nil { - return nil - } - out := new(FeaturesInitParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FeaturesObservation) DeepCopyInto(out *FeaturesObservation) { - *out = *in - if in.Vulnerability != nil { - in, out := &in.Vulnerability, &out.Vulnerability - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeaturesObservation. -func (in *FeaturesObservation) DeepCopy() *FeaturesObservation { - if in == nil { - return nil - } - out := new(FeaturesObservation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FeaturesParameters) DeepCopyInto(out *FeaturesParameters) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeaturesParameters. -func (in *FeaturesParameters) DeepCopy() *FeaturesParameters { - if in == nil { - return nil - } - out := new(FeaturesParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PlanInitParameters) DeepCopyInto(out *PlanInitParameters) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlanInitParameters. -func (in *PlanInitParameters) DeepCopy() *PlanInitParameters { - if in == nil { - return nil - } - out := new(PlanInitParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PlanObservation) DeepCopyInto(out *PlanObservation) { - *out = *in - if in.Code != nil { - in, out := &in.Code, &out.Code - *out = new(string) - **out = **in - } - if in.CreatedAt != nil { - in, out := &in.CreatedAt, &out.CreatedAt - *out = new(string) - **out = **in - } - if in.Features != nil { - in, out := &in.Features, &out.Features - *out = make([]FeaturesObservation, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.ID != nil { - in, out := &in.ID, &out.ID - *out = new(string) - **out = **in - } - if in.Name != nil { - in, out := &in.Name, &out.Name - *out = new(string) - **out = **in - } - if in.RegistryLimits != nil { - in, out := &in.RegistryLimits, &out.RegistryLimits - *out = make([]RegistryLimitsObservation, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.UpdatedAt != nil { - in, out := &in.UpdatedAt, &out.UpdatedAt - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlanObservation. -func (in *PlanObservation) DeepCopy() *PlanObservation { - if in == nil { - return nil - } - out := new(PlanObservation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PlanParameters) DeepCopyInto(out *PlanParameters) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlanParameters. -func (in *PlanParameters) DeepCopy() *PlanParameters { - if in == nil { - return nil - } - out := new(PlanParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectContainerregistry) DeepCopyInto(out *ProjectContainerregistry) { +func (in *ContainerRegistry) DeepCopyInto(out *ContainerRegistry) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) @@ -155,18 +22,18 @@ func (in *ProjectContainerregistry) DeepCopyInto(out *ProjectContainerregistry) in.Status.DeepCopyInto(&out.Status) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectContainerregistry. -func (in *ProjectContainerregistry) DeepCopy() *ProjectContainerregistry { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerRegistry. +func (in *ContainerRegistry) DeepCopy() *ContainerRegistry { if in == nil { return nil } - out := new(ProjectContainerregistry) + out := new(ContainerRegistry) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProjectContainerregistry) DeepCopyObject() runtime.Object { +func (in *ContainerRegistry) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -174,8 +41,13 @@ func (in *ProjectContainerregistry) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectContainerregistryInitParameters) DeepCopyInto(out *ProjectContainerregistryInitParameters) { +func (in *ContainerRegistryInitParameters) DeepCopyInto(out *ContainerRegistryInitParameters) { *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } if in.PlanID != nil { in, out := &in.PlanID, &out.PlanID *out = new(string) @@ -193,42 +65,42 @@ func (in *ProjectContainerregistryInitParameters) DeepCopyInto(out *ProjectConta } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectContainerregistryInitParameters. -func (in *ProjectContainerregistryInitParameters) DeepCopy() *ProjectContainerregistryInitParameters { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerRegistryInitParameters. +func (in *ContainerRegistryInitParameters) DeepCopy() *ContainerRegistryInitParameters { if in == nil { return nil } - out := new(ProjectContainerregistryInitParameters) + out := new(ContainerRegistryInitParameters) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectContainerregistryList) DeepCopyInto(out *ProjectContainerregistryList) { +func (in *ContainerRegistryList) DeepCopyInto(out *ContainerRegistryList) { *out = *in out.TypeMeta = in.TypeMeta in.ListMeta.DeepCopyInto(&out.ListMeta) if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]ProjectContainerregistry, len(*in)) + *out = make([]ContainerRegistry, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectContainerregistryList. -func (in *ProjectContainerregistryList) DeepCopy() *ProjectContainerregistryList { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerRegistryList. +func (in *ContainerRegistryList) DeepCopy() *ContainerRegistryList { if in == nil { return nil } - out := new(ProjectContainerregistryList) + out := new(ContainerRegistryList) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProjectContainerregistryList) DeepCopyObject() runtime.Object { +func (in *ContainerRegistryList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -236,84 +108,7 @@ func (in *ProjectContainerregistryList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectContainerregistryObservation) DeepCopyInto(out *ProjectContainerregistryObservation) { - *out = *in - if in.CreatedAt != nil { - in, out := &in.CreatedAt, &out.CreatedAt - *out = new(string) - **out = **in - } - if in.ID != nil { - in, out := &in.ID, &out.ID - *out = new(string) - **out = **in - } - if in.Plan != nil { - in, out := &in.Plan, &out.Plan - *out = make([]PlanObservation, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.PlanID != nil { - in, out := &in.PlanID, &out.PlanID - *out = new(string) - **out = **in - } - if in.ProjectID != nil { - in, out := &in.ProjectID, &out.ProjectID - *out = new(string) - **out = **in - } - if in.Region != nil { - in, out := &in.Region, &out.Region - *out = new(string) - **out = **in - } - if in.ServiceName != nil { - in, out := &in.ServiceName, &out.ServiceName - *out = new(string) - **out = **in - } - if in.Size != nil { - in, out := &in.Size, &out.Size - *out = new(float64) - **out = **in - } - if in.Status != nil { - in, out := &in.Status, &out.Status - *out = new(string) - **out = **in - } - if in.URL != nil { - in, out := &in.URL, &out.URL - *out = new(string) - **out = **in - } - if in.UpdatedAt != nil { - in, out := &in.UpdatedAt, &out.UpdatedAt - *out = new(string) - **out = **in - } - if in.Version != nil { - in, out := &in.Version, &out.Version - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectContainerregistryObservation. -func (in *ProjectContainerregistryObservation) DeepCopy() *ProjectContainerregistryObservation { - if in == nil { - return nil - } - out := new(ProjectContainerregistryObservation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectContainerregistryOidc) DeepCopyInto(out *ProjectContainerregistryOidc) { +func (in *ContainerRegistryOIDC) DeepCopyInto(out *ContainerRegistryOIDC) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) @@ -321,18 +116,18 @@ func (in *ProjectContainerregistryOidc) DeepCopyInto(out *ProjectContainerregist in.Status.DeepCopyInto(&out.Status) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectContainerregistryOidc. -func (in *ProjectContainerregistryOidc) DeepCopy() *ProjectContainerregistryOidc { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerRegistryOIDC. +func (in *ContainerRegistryOIDC) DeepCopy() *ContainerRegistryOIDC { if in == nil { return nil } - out := new(ProjectContainerregistryOidc) + out := new(ContainerRegistryOIDC) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProjectContainerregistryOidc) DeepCopyObject() runtime.Object { +func (in *ContainerRegistryOIDC) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -340,7 +135,7 @@ func (in *ProjectContainerregistryOidc) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectContainerregistryOidcInitParameters) DeepCopyInto(out *ProjectContainerregistryOidcInitParameters) { +func (in *ContainerRegistryOIDCInitParameters) DeepCopyInto(out *ContainerRegistryOIDCInitParameters) { *out = *in if in.DeleteUsers != nil { in, out := &in.DeleteUsers, &out.DeleteUsers @@ -392,11 +187,6 @@ func (in *ProjectContainerregistryOidcInitParameters) DeepCopyInto(out *ProjectC *out = new(bool) **out = **in } - if in.RegistryID != nil { - in, out := &in.RegistryID, &out.RegistryID - *out = new(string) - **out = **in - } if in.ServiceName != nil { in, out := &in.ServiceName, &out.ServiceName *out = new(string) @@ -404,42 +194,42 @@ func (in *ProjectContainerregistryOidcInitParameters) DeepCopyInto(out *ProjectC } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectContainerregistryOidcInitParameters. -func (in *ProjectContainerregistryOidcInitParameters) DeepCopy() *ProjectContainerregistryOidcInitParameters { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerRegistryOIDCInitParameters. +func (in *ContainerRegistryOIDCInitParameters) DeepCopy() *ContainerRegistryOIDCInitParameters { if in == nil { return nil } - out := new(ProjectContainerregistryOidcInitParameters) + out := new(ContainerRegistryOIDCInitParameters) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectContainerregistryOidcList) DeepCopyInto(out *ProjectContainerregistryOidcList) { +func (in *ContainerRegistryOIDCList) DeepCopyInto(out *ContainerRegistryOIDCList) { *out = *in out.TypeMeta = in.TypeMeta in.ListMeta.DeepCopyInto(&out.ListMeta) if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]ProjectContainerregistryOidc, len(*in)) + *out = make([]ContainerRegistryOIDC, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectContainerregistryOidcList. -func (in *ProjectContainerregistryOidcList) DeepCopy() *ProjectContainerregistryOidcList { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerRegistryOIDCList. +func (in *ContainerRegistryOIDCList) DeepCopy() *ContainerRegistryOIDCList { if in == nil { return nil } - out := new(ProjectContainerregistryOidcList) + out := new(ContainerRegistryOIDCList) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProjectContainerregistryOidcList) DeepCopyObject() runtime.Object { +func (in *ContainerRegistryOIDCList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -447,7 +237,7 @@ func (in *ProjectContainerregistryOidcList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectContainerregistryOidcObservation) DeepCopyInto(out *ProjectContainerregistryOidcObservation) { +func (in *ContainerRegistryOIDCObservation) DeepCopyInto(out *ContainerRegistryOIDCObservation) { *out = *in if in.DeleteUsers != nil { in, out := &in.DeleteUsers, &out.DeleteUsers @@ -516,18 +306,18 @@ func (in *ProjectContainerregistryOidcObservation) DeepCopyInto(out *ProjectCont } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectContainerregistryOidcObservation. -func (in *ProjectContainerregistryOidcObservation) DeepCopy() *ProjectContainerregistryOidcObservation { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerRegistryOIDCObservation. +func (in *ContainerRegistryOIDCObservation) DeepCopy() *ContainerRegistryOIDCObservation { if in == nil { return nil } - out := new(ProjectContainerregistryOidcObservation) + out := new(ContainerRegistryOIDCObservation) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectContainerregistryOidcParameters) DeepCopyInto(out *ProjectContainerregistryOidcParameters) { +func (in *ContainerRegistryOIDCParameters) DeepCopyInto(out *ContainerRegistryOIDCParameters) { *out = *in if in.DeleteUsers != nil { in, out := &in.DeleteUsers, &out.DeleteUsers @@ -585,6 +375,16 @@ func (in *ProjectContainerregistryOidcParameters) DeepCopyInto(out *ProjectConta *out = new(string) **out = **in } + if in.RegistryIDRef != nil { + in, out := &in.RegistryIDRef, &out.RegistryIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.RegistryIDSelector != nil { + in, out := &in.RegistryIDSelector, &out.RegistryIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.ServiceName != nil { in, out := &in.ServiceName, &out.ServiceName *out = new(string) @@ -592,59 +392,86 @@ func (in *ProjectContainerregistryOidcParameters) DeepCopyInto(out *ProjectConta } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectContainerregistryOidcParameters. -func (in *ProjectContainerregistryOidcParameters) DeepCopy() *ProjectContainerregistryOidcParameters { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerRegistryOIDCParameters. +func (in *ContainerRegistryOIDCParameters) DeepCopy() *ContainerRegistryOIDCParameters { if in == nil { return nil } - out := new(ProjectContainerregistryOidcParameters) + out := new(ContainerRegistryOIDCParameters) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectContainerregistryOidcSpec) DeepCopyInto(out *ProjectContainerregistryOidcSpec) { +func (in *ContainerRegistryOIDCSpec) DeepCopyInto(out *ContainerRegistryOIDCSpec) { *out = *in in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) in.ForProvider.DeepCopyInto(&out.ForProvider) in.InitProvider.DeepCopyInto(&out.InitProvider) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectContainerregistryOidcSpec. -func (in *ProjectContainerregistryOidcSpec) DeepCopy() *ProjectContainerregistryOidcSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerRegistryOIDCSpec. +func (in *ContainerRegistryOIDCSpec) DeepCopy() *ContainerRegistryOIDCSpec { if in == nil { return nil } - out := new(ProjectContainerregistryOidcSpec) + out := new(ContainerRegistryOIDCSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectContainerregistryOidcStatus) DeepCopyInto(out *ProjectContainerregistryOidcStatus) { +func (in *ContainerRegistryOIDCStatus) DeepCopyInto(out *ContainerRegistryOIDCStatus) { *out = *in in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) in.AtProvider.DeepCopyInto(&out.AtProvider) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectContainerregistryOidcStatus. -func (in *ProjectContainerregistryOidcStatus) DeepCopy() *ProjectContainerregistryOidcStatus { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerRegistryOIDCStatus. +func (in *ContainerRegistryOIDCStatus) DeepCopy() *ContainerRegistryOIDCStatus { if in == nil { return nil } - out := new(ProjectContainerregistryOidcStatus) + out := new(ContainerRegistryOIDCStatus) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectContainerregistryParameters) DeepCopyInto(out *ProjectContainerregistryParameters) { +func (in *ContainerRegistryObservation) DeepCopyInto(out *ContainerRegistryObservation) { *out = *in + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Plan != nil { + in, out := &in.Plan, &out.Plan + *out = make([]PlanObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } if in.PlanID != nil { in, out := &in.PlanID, &out.PlanID *out = new(string) **out = **in } + if in.ProjectID != nil { + in, out := &in.ProjectID, &out.ProjectID + *out = new(string) + **out = **in + } if in.Region != nil { in, out := &in.Region, &out.Region *out = new(string) @@ -655,55 +482,115 @@ func (in *ProjectContainerregistryParameters) DeepCopyInto(out *ProjectContainer *out = new(string) **out = **in } + if in.Size != nil { + in, out := &in.Size, &out.Size + *out = new(float64) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } + if in.URL != nil { + in, out := &in.URL, &out.URL + *out = new(string) + **out = **in + } + if in.UpdatedAt != nil { + in, out := &in.UpdatedAt, &out.UpdatedAt + *out = new(string) + **out = **in + } + if in.Version != nil { + in, out := &in.Version, &out.Version + *out = new(string) + **out = **in + } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectContainerregistryParameters. -func (in *ProjectContainerregistryParameters) DeepCopy() *ProjectContainerregistryParameters { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerRegistryObservation. +func (in *ContainerRegistryObservation) DeepCopy() *ContainerRegistryObservation { if in == nil { return nil } - out := new(ProjectContainerregistryParameters) + out := new(ContainerRegistryObservation) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectContainerregistrySpec) DeepCopyInto(out *ProjectContainerregistrySpec) { +func (in *ContainerRegistryParameters) DeepCopyInto(out *ContainerRegistryParameters) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.PlanID != nil { + in, out := &in.PlanID, &out.PlanID + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.ServiceName != nil { + in, out := &in.ServiceName, &out.ServiceName + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerRegistryParameters. +func (in *ContainerRegistryParameters) DeepCopy() *ContainerRegistryParameters { + if in == nil { + return nil + } + out := new(ContainerRegistryParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ContainerRegistrySpec) DeepCopyInto(out *ContainerRegistrySpec) { *out = *in in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) in.ForProvider.DeepCopyInto(&out.ForProvider) in.InitProvider.DeepCopyInto(&out.InitProvider) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectContainerregistrySpec. -func (in *ProjectContainerregistrySpec) DeepCopy() *ProjectContainerregistrySpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerRegistrySpec. +func (in *ContainerRegistrySpec) DeepCopy() *ContainerRegistrySpec { if in == nil { return nil } - out := new(ProjectContainerregistrySpec) + out := new(ContainerRegistrySpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectContainerregistryStatus) DeepCopyInto(out *ProjectContainerregistryStatus) { +func (in *ContainerRegistryStatus) DeepCopyInto(out *ContainerRegistryStatus) { *out = *in in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) in.AtProvider.DeepCopyInto(&out.AtProvider) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectContainerregistryStatus. -func (in *ProjectContainerregistryStatus) DeepCopy() *ProjectContainerregistryStatus { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerRegistryStatus. +func (in *ContainerRegistryStatus) DeepCopy() *ContainerRegistryStatus { if in == nil { return nil } - out := new(ProjectContainerregistryStatus) + out := new(ContainerRegistryStatus) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectContainerregistryUser) DeepCopyInto(out *ProjectContainerregistryUser) { +func (in *ContainerRegistryUser) DeepCopyInto(out *ContainerRegistryUser) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) @@ -711,18 +598,18 @@ func (in *ProjectContainerregistryUser) DeepCopyInto(out *ProjectContainerregist in.Status.DeepCopyInto(&out.Status) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectContainerregistryUser. -func (in *ProjectContainerregistryUser) DeepCopy() *ProjectContainerregistryUser { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerRegistryUser. +func (in *ContainerRegistryUser) DeepCopy() *ContainerRegistryUser { if in == nil { return nil } - out := new(ProjectContainerregistryUser) + out := new(ContainerRegistryUser) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProjectContainerregistryUser) DeepCopyObject() runtime.Object { +func (in *ContainerRegistryUser) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -730,7 +617,7 @@ func (in *ProjectContainerregistryUser) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectContainerregistryUserInitParameters) DeepCopyInto(out *ProjectContainerregistryUserInitParameters) { +func (in *ContainerRegistryUserInitParameters) DeepCopyInto(out *ContainerRegistryUserInitParameters) { *out = *in if in.Email != nil { in, out := &in.Email, &out.Email @@ -742,11 +629,6 @@ func (in *ProjectContainerregistryUserInitParameters) DeepCopyInto(out *ProjectC *out = new(string) **out = **in } - if in.RegistryID != nil { - in, out := &in.RegistryID, &out.RegistryID - *out = new(string) - **out = **in - } if in.ServiceName != nil { in, out := &in.ServiceName, &out.ServiceName *out = new(string) @@ -754,42 +636,42 @@ func (in *ProjectContainerregistryUserInitParameters) DeepCopyInto(out *ProjectC } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectContainerregistryUserInitParameters. -func (in *ProjectContainerregistryUserInitParameters) DeepCopy() *ProjectContainerregistryUserInitParameters { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerRegistryUserInitParameters. +func (in *ContainerRegistryUserInitParameters) DeepCopy() *ContainerRegistryUserInitParameters { if in == nil { return nil } - out := new(ProjectContainerregistryUserInitParameters) + out := new(ContainerRegistryUserInitParameters) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectContainerregistryUserList) DeepCopyInto(out *ProjectContainerregistryUserList) { +func (in *ContainerRegistryUserList) DeepCopyInto(out *ContainerRegistryUserList) { *out = *in out.TypeMeta = in.TypeMeta in.ListMeta.DeepCopyInto(&out.ListMeta) if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]ProjectContainerregistryUser, len(*in)) + *out = make([]ContainerRegistryUser, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectContainerregistryUserList. -func (in *ProjectContainerregistryUserList) DeepCopy() *ProjectContainerregistryUserList { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerRegistryUserList. +func (in *ContainerRegistryUserList) DeepCopy() *ContainerRegistryUserList { if in == nil { return nil } - out := new(ProjectContainerregistryUserList) + out := new(ContainerRegistryUserList) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProjectContainerregistryUserList) DeepCopyObject() runtime.Object { +func (in *ContainerRegistryUserList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -797,7 +679,7 @@ func (in *ProjectContainerregistryUserList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectContainerregistryUserObservation) DeepCopyInto(out *ProjectContainerregistryUserObservation) { +func (in *ContainerRegistryUserObservation) DeepCopyInto(out *ContainerRegistryUserObservation) { *out = *in if in.Email != nil { in, out := &in.Email, &out.Email @@ -831,18 +713,18 @@ func (in *ProjectContainerregistryUserObservation) DeepCopyInto(out *ProjectCont } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectContainerregistryUserObservation. -func (in *ProjectContainerregistryUserObservation) DeepCopy() *ProjectContainerregistryUserObservation { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerRegistryUserObservation. +func (in *ContainerRegistryUserObservation) DeepCopy() *ContainerRegistryUserObservation { if in == nil { return nil } - out := new(ProjectContainerregistryUserObservation) + out := new(ContainerRegistryUserObservation) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectContainerregistryUserParameters) DeepCopyInto(out *ProjectContainerregistryUserParameters) { +func (in *ContainerRegistryUserParameters) DeepCopyInto(out *ContainerRegistryUserParameters) { *out = *in if in.Email != nil { in, out := &in.Email, &out.Email @@ -859,6 +741,16 @@ func (in *ProjectContainerregistryUserParameters) DeepCopyInto(out *ProjectConta *out = new(string) **out = **in } + if in.RegistryIDRef != nil { + in, out := &in.RegistryIDRef, &out.RegistryIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.RegistryIDSelector != nil { + in, out := &in.RegistryIDSelector, &out.RegistryIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.ServiceName != nil { in, out := &in.ServiceName, &out.ServiceName *out = new(string) @@ -866,47 +758,181 @@ func (in *ProjectContainerregistryUserParameters) DeepCopyInto(out *ProjectConta } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectContainerregistryUserParameters. -func (in *ProjectContainerregistryUserParameters) DeepCopy() *ProjectContainerregistryUserParameters { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerRegistryUserParameters. +func (in *ContainerRegistryUserParameters) DeepCopy() *ContainerRegistryUserParameters { if in == nil { return nil } - out := new(ProjectContainerregistryUserParameters) + out := new(ContainerRegistryUserParameters) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectContainerregistryUserSpec) DeepCopyInto(out *ProjectContainerregistryUserSpec) { +func (in *ContainerRegistryUserSpec) DeepCopyInto(out *ContainerRegistryUserSpec) { *out = *in in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) in.ForProvider.DeepCopyInto(&out.ForProvider) in.InitProvider.DeepCopyInto(&out.InitProvider) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectContainerregistryUserSpec. -func (in *ProjectContainerregistryUserSpec) DeepCopy() *ProjectContainerregistryUserSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerRegistryUserSpec. +func (in *ContainerRegistryUserSpec) DeepCopy() *ContainerRegistryUserSpec { if in == nil { return nil } - out := new(ProjectContainerregistryUserSpec) + out := new(ContainerRegistryUserSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectContainerregistryUserStatus) DeepCopyInto(out *ProjectContainerregistryUserStatus) { +func (in *ContainerRegistryUserStatus) DeepCopyInto(out *ContainerRegistryUserStatus) { *out = *in in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) in.AtProvider.DeepCopyInto(&out.AtProvider) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectContainerregistryUserStatus. -func (in *ProjectContainerregistryUserStatus) DeepCopy() *ProjectContainerregistryUserStatus { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerRegistryUserStatus. +func (in *ContainerRegistryUserStatus) DeepCopy() *ContainerRegistryUserStatus { if in == nil { return nil } - out := new(ProjectContainerregistryUserStatus) + out := new(ContainerRegistryUserStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FeaturesInitParameters) DeepCopyInto(out *FeaturesInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeaturesInitParameters. +func (in *FeaturesInitParameters) DeepCopy() *FeaturesInitParameters { + if in == nil { + return nil + } + out := new(FeaturesInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FeaturesObservation) DeepCopyInto(out *FeaturesObservation) { + *out = *in + if in.Vulnerability != nil { + in, out := &in.Vulnerability, &out.Vulnerability + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeaturesObservation. +func (in *FeaturesObservation) DeepCopy() *FeaturesObservation { + if in == nil { + return nil + } + out := new(FeaturesObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FeaturesParameters) DeepCopyInto(out *FeaturesParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeaturesParameters. +func (in *FeaturesParameters) DeepCopy() *FeaturesParameters { + if in == nil { + return nil + } + out := new(FeaturesParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PlanInitParameters) DeepCopyInto(out *PlanInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlanInitParameters. +func (in *PlanInitParameters) DeepCopy() *PlanInitParameters { + if in == nil { + return nil + } + out := new(PlanInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PlanObservation) DeepCopyInto(out *PlanObservation) { + *out = *in + if in.Code != nil { + in, out := &in.Code, &out.Code + *out = new(string) + **out = **in + } + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.Features != nil { + in, out := &in.Features, &out.Features + *out = make([]FeaturesObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.RegistryLimits != nil { + in, out := &in.RegistryLimits, &out.RegistryLimits + *out = make([]RegistryLimitsObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.UpdatedAt != nil { + in, out := &in.UpdatedAt, &out.UpdatedAt + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlanObservation. +func (in *PlanObservation) DeepCopy() *PlanObservation { + if in == nil { + return nil + } + out := new(PlanObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PlanParameters) DeepCopyInto(out *PlanParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlanParameters. +func (in *PlanParameters) DeepCopy() *PlanParameters { + if in == nil { + return nil + } + out := new(PlanParameters) in.DeepCopyInto(out) return out } diff --git a/apis/registry/v1alpha1/zz_generated.managed.go b/apis/registry/v1alpha1/zz_generated.managed.go index 03bceac..02c257a 100644 --- a/apis/registry/v1alpha1/zz_generated.managed.go +++ b/apis/registry/v1alpha1/zz_generated.managed.go @@ -7,182 +7,182 @@ package v1alpha1 import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" -// GetCondition of this ProjectContainerregistry. -func (mg *ProjectContainerregistry) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +// GetCondition of this ContainerRegistry. +func (mg *ContainerRegistry) GetCondition(ct xpv1.ConditionType) xpv1.Condition { return mg.Status.GetCondition(ct) } -// GetDeletionPolicy of this ProjectContainerregistry. -func (mg *ProjectContainerregistry) GetDeletionPolicy() xpv1.DeletionPolicy { +// GetDeletionPolicy of this ContainerRegistry. +func (mg *ContainerRegistry) GetDeletionPolicy() xpv1.DeletionPolicy { return mg.Spec.DeletionPolicy } -// GetManagementPolicies of this ProjectContainerregistry. -func (mg *ProjectContainerregistry) GetManagementPolicies() xpv1.ManagementPolicies { +// GetManagementPolicies of this ContainerRegistry. +func (mg *ContainerRegistry) GetManagementPolicies() xpv1.ManagementPolicies { return mg.Spec.ManagementPolicies } -// GetProviderConfigReference of this ProjectContainerregistry. -func (mg *ProjectContainerregistry) GetProviderConfigReference() *xpv1.Reference { +// GetProviderConfigReference of this ContainerRegistry. +func (mg *ContainerRegistry) GetProviderConfigReference() *xpv1.Reference { return mg.Spec.ProviderConfigReference } -// GetPublishConnectionDetailsTo of this ProjectContainerregistry. -func (mg *ProjectContainerregistry) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { +// GetPublishConnectionDetailsTo of this ContainerRegistry. +func (mg *ContainerRegistry) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { return mg.Spec.PublishConnectionDetailsTo } -// GetWriteConnectionSecretToReference of this ProjectContainerregistry. -func (mg *ProjectContainerregistry) GetWriteConnectionSecretToReference() *xpv1.SecretReference { +// GetWriteConnectionSecretToReference of this ContainerRegistry. +func (mg *ContainerRegistry) GetWriteConnectionSecretToReference() *xpv1.SecretReference { return mg.Spec.WriteConnectionSecretToReference } -// SetConditions of this ProjectContainerregistry. -func (mg *ProjectContainerregistry) SetConditions(c ...xpv1.Condition) { +// SetConditions of this ContainerRegistry. +func (mg *ContainerRegistry) SetConditions(c ...xpv1.Condition) { mg.Status.SetConditions(c...) } -// SetDeletionPolicy of this ProjectContainerregistry. -func (mg *ProjectContainerregistry) SetDeletionPolicy(r xpv1.DeletionPolicy) { +// SetDeletionPolicy of this ContainerRegistry. +func (mg *ContainerRegistry) SetDeletionPolicy(r xpv1.DeletionPolicy) { mg.Spec.DeletionPolicy = r } -// SetManagementPolicies of this ProjectContainerregistry. -func (mg *ProjectContainerregistry) SetManagementPolicies(r xpv1.ManagementPolicies) { +// SetManagementPolicies of this ContainerRegistry. +func (mg *ContainerRegistry) SetManagementPolicies(r xpv1.ManagementPolicies) { mg.Spec.ManagementPolicies = r } -// SetProviderConfigReference of this ProjectContainerregistry. -func (mg *ProjectContainerregistry) SetProviderConfigReference(r *xpv1.Reference) { +// SetProviderConfigReference of this ContainerRegistry. +func (mg *ContainerRegistry) SetProviderConfigReference(r *xpv1.Reference) { mg.Spec.ProviderConfigReference = r } -// SetPublishConnectionDetailsTo of this ProjectContainerregistry. -func (mg *ProjectContainerregistry) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { +// SetPublishConnectionDetailsTo of this ContainerRegistry. +func (mg *ContainerRegistry) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { mg.Spec.PublishConnectionDetailsTo = r } -// SetWriteConnectionSecretToReference of this ProjectContainerregistry. -func (mg *ProjectContainerregistry) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { +// SetWriteConnectionSecretToReference of this ContainerRegistry. +func (mg *ContainerRegistry) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } -// GetCondition of this ProjectContainerregistryOidc. -func (mg *ProjectContainerregistryOidc) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +// GetCondition of this ContainerRegistryOIDC. +func (mg *ContainerRegistryOIDC) GetCondition(ct xpv1.ConditionType) xpv1.Condition { return mg.Status.GetCondition(ct) } -// GetDeletionPolicy of this ProjectContainerregistryOidc. -func (mg *ProjectContainerregistryOidc) GetDeletionPolicy() xpv1.DeletionPolicy { +// GetDeletionPolicy of this ContainerRegistryOIDC. +func (mg *ContainerRegistryOIDC) GetDeletionPolicy() xpv1.DeletionPolicy { return mg.Spec.DeletionPolicy } -// GetManagementPolicies of this ProjectContainerregistryOidc. -func (mg *ProjectContainerregistryOidc) GetManagementPolicies() xpv1.ManagementPolicies { +// GetManagementPolicies of this ContainerRegistryOIDC. +func (mg *ContainerRegistryOIDC) GetManagementPolicies() xpv1.ManagementPolicies { return mg.Spec.ManagementPolicies } -// GetProviderConfigReference of this ProjectContainerregistryOidc. -func (mg *ProjectContainerregistryOidc) GetProviderConfigReference() *xpv1.Reference { +// GetProviderConfigReference of this ContainerRegistryOIDC. +func (mg *ContainerRegistryOIDC) GetProviderConfigReference() *xpv1.Reference { return mg.Spec.ProviderConfigReference } -// GetPublishConnectionDetailsTo of this ProjectContainerregistryOidc. -func (mg *ProjectContainerregistryOidc) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { +// GetPublishConnectionDetailsTo of this ContainerRegistryOIDC. +func (mg *ContainerRegistryOIDC) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { return mg.Spec.PublishConnectionDetailsTo } -// GetWriteConnectionSecretToReference of this ProjectContainerregistryOidc. -func (mg *ProjectContainerregistryOidc) GetWriteConnectionSecretToReference() *xpv1.SecretReference { +// GetWriteConnectionSecretToReference of this ContainerRegistryOIDC. +func (mg *ContainerRegistryOIDC) GetWriteConnectionSecretToReference() *xpv1.SecretReference { return mg.Spec.WriteConnectionSecretToReference } -// SetConditions of this ProjectContainerregistryOidc. -func (mg *ProjectContainerregistryOidc) SetConditions(c ...xpv1.Condition) { +// SetConditions of this ContainerRegistryOIDC. +func (mg *ContainerRegistryOIDC) SetConditions(c ...xpv1.Condition) { mg.Status.SetConditions(c...) } -// SetDeletionPolicy of this ProjectContainerregistryOidc. -func (mg *ProjectContainerregistryOidc) SetDeletionPolicy(r xpv1.DeletionPolicy) { +// SetDeletionPolicy of this ContainerRegistryOIDC. +func (mg *ContainerRegistryOIDC) SetDeletionPolicy(r xpv1.DeletionPolicy) { mg.Spec.DeletionPolicy = r } -// SetManagementPolicies of this ProjectContainerregistryOidc. -func (mg *ProjectContainerregistryOidc) SetManagementPolicies(r xpv1.ManagementPolicies) { +// SetManagementPolicies of this ContainerRegistryOIDC. +func (mg *ContainerRegistryOIDC) SetManagementPolicies(r xpv1.ManagementPolicies) { mg.Spec.ManagementPolicies = r } -// SetProviderConfigReference of this ProjectContainerregistryOidc. -func (mg *ProjectContainerregistryOidc) SetProviderConfigReference(r *xpv1.Reference) { +// SetProviderConfigReference of this ContainerRegistryOIDC. +func (mg *ContainerRegistryOIDC) SetProviderConfigReference(r *xpv1.Reference) { mg.Spec.ProviderConfigReference = r } -// SetPublishConnectionDetailsTo of this ProjectContainerregistryOidc. -func (mg *ProjectContainerregistryOidc) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { +// SetPublishConnectionDetailsTo of this ContainerRegistryOIDC. +func (mg *ContainerRegistryOIDC) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { mg.Spec.PublishConnectionDetailsTo = r } -// SetWriteConnectionSecretToReference of this ProjectContainerregistryOidc. -func (mg *ProjectContainerregistryOidc) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { +// SetWriteConnectionSecretToReference of this ContainerRegistryOIDC. +func (mg *ContainerRegistryOIDC) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } -// GetCondition of this ProjectContainerregistryUser. -func (mg *ProjectContainerregistryUser) GetCondition(ct xpv1.ConditionType) xpv1.Condition { +// GetCondition of this ContainerRegistryUser. +func (mg *ContainerRegistryUser) GetCondition(ct xpv1.ConditionType) xpv1.Condition { return mg.Status.GetCondition(ct) } -// GetDeletionPolicy of this ProjectContainerregistryUser. -func (mg *ProjectContainerregistryUser) GetDeletionPolicy() xpv1.DeletionPolicy { +// GetDeletionPolicy of this ContainerRegistryUser. +func (mg *ContainerRegistryUser) GetDeletionPolicy() xpv1.DeletionPolicy { return mg.Spec.DeletionPolicy } -// GetManagementPolicies of this ProjectContainerregistryUser. -func (mg *ProjectContainerregistryUser) GetManagementPolicies() xpv1.ManagementPolicies { +// GetManagementPolicies of this ContainerRegistryUser. +func (mg *ContainerRegistryUser) GetManagementPolicies() xpv1.ManagementPolicies { return mg.Spec.ManagementPolicies } -// GetProviderConfigReference of this ProjectContainerregistryUser. -func (mg *ProjectContainerregistryUser) GetProviderConfigReference() *xpv1.Reference { +// GetProviderConfigReference of this ContainerRegistryUser. +func (mg *ContainerRegistryUser) GetProviderConfigReference() *xpv1.Reference { return mg.Spec.ProviderConfigReference } -// GetPublishConnectionDetailsTo of this ProjectContainerregistryUser. -func (mg *ProjectContainerregistryUser) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { +// GetPublishConnectionDetailsTo of this ContainerRegistryUser. +func (mg *ContainerRegistryUser) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { return mg.Spec.PublishConnectionDetailsTo } -// GetWriteConnectionSecretToReference of this ProjectContainerregistryUser. -func (mg *ProjectContainerregistryUser) GetWriteConnectionSecretToReference() *xpv1.SecretReference { +// GetWriteConnectionSecretToReference of this ContainerRegistryUser. +func (mg *ContainerRegistryUser) GetWriteConnectionSecretToReference() *xpv1.SecretReference { return mg.Spec.WriteConnectionSecretToReference } -// SetConditions of this ProjectContainerregistryUser. -func (mg *ProjectContainerregistryUser) SetConditions(c ...xpv1.Condition) { +// SetConditions of this ContainerRegistryUser. +func (mg *ContainerRegistryUser) SetConditions(c ...xpv1.Condition) { mg.Status.SetConditions(c...) } -// SetDeletionPolicy of this ProjectContainerregistryUser. -func (mg *ProjectContainerregistryUser) SetDeletionPolicy(r xpv1.DeletionPolicy) { +// SetDeletionPolicy of this ContainerRegistryUser. +func (mg *ContainerRegistryUser) SetDeletionPolicy(r xpv1.DeletionPolicy) { mg.Spec.DeletionPolicy = r } -// SetManagementPolicies of this ProjectContainerregistryUser. -func (mg *ProjectContainerregistryUser) SetManagementPolicies(r xpv1.ManagementPolicies) { +// SetManagementPolicies of this ContainerRegistryUser. +func (mg *ContainerRegistryUser) SetManagementPolicies(r xpv1.ManagementPolicies) { mg.Spec.ManagementPolicies = r } -// SetProviderConfigReference of this ProjectContainerregistryUser. -func (mg *ProjectContainerregistryUser) SetProviderConfigReference(r *xpv1.Reference) { +// SetProviderConfigReference of this ContainerRegistryUser. +func (mg *ContainerRegistryUser) SetProviderConfigReference(r *xpv1.Reference) { mg.Spec.ProviderConfigReference = r } -// SetPublishConnectionDetailsTo of this ProjectContainerregistryUser. -func (mg *ProjectContainerregistryUser) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { +// SetPublishConnectionDetailsTo of this ContainerRegistryUser. +func (mg *ContainerRegistryUser) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { mg.Spec.PublishConnectionDetailsTo = r } -// SetWriteConnectionSecretToReference of this ProjectContainerregistryUser. -func (mg *ProjectContainerregistryUser) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { +// SetWriteConnectionSecretToReference of this ContainerRegistryUser. +func (mg *ContainerRegistryUser) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } diff --git a/apis/registry/v1alpha1/zz_generated.managedlist.go b/apis/registry/v1alpha1/zz_generated.managedlist.go index 0163c83..b3505bd 100644 --- a/apis/registry/v1alpha1/zz_generated.managedlist.go +++ b/apis/registry/v1alpha1/zz_generated.managedlist.go @@ -7,8 +7,8 @@ package v1alpha1 import resource "github.com/crossplane/crossplane-runtime/pkg/resource" -// GetItems of this ProjectContainerregistryList. -func (l *ProjectContainerregistryList) GetItems() []resource.Managed { +// GetItems of this ContainerRegistryList. +func (l *ContainerRegistryList) GetItems() []resource.Managed { items := make([]resource.Managed, len(l.Items)) for i := range l.Items { items[i] = &l.Items[i] @@ -16,8 +16,8 @@ func (l *ProjectContainerregistryList) GetItems() []resource.Managed { return items } -// GetItems of this ProjectContainerregistryOidcList. -func (l *ProjectContainerregistryOidcList) GetItems() []resource.Managed { +// GetItems of this ContainerRegistryOIDCList. +func (l *ContainerRegistryOIDCList) GetItems() []resource.Managed { items := make([]resource.Managed, len(l.Items)) for i := range l.Items { items[i] = &l.Items[i] @@ -25,8 +25,8 @@ func (l *ProjectContainerregistryOidcList) GetItems() []resource.Managed { return items } -// GetItems of this ProjectContainerregistryUserList. -func (l *ProjectContainerregistryUserList) GetItems() []resource.Managed { +// GetItems of this ContainerRegistryUserList. +func (l *ContainerRegistryUserList) GetItems() []resource.Managed { items := make([]resource.Managed, len(l.Items)) for i := range l.Items { items[i] = &l.Items[i] diff --git a/apis/registry/v1alpha1/zz_generated.resolvers.go b/apis/registry/v1alpha1/zz_generated.resolvers.go new file mode 100644 index 0000000..4a8ebe4 --- /dev/null +++ b/apis/registry/v1alpha1/zz_generated.resolvers.go @@ -0,0 +1,65 @@ +/* +Copyright 2022 Upbound Inc. +*/ +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + reference "github.com/crossplane/crossplane-runtime/pkg/reference" + errors "github.com/pkg/errors" + client "sigs.k8s.io/controller-runtime/pkg/client" +) + +// ResolveReferences of this ContainerRegistryOIDC. +func (mg *ContainerRegistryOIDC) 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.RegistryID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.RegistryIDRef, + Selector: mg.Spec.ForProvider.RegistryIDSelector, + To: reference.To{ + List: &ContainerRegistryList{}, + Managed: &ContainerRegistry{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.RegistryID") + } + mg.Spec.ForProvider.RegistryID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.RegistryIDRef = rsp.ResolvedReference + + return nil +} + +// ResolveReferences of this ContainerRegistryUser. +func (mg *ContainerRegistryUser) 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.RegistryID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.RegistryIDRef, + Selector: mg.Spec.ForProvider.RegistryIDSelector, + To: reference.To{ + List: &ContainerRegistryList{}, + Managed: &ContainerRegistry{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.RegistryID") + } + mg.Spec.ForProvider.RegistryID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.RegistryIDRef = rsp.ResolvedReference + + return nil +} diff --git a/apis/registry/v1alpha1/zz_generated_terraformed.go b/apis/registry/v1alpha1/zz_generated_terraformed.go index c566eb2..bc5687a 100755 --- a/apis/registry/v1alpha1/zz_generated_terraformed.go +++ b/apis/registry/v1alpha1/zz_generated_terraformed.go @@ -17,18 +17,18 @@ import ( "github.com/crossplane/upjet/pkg/resource/json" ) -// GetTerraformResourceType returns Terraform resource type for this ProjectContainerregistry -func (mg *ProjectContainerregistry) GetTerraformResourceType() string { +// GetTerraformResourceType returns Terraform resource type for this ContainerRegistry +func (mg *ContainerRegistry) GetTerraformResourceType() string { return "ovh_cloud_project_containerregistry" } -// GetConnectionDetailsMapping for this ProjectContainerregistry -func (tr *ProjectContainerregistry) GetConnectionDetailsMapping() map[string]string { +// GetConnectionDetailsMapping for this ContainerRegistry +func (tr *ContainerRegistry) GetConnectionDetailsMapping() map[string]string { return nil } -// GetObservation of this ProjectContainerregistry -func (tr *ProjectContainerregistry) GetObservation() (map[string]any, error) { +// GetObservation of this ContainerRegistry +func (tr *ContainerRegistry) GetObservation() (map[string]any, error) { o, err := json.TFParser.Marshal(tr.Status.AtProvider) if err != nil { return nil, err @@ -37,8 +37,8 @@ func (tr *ProjectContainerregistry) GetObservation() (map[string]any, error) { return base, json.TFParser.Unmarshal(o, &base) } -// SetObservation for this ProjectContainerregistry -func (tr *ProjectContainerregistry) SetObservation(obs map[string]any) error { +// SetObservation for this ContainerRegistry +func (tr *ContainerRegistry) SetObservation(obs map[string]any) error { p, err := json.TFParser.Marshal(obs) if err != nil { return err @@ -46,16 +46,16 @@ func (tr *ProjectContainerregistry) SetObservation(obs map[string]any) error { return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) } -// GetID returns ID of underlying Terraform resource of this ProjectContainerregistry -func (tr *ProjectContainerregistry) GetID() string { +// GetID returns ID of underlying Terraform resource of this ContainerRegistry +func (tr *ContainerRegistry) GetID() string { if tr.Status.AtProvider.ID == nil { return "" } return *tr.Status.AtProvider.ID } -// GetParameters of this ProjectContainerregistry -func (tr *ProjectContainerregistry) GetParameters() (map[string]any, error) { +// GetParameters of this ContainerRegistry +func (tr *ContainerRegistry) GetParameters() (map[string]any, error) { p, err := json.TFParser.Marshal(tr.Spec.ForProvider) if err != nil { return nil, err @@ -64,8 +64,8 @@ func (tr *ProjectContainerregistry) GetParameters() (map[string]any, error) { return base, json.TFParser.Unmarshal(p, &base) } -// SetParameters for this ProjectContainerregistry -func (tr *ProjectContainerregistry) SetParameters(params map[string]any) error { +// SetParameters for this ContainerRegistry +func (tr *ContainerRegistry) SetParameters(params map[string]any) error { p, err := json.TFParser.Marshal(params) if err != nil { return err @@ -73,8 +73,8 @@ func (tr *ProjectContainerregistry) SetParameters(params map[string]any) error { return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) } -// GetInitParameters of this ProjectContainerregistry -func (tr *ProjectContainerregistry) GetInitParameters() (map[string]any, error) { +// GetInitParameters of this ContainerRegistry +func (tr *ContainerRegistry) GetInitParameters() (map[string]any, error) { p, err := json.TFParser.Marshal(tr.Spec.InitProvider) if err != nil { return nil, err @@ -83,10 +83,10 @@ func (tr *ProjectContainerregistry) GetInitParameters() (map[string]any, error) return base, json.TFParser.Unmarshal(p, &base) } -// LateInitialize this ProjectContainerregistry using its observed tfState. +// LateInitialize this ContainerRegistry using its observed tfState. // returns True if there are any spec changes for the resource. -func (tr *ProjectContainerregistry) LateInitialize(attrs []byte) (bool, error) { - params := &ProjectContainerregistryParameters{} +func (tr *ContainerRegistry) LateInitialize(attrs []byte) (bool, error) { + params := &ContainerRegistryParameters{} if err := json.TFParser.Unmarshal(attrs, params); err != nil { return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") } @@ -97,22 +97,22 @@ func (tr *ProjectContainerregistry) LateInitialize(attrs []byte) (bool, error) { } // GetTerraformSchemaVersion returns the associated Terraform schema version -func (tr *ProjectContainerregistry) GetTerraformSchemaVersion() int { +func (tr *ContainerRegistry) GetTerraformSchemaVersion() int { return 0 } -// GetTerraformResourceType returns Terraform resource type for this ProjectContainerregistryOidc -func (mg *ProjectContainerregistryOidc) GetTerraformResourceType() string { +// GetTerraformResourceType returns Terraform resource type for this ContainerRegistryOIDC +func (mg *ContainerRegistryOIDC) GetTerraformResourceType() string { return "ovh_cloud_project_containerregistry_oidc" } -// GetConnectionDetailsMapping for this ProjectContainerregistryOidc -func (tr *ProjectContainerregistryOidc) GetConnectionDetailsMapping() map[string]string { +// GetConnectionDetailsMapping for this ContainerRegistryOIDC +func (tr *ContainerRegistryOIDC) GetConnectionDetailsMapping() map[string]string { return map[string]string{"oidc_client_secret": "spec.forProvider.oidcClientSecretSecretRef"} } -// GetObservation of this ProjectContainerregistryOidc -func (tr *ProjectContainerregistryOidc) GetObservation() (map[string]any, error) { +// GetObservation of this ContainerRegistryOIDC +func (tr *ContainerRegistryOIDC) GetObservation() (map[string]any, error) { o, err := json.TFParser.Marshal(tr.Status.AtProvider) if err != nil { return nil, err @@ -121,8 +121,8 @@ func (tr *ProjectContainerregistryOidc) GetObservation() (map[string]any, error) return base, json.TFParser.Unmarshal(o, &base) } -// SetObservation for this ProjectContainerregistryOidc -func (tr *ProjectContainerregistryOidc) SetObservation(obs map[string]any) error { +// SetObservation for this ContainerRegistryOIDC +func (tr *ContainerRegistryOIDC) SetObservation(obs map[string]any) error { p, err := json.TFParser.Marshal(obs) if err != nil { return err @@ -130,16 +130,16 @@ func (tr *ProjectContainerregistryOidc) SetObservation(obs map[string]any) error return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) } -// GetID returns ID of underlying Terraform resource of this ProjectContainerregistryOidc -func (tr *ProjectContainerregistryOidc) GetID() string { +// GetID returns ID of underlying Terraform resource of this ContainerRegistryOIDC +func (tr *ContainerRegistryOIDC) GetID() string { if tr.Status.AtProvider.ID == nil { return "" } return *tr.Status.AtProvider.ID } -// GetParameters of this ProjectContainerregistryOidc -func (tr *ProjectContainerregistryOidc) GetParameters() (map[string]any, error) { +// GetParameters of this ContainerRegistryOIDC +func (tr *ContainerRegistryOIDC) GetParameters() (map[string]any, error) { p, err := json.TFParser.Marshal(tr.Spec.ForProvider) if err != nil { return nil, err @@ -148,8 +148,8 @@ func (tr *ProjectContainerregistryOidc) GetParameters() (map[string]any, error) return base, json.TFParser.Unmarshal(p, &base) } -// SetParameters for this ProjectContainerregistryOidc -func (tr *ProjectContainerregistryOidc) SetParameters(params map[string]any) error { +// SetParameters for this ContainerRegistryOIDC +func (tr *ContainerRegistryOIDC) SetParameters(params map[string]any) error { p, err := json.TFParser.Marshal(params) if err != nil { return err @@ -157,8 +157,8 @@ func (tr *ProjectContainerregistryOidc) SetParameters(params map[string]any) err return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) } -// GetInitParameters of this ProjectContainerregistryOidc -func (tr *ProjectContainerregistryOidc) GetInitParameters() (map[string]any, error) { +// GetInitParameters of this ContainerRegistryOIDC +func (tr *ContainerRegistryOIDC) GetInitParameters() (map[string]any, error) { p, err := json.TFParser.Marshal(tr.Spec.InitProvider) if err != nil { return nil, err @@ -167,10 +167,10 @@ func (tr *ProjectContainerregistryOidc) GetInitParameters() (map[string]any, err return base, json.TFParser.Unmarshal(p, &base) } -// LateInitialize this ProjectContainerregistryOidc using its observed tfState. +// LateInitialize this ContainerRegistryOIDC using its observed tfState. // returns True if there are any spec changes for the resource. -func (tr *ProjectContainerregistryOidc) LateInitialize(attrs []byte) (bool, error) { - params := &ProjectContainerregistryOidcParameters{} +func (tr *ContainerRegistryOIDC) LateInitialize(attrs []byte) (bool, error) { + params := &ContainerRegistryOIDCParameters{} if err := json.TFParser.Unmarshal(attrs, params); err != nil { return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") } @@ -181,22 +181,22 @@ func (tr *ProjectContainerregistryOidc) LateInitialize(attrs []byte) (bool, erro } // GetTerraformSchemaVersion returns the associated Terraform schema version -func (tr *ProjectContainerregistryOidc) GetTerraformSchemaVersion() int { +func (tr *ContainerRegistryOIDC) GetTerraformSchemaVersion() int { return 0 } -// GetTerraformResourceType returns Terraform resource type for this ProjectContainerregistryUser -func (mg *ProjectContainerregistryUser) GetTerraformResourceType() string { +// GetTerraformResourceType returns Terraform resource type for this ContainerRegistryUser +func (mg *ContainerRegistryUser) GetTerraformResourceType() string { return "ovh_cloud_project_containerregistry_user" } -// GetConnectionDetailsMapping for this ProjectContainerregistryUser -func (tr *ProjectContainerregistryUser) GetConnectionDetailsMapping() map[string]string { +// GetConnectionDetailsMapping for this ContainerRegistryUser +func (tr *ContainerRegistryUser) GetConnectionDetailsMapping() map[string]string { return map[string]string{"password": "status.atProvider.password"} } -// GetObservation of this ProjectContainerregistryUser -func (tr *ProjectContainerregistryUser) GetObservation() (map[string]any, error) { +// GetObservation of this ContainerRegistryUser +func (tr *ContainerRegistryUser) GetObservation() (map[string]any, error) { o, err := json.TFParser.Marshal(tr.Status.AtProvider) if err != nil { return nil, err @@ -205,8 +205,8 @@ func (tr *ProjectContainerregistryUser) GetObservation() (map[string]any, error) return base, json.TFParser.Unmarshal(o, &base) } -// SetObservation for this ProjectContainerregistryUser -func (tr *ProjectContainerregistryUser) SetObservation(obs map[string]any) error { +// SetObservation for this ContainerRegistryUser +func (tr *ContainerRegistryUser) SetObservation(obs map[string]any) error { p, err := json.TFParser.Marshal(obs) if err != nil { return err @@ -214,16 +214,16 @@ func (tr *ProjectContainerregistryUser) SetObservation(obs map[string]any) error return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) } -// GetID returns ID of underlying Terraform resource of this ProjectContainerregistryUser -func (tr *ProjectContainerregistryUser) GetID() string { +// GetID returns ID of underlying Terraform resource of this ContainerRegistryUser +func (tr *ContainerRegistryUser) GetID() string { if tr.Status.AtProvider.ID == nil { return "" } return *tr.Status.AtProvider.ID } -// GetParameters of this ProjectContainerregistryUser -func (tr *ProjectContainerregistryUser) GetParameters() (map[string]any, error) { +// GetParameters of this ContainerRegistryUser +func (tr *ContainerRegistryUser) GetParameters() (map[string]any, error) { p, err := json.TFParser.Marshal(tr.Spec.ForProvider) if err != nil { return nil, err @@ -232,8 +232,8 @@ func (tr *ProjectContainerregistryUser) GetParameters() (map[string]any, error) return base, json.TFParser.Unmarshal(p, &base) } -// SetParameters for this ProjectContainerregistryUser -func (tr *ProjectContainerregistryUser) SetParameters(params map[string]any) error { +// SetParameters for this ContainerRegistryUser +func (tr *ContainerRegistryUser) SetParameters(params map[string]any) error { p, err := json.TFParser.Marshal(params) if err != nil { return err @@ -241,8 +241,8 @@ func (tr *ProjectContainerregistryUser) SetParameters(params map[string]any) err return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) } -// GetInitParameters of this ProjectContainerregistryUser -func (tr *ProjectContainerregistryUser) GetInitParameters() (map[string]any, error) { +// GetInitParameters of this ContainerRegistryUser +func (tr *ContainerRegistryUser) GetInitParameters() (map[string]any, error) { p, err := json.TFParser.Marshal(tr.Spec.InitProvider) if err != nil { return nil, err @@ -251,10 +251,10 @@ func (tr *ProjectContainerregistryUser) GetInitParameters() (map[string]any, err return base, json.TFParser.Unmarshal(p, &base) } -// LateInitialize this ProjectContainerregistryUser using its observed tfState. +// LateInitialize this ContainerRegistryUser using its observed tfState. // returns True if there are any spec changes for the resource. -func (tr *ProjectContainerregistryUser) LateInitialize(attrs []byte) (bool, error) { - params := &ProjectContainerregistryUserParameters{} +func (tr *ContainerRegistryUser) LateInitialize(attrs []byte) (bool, error) { + params := &ContainerRegistryUserParameters{} if err := json.TFParser.Unmarshal(attrs, params); err != nil { return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") } @@ -265,6 +265,6 @@ func (tr *ProjectContainerregistryUser) LateInitialize(attrs []byte) (bool, erro } // GetTerraformSchemaVersion returns the associated Terraform schema version -func (tr *ProjectContainerregistryUser) GetTerraformSchemaVersion() int { +func (tr *ContainerRegistryUser) GetTerraformSchemaVersion() int { return 0 } diff --git a/config/external_name.go b/config/external_name.go index 5c6cdb7..0fb1fa6 100644 --- a/config/external_name.go +++ b/config/external_name.go @@ -133,10 +133,10 @@ var ExternalNameConfigs = map[string]config.ExternalName{ "ovh_cloud_project_kube": kubeIdentifierFromProvider, "ovh_cloud_project_kube_iprestrictions": kubeIdentifierFromProvider, "ovh_cloud_project_kube_nodepool": kubePoolIdentifierFromProvider, - "ovh_cloud_project_kube_oidc": config.NameAsIdentifier, - "ovh_cloud_project_containerregistry": config.NameAsIdentifier, - "ovh_cloud_project_containerregistry_oidc": config.NameAsIdentifier, - "ovh_cloud_project_containerregistry_user": config.NameAsIdentifier, + "ovh_cloud_project_kube_oidc": config.IdentifierFromProvider, + "ovh_cloud_project_containerregistry": config.IdentifierFromProvider, + "ovh_cloud_project_containerregistry_oidc": config.IdentifierFromProvider, + "ovh_cloud_project_containerregistry_user": config.IdentifierFromProvider, "ovh_dedicated_nasha_partition": config.NameAsIdentifier, "ovh_dedicated_nasha_partition_access": config.NameAsIdentifier, "ovh_dedicated_nasha_partition_snapshot": config.NameAsIdentifier, diff --git a/config/registry/config.go b/config/registry/config.go index 405e0e2..9b65cc9 100644 --- a/config/registry/config.go +++ b/config/registry/config.go @@ -10,11 +10,30 @@ const ( func Configure(p *config.Provider) { p.AddResourceConfigurator("ovh_cloud_project_containerregistry", func(r *config.Resource) { r.ShortGroup = shortGroup + r.Kind = "ContainerRegistry" + r.UseAsync = true + }) p.AddResourceConfigurator("ovh_cloud_project_containerregistry_oidc", func(r *config.Resource) { r.ShortGroup = shortGroup + r.Kind = "ContainerRegistryOIDC" + r.References["registry_id"] = config.Reference{ + Type: "github.com/edixos/provider-ovh/apis/registry/v1alpha1.ContainerRegistry", + } }) p.AddResourceConfigurator("ovh_cloud_project_containerregistry_user", func(r *config.Resource) { r.ShortGroup = shortGroup + r.Kind = "ContainerRegistryUser" + r.References["registry_id"] = config.Reference{ + Type: "github.com/edixos/provider-ovh/apis/registry/v1alpha1.ContainerRegistry", + } + r.Sensitive.AdditionalConnectionDetailsFn = func(attr map[string]any) (map[string][]byte, error) { + conn := map[string][]byte{} + if a, ok := attr["login"].(string); ok { + conn["login"] = []byte(a) + } + return conn, nil + } }) + } diff --git a/examples/registry/container_registry.yaml b/examples/registry/container_registry.yaml new file mode 100644 index 0000000..d19d8d6 --- /dev/null +++ b/examples/registry/container_registry.yaml @@ -0,0 +1,16 @@ +apiVersion: registry.ovh.edixos.io/v1alpha1 +kind: ContainerRegistry +metadata: + name: hello-edixos +spec: + providerConfigRef: + name: default + forProvider: + name: "hello-edixos" + region: DE + serviceName: 980cbcf06e6a4e6e8a91a7d125b26bba + # c5ddc763-be75-48f7-b7ec-e923ca040bee MEDIUM + # 0dae73df-6c49-47bf-a9d5-6b866c74ac54 LARGE + # planId is retrieved from the ovh api https://api.ovh.com/console/#/cloud/project/%7BserviceName%7D/capabilities/containerRegistry~GET + # Still waiting this issue: https://github.com/crossplane/upjet/issues/323 + planId: "9f728ba5-998b-4401-ab0f-497cd8bc6a89" # SMALL diff --git a/examples/registry/user.yaml b/examples/registry/user.yaml new file mode 100644 index 0000000..36aa6bb --- /dev/null +++ b/examples/registry/user.yaml @@ -0,0 +1,16 @@ +apiVersion: registry.ovh.edixos.io/v1alpha1 +kind: ContainerRegistryUser +metadata: + name: hello-edixos +spec: + providerConfigRef: + name: default + forProvider: + email: ikaboubi@edixos.com + login: ismail + serviceName: 980cbcf06e6a4e6e8a91a7d125b26bba + registryIdRef: + name: hello-edixos + writeConnectionSecretToRef: + name: registry-password + namespace: default \ No newline at end of file diff --git a/internal/controller/kube/projectkubeoidc/zz_controller.go b/internal/controller/kube/projectkubeoidc/zz_controller.go index 2979a20..b1e1a4e 100755 --- a/internal/controller/kube/projectkubeoidc/zz_controller.go +++ b/internal/controller/kube/projectkubeoidc/zz_controller.go @@ -31,7 +31,6 @@ import ( func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { name := managed.ControllerName(v1alpha1.ProjectKubeOidc_GroupVersionKind.String()) var initializers managed.InitializerChain - initializers = append(initializers, managed.NewNameAsExternalName(mgr.GetClient())) cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} if o.SecretStoreConfigGVK != nil { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) diff --git a/internal/controller/registry/projectcontainerregistry/zz_controller.go b/internal/controller/registry/containerregistry/zz_controller.go similarity index 81% rename from internal/controller/registry/projectcontainerregistry/zz_controller.go rename to internal/controller/registry/containerregistry/zz_controller.go index e00c30e..3e297d6 100755 --- a/internal/controller/registry/projectcontainerregistry/zz_controller.go +++ b/internal/controller/registry/containerregistry/zz_controller.go @@ -8,7 +8,7 @@ Copyright 2022 Upbound Inc. // Code generated by upjet. DO NOT EDIT. -package projectcontainerregistry +package containerregistry import ( "time" @@ -27,17 +27,16 @@ import ( features "github.com/edixos/provider-ovh/internal/features" ) -// Setup adds a controller that reconciles ProjectContainerregistry managed resources. +// Setup adds a controller that reconciles ContainerRegistry managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1alpha1.ProjectContainerregistry_GroupVersionKind.String()) + name := managed.ControllerName(v1alpha1.ContainerRegistry_GroupVersionKind.String()) var initializers managed.InitializerChain - initializers = append(initializers, managed.NewNameAsExternalName(mgr.GetClient())) cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} if o.SecretStoreConfigGVK != nil { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } - eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.ProjectContainerregistry_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.ProjectContainerregistry_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.ContainerRegistry_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.ContainerRegistry_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["ovh_cloud_project_containerregistry"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), tjcontroller.WithCallbackProvider(ac), @@ -56,12 +55,12 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { if o.Features.Enabled(features.EnableBetaManagementPolicies) { opts = append(opts, managed.WithManagementPolicies()) } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.ProjectContainerregistry_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.ContainerRegistry_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1alpha1.ProjectContainerregistry{}, eventHandler). + Watches(&v1alpha1.ContainerRegistry{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/registry/projectcontainerregistryoidc/zz_controller.go b/internal/controller/registry/containerregistryoidc/zz_controller.go similarity index 81% rename from internal/controller/registry/projectcontainerregistryoidc/zz_controller.go rename to internal/controller/registry/containerregistryoidc/zz_controller.go index 8cd8946..92d5845 100755 --- a/internal/controller/registry/projectcontainerregistryoidc/zz_controller.go +++ b/internal/controller/registry/containerregistryoidc/zz_controller.go @@ -8,7 +8,7 @@ Copyright 2022 Upbound Inc. // Code generated by upjet. DO NOT EDIT. -package projectcontainerregistryoidc +package containerregistryoidc import ( "time" @@ -27,17 +27,16 @@ import ( features "github.com/edixos/provider-ovh/internal/features" ) -// Setup adds a controller that reconciles ProjectContainerregistryOidc managed resources. +// Setup adds a controller that reconciles ContainerRegistryOIDC managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1alpha1.ProjectContainerregistryOidc_GroupVersionKind.String()) + name := managed.ControllerName(v1alpha1.ContainerRegistryOIDC_GroupVersionKind.String()) var initializers managed.InitializerChain - initializers = append(initializers, managed.NewNameAsExternalName(mgr.GetClient())) cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} if o.SecretStoreConfigGVK != nil { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } - eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.ProjectContainerregistryOidc_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.ProjectContainerregistryOidc_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.ContainerRegistryOIDC_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.ContainerRegistryOIDC_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["ovh_cloud_project_containerregistry_oidc"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), tjcontroller.WithCallbackProvider(ac), @@ -56,12 +55,12 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { if o.Features.Enabled(features.EnableBetaManagementPolicies) { opts = append(opts, managed.WithManagementPolicies()) } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.ProjectContainerregistryOidc_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.ContainerRegistryOIDC_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1alpha1.ProjectContainerregistryOidc{}, eventHandler). + Watches(&v1alpha1.ContainerRegistryOIDC{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/registry/projectcontainerregistryuser/zz_controller.go b/internal/controller/registry/containerregistryuser/zz_controller.go similarity index 81% rename from internal/controller/registry/projectcontainerregistryuser/zz_controller.go rename to internal/controller/registry/containerregistryuser/zz_controller.go index 2ce8594..a2da9d5 100755 --- a/internal/controller/registry/projectcontainerregistryuser/zz_controller.go +++ b/internal/controller/registry/containerregistryuser/zz_controller.go @@ -8,7 +8,7 @@ Copyright 2022 Upbound Inc. // Code generated by upjet. DO NOT EDIT. -package projectcontainerregistryuser +package containerregistryuser import ( "time" @@ -27,17 +27,16 @@ import ( features "github.com/edixos/provider-ovh/internal/features" ) -// Setup adds a controller that reconciles ProjectContainerregistryUser managed resources. +// Setup adds a controller that reconciles ContainerRegistryUser managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1alpha1.ProjectContainerregistryUser_GroupVersionKind.String()) + name := managed.ControllerName(v1alpha1.ContainerRegistryUser_GroupVersionKind.String()) var initializers managed.InitializerChain - initializers = append(initializers, managed.NewNameAsExternalName(mgr.GetClient())) cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} if o.SecretStoreConfigGVK != nil { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } - eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.ProjectContainerregistryUser_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.ProjectContainerregistryUser_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.ContainerRegistryUser_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.ContainerRegistryUser_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["ovh_cloud_project_containerregistry_user"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), tjcontroller.WithCallbackProvider(ac), @@ -56,12 +55,12 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { if o.Features.Enabled(features.EnableBetaManagementPolicies) { opts = append(opts, managed.WithManagementPolicies()) } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.ProjectContainerregistryUser_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.ContainerRegistryUser_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1alpha1.ProjectContainerregistryUser{}, eventHandler). + Watches(&v1alpha1.ContainerRegistryUser{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/zz_setup.go b/internal/controller/zz_setup.go index ded3039..58fde5d 100755 --- a/internal/controller/zz_setup.go +++ b/internal/controller/zz_setup.go @@ -78,9 +78,9 @@ import ( privatedatabaseusergrant "github.com/edixos/provider-ovh/internal/controller/privatesql/privatedatabaseusergrant" privatedatabasewhitelist "github.com/edixos/provider-ovh/internal/controller/privatesql/privatedatabasewhitelist" providerconfig "github.com/edixos/provider-ovh/internal/controller/providerconfig" - projectcontainerregistry "github.com/edixos/provider-ovh/internal/controller/registry/projectcontainerregistry" - projectcontainerregistryoidc "github.com/edixos/provider-ovh/internal/controller/registry/projectcontainerregistryoidc" - projectcontainerregistryuser "github.com/edixos/provider-ovh/internal/controller/registry/projectcontainerregistryuser" + containerregistry "github.com/edixos/provider-ovh/internal/controller/registry/containerregistry" + containerregistryoidc "github.com/edixos/provider-ovh/internal/controller/registry/containerregistryoidc" + containerregistryuser "github.com/edixos/provider-ovh/internal/controller/registry/containerregistryuser" projectregionstoragepresign "github.com/edixos/provider-ovh/internal/controller/storage/projectregionstoragepresign" projectworkflowbackup "github.com/edixos/provider-ovh/internal/controller/vminstances/projectworkflowbackup" cloudproject "github.com/edixos/provider-ovh/internal/controller/vrack/cloudproject" @@ -164,9 +164,9 @@ func Setup(mgr ctrl.Manager, o controller.Options) error { privatedatabaseusergrant.Setup, privatedatabasewhitelist.Setup, providerconfig.Setup, - projectcontainerregistry.Setup, - projectcontainerregistryoidc.Setup, - projectcontainerregistryuser.Setup, + containerregistry.Setup, + containerregistryoidc.Setup, + containerregistryuser.Setup, projectregionstoragepresign.Setup, projectworkflowbackup.Setup, cloudproject.Setup, diff --git a/package/crds/registry.ovh.edixos.io_projectcontainerregistries.yaml b/package/crds/registry.ovh.edixos.io_containerregistries.yaml similarity index 93% rename from package/crds/registry.ovh.edixos.io_projectcontainerregistries.yaml rename to package/crds/registry.ovh.edixos.io_containerregistries.yaml index 6a9ebae..5b4bfda 100644 --- a/package/crds/registry.ovh.edixos.io_projectcontainerregistries.yaml +++ b/package/crds/registry.ovh.edixos.io_containerregistries.yaml @@ -4,7 +4,7 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.13.0 - name: projectcontainerregistries.registry.ovh.edixos.io + name: containerregistries.registry.ovh.edixos.io spec: group: registry.ovh.edixos.io names: @@ -12,10 +12,10 @@ spec: - crossplane - managed - ovh - kind: ProjectContainerregistry - listKind: ProjectContainerregistryList - plural: projectcontainerregistries - singular: projectcontainerregistry + kind: ContainerRegistry + listKind: ContainerRegistryList + plural: containerregistries + singular: containerregistry scope: Cluster versions: - additionalPrinterColumns: @@ -34,8 +34,8 @@ spec: name: v1alpha1 schema: openAPIV3Schema: - description: ProjectContainerregistry is the Schema for the ProjectContainerregistrys - API. + description: ContainerRegistry is the Schema for the ContainerRegistrys API. + properties: apiVersion: description: 'APIVersion defines the versioned schema of this representation @@ -50,8 +50,7 @@ spec: metadata: type: object spec: - description: ProjectContainerregistrySpec defines the desired state of - ProjectContainerregistry + description: ContainerRegistrySpec defines the desired state of ContainerRegistry properties: deletionPolicy: default: Delete @@ -68,6 +67,9 @@ spec: type: string forProvider: properties: + name: + description: Registry name + type: string planId: description: Plan ID of the registry. type: string @@ -89,6 +91,9 @@ spec: for example because of an external controller is managing them, like an autoscaler. properties: + name: + description: Registry name + type: string planId: description: Plan ID of the registry. type: string @@ -259,6 +264,10 @@ spec: - forProvider type: object x-kubernetes-validations: + - message: spec.forProvider.name is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.name) + || (has(self.initProvider) && has(self.initProvider.name))' - message: spec.forProvider.region is a required parameter rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies || ''Update'' in self.managementPolicies) || has(self.forProvider.region) @@ -268,8 +277,7 @@ spec: || ''Update'' in self.managementPolicies) || has(self.forProvider.serviceName) || (has(self.initProvider) && has(self.initProvider.serviceName))' status: - description: ProjectContainerregistryStatus defines the observed state - of ProjectContainerregistry. + description: ContainerRegistryStatus defines the observed state of ContainerRegistry. properties: atProvider: properties: @@ -278,6 +286,9 @@ spec: type: string id: type: string + name: + description: Registry name + type: string plan: description: Plan of the registry items: diff --git a/package/crds/registry.ovh.edixos.io_projectcontainerregistryoidcs.yaml b/package/crds/registry.ovh.edixos.io_containerregistryoidcs.yaml similarity index 80% rename from package/crds/registry.ovh.edixos.io_projectcontainerregistryoidcs.yaml rename to package/crds/registry.ovh.edixos.io_containerregistryoidcs.yaml index 492b550..570b1f4 100644 --- a/package/crds/registry.ovh.edixos.io_projectcontainerregistryoidcs.yaml +++ b/package/crds/registry.ovh.edixos.io_containerregistryoidcs.yaml @@ -4,7 +4,7 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.13.0 - name: projectcontainerregistryoidcs.registry.ovh.edixos.io + name: containerregistryoidcs.registry.ovh.edixos.io spec: group: registry.ovh.edixos.io names: @@ -12,10 +12,10 @@ spec: - crossplane - managed - ovh - kind: ProjectContainerregistryOidc - listKind: ProjectContainerregistryOidcList - plural: projectcontainerregistryoidcs - singular: projectcontainerregistryoidc + kind: ContainerRegistryOIDC + listKind: ContainerRegistryOIDCList + plural: containerregistryoidcs + singular: containerregistryoidc scope: Cluster versions: - additionalPrinterColumns: @@ -34,7 +34,7 @@ spec: name: v1alpha1 schema: openAPIV3Schema: - description: ProjectContainerregistryOidc is the Schema for the ProjectContainerregistryOidcs + description: ContainerRegistryOIDC is the Schema for the ContainerRegistryOIDCs API. properties: apiVersion: @@ -50,8 +50,7 @@ spec: metadata: type: object spec: - description: ProjectContainerregistryOidcSpec defines the desired state - of ProjectContainerregistryOidc + description: ContainerRegistryOIDCSpec defines the desired state of ContainerRegistryOIDC properties: deletionPolicy: default: Delete @@ -108,6 +107,81 @@ spec: type: boolean registryId: type: string + registryIdRef: + description: Reference to a ContainerRegistry in registry to populate + registryId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + registryIdSelector: + description: Selector for a ContainerRegistry in registry to populate + registryId. + properties: + matchControllerRef: + description: MatchControllerRef ensures an object with the + same controller reference as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object serviceName: type: string type: object @@ -143,8 +217,6 @@ spec: type: string oidcVerifyCert: type: boolean - registryId: - type: string serviceName: type: string type: object @@ -328,17 +400,13 @@ spec: rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies || ''Update'' in self.managementPolicies) || has(self.forProvider.oidcScope) || (has(self.initProvider) && has(self.initProvider.oidcScope))' - - message: spec.forProvider.registryId is a required parameter - rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies - || ''Update'' in self.managementPolicies) || has(self.forProvider.registryId) - || (has(self.initProvider) && has(self.initProvider.registryId))' - message: spec.forProvider.serviceName is a required parameter rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies || ''Update'' in self.managementPolicies) || has(self.forProvider.serviceName) || (has(self.initProvider) && has(self.initProvider.serviceName))' status: - description: ProjectContainerregistryOidcStatus defines the observed state - of ProjectContainerregistryOidc. + description: ContainerRegistryOIDCStatus defines the observed state of + ContainerRegistryOIDC. properties: atProvider: properties: diff --git a/package/crds/registry.ovh.edixos.io_projectcontainerregistryusers.yaml b/package/crds/registry.ovh.edixos.io_containerregistryusers.yaml similarity index 78% rename from package/crds/registry.ovh.edixos.io_projectcontainerregistryusers.yaml rename to package/crds/registry.ovh.edixos.io_containerregistryusers.yaml index b2c40c0..8268b37 100644 --- a/package/crds/registry.ovh.edixos.io_projectcontainerregistryusers.yaml +++ b/package/crds/registry.ovh.edixos.io_containerregistryusers.yaml @@ -4,7 +4,7 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.13.0 - name: projectcontainerregistryusers.registry.ovh.edixos.io + name: containerregistryusers.registry.ovh.edixos.io spec: group: registry.ovh.edixos.io names: @@ -12,10 +12,10 @@ spec: - crossplane - managed - ovh - kind: ProjectContainerregistryUser - listKind: ProjectContainerregistryUserList - plural: projectcontainerregistryusers - singular: projectcontainerregistryuser + kind: ContainerRegistryUser + listKind: ContainerRegistryUserList + plural: containerregistryusers + singular: containerregistryuser scope: Cluster versions: - additionalPrinterColumns: @@ -34,7 +34,7 @@ spec: name: v1alpha1 schema: openAPIV3Schema: - description: ProjectContainerregistryUser is the Schema for the ProjectContainerregistryUsers + description: ContainerRegistryUser is the Schema for the ContainerRegistryUsers API. properties: apiVersion: @@ -50,8 +50,7 @@ spec: metadata: type: object spec: - description: ProjectContainerregistryUserSpec defines the desired state - of ProjectContainerregistryUser + description: ContainerRegistryUserSpec defines the desired state of ContainerRegistryUser properties: deletionPolicy: default: Delete @@ -77,6 +76,81 @@ spec: registryId: description: RegistryID type: string + registryIdRef: + description: Reference to a ContainerRegistry in registry to populate + registryId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + registryIdSelector: + description: Selector for a ContainerRegistry in registry to populate + registryId. + properties: + matchControllerRef: + description: MatchControllerRef ensures an object with the + same controller reference as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object serviceName: description: Service name type: string @@ -99,9 +173,6 @@ spec: login: description: Registry name type: string - registryId: - description: RegistryID - type: string serviceName: description: Service name type: string @@ -275,17 +346,13 @@ spec: rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies || ''Update'' in self.managementPolicies) || has(self.forProvider.login) || (has(self.initProvider) && has(self.initProvider.login))' - - message: spec.forProvider.registryId is a required parameter - rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies - || ''Update'' in self.managementPolicies) || has(self.forProvider.registryId) - || (has(self.initProvider) && has(self.initProvider.registryId))' - message: spec.forProvider.serviceName is a required parameter rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies || ''Update'' in self.managementPolicies) || has(self.forProvider.serviceName) || (has(self.initProvider) && has(self.initProvider.serviceName))' status: - description: ProjectContainerregistryUserStatus defines the observed state - of ProjectContainerregistryUser. + description: ContainerRegistryUserStatus defines the observed state of + ContainerRegistryUser. properties: atProvider: properties: