diff --git a/apis/cce/v1beta1/zz_generated.deepcopy.go b/apis/cce/v1beta1/zz_generated.deepcopy.go index 550fbb20..f31a526c 100644 --- a/apis/cce/v1beta1/zz_generated.deepcopy.go +++ b/apis/cce/v1beta1/zz_generated.deepcopy.go @@ -1832,235 +1832,6 @@ func (in *NodeTaintsParameters) DeepCopy() *NodeTaintsParameters { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Pvc) DeepCopyInto(out *Pvc) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Pvc. -func (in *Pvc) DeepCopy() *Pvc { - if in == nil { - return nil - } - out := new(Pvc) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Pvc) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PvcList) DeepCopyInto(out *PvcList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Pvc, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PvcList. -func (in *PvcList) DeepCopy() *PvcList { - if in == nil { - return nil - } - out := new(PvcList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PvcList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PvcObservation) DeepCopyInto(out *PvcObservation) { - *out = *in - if in.CreationTimestamp != nil { - in, out := &in.CreationTimestamp, &out.CreationTimestamp - *out = new(string) - **out = **in - } - if in.ID != nil { - in, out := &in.ID, &out.ID - *out = new(string) - **out = **in - } - if in.Status != nil { - in, out := &in.Status, &out.Status - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PvcObservation. -func (in *PvcObservation) DeepCopy() *PvcObservation { - if in == nil { - return nil - } - out := new(PvcObservation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PvcParameters) DeepCopyInto(out *PvcParameters) { - *out = *in - if in.AccessModes != nil { - in, out := &in.AccessModes, &out.AccessModes - *out = make([]*string, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(string) - **out = **in - } - } - } - if in.Annotations != nil { - in, out := &in.Annotations, &out.Annotations - *out = make(map[string]*string, len(*in)) - for key, val := range *in { - var outVal *string - if val == nil { - (*out)[key] = nil - } else { - in, out := &val, &outVal - *out = new(string) - **out = **in - } - (*out)[key] = outVal - } - } - if in.ClusterID != nil { - in, out := &in.ClusterID, &out.ClusterID - *out = new(string) - **out = **in - } - if in.ClusterIDRef != nil { - in, out := &in.ClusterIDRef, &out.ClusterIDRef - *out = new(v1.Reference) - (*in).DeepCopyInto(*out) - } - if in.ClusterIDSelector != nil { - in, out := &in.ClusterIDSelector, &out.ClusterIDSelector - *out = new(v1.Selector) - (*in).DeepCopyInto(*out) - } - if in.Labels != nil { - in, out := &in.Labels, &out.Labels - *out = make(map[string]*string, len(*in)) - for key, val := range *in { - var outVal *string - if val == nil { - (*out)[key] = nil - } else { - in, out := &val, &outVal - *out = new(string) - **out = **in - } - (*out)[key] = outVal - } - } - if in.Name != nil { - in, out := &in.Name, &out.Name - *out = new(string) - **out = **in - } - if in.Namespace != nil { - in, out := &in.Namespace, &out.Namespace - *out = new(string) - **out = **in - } - if in.NamespaceRef != nil { - in, out := &in.NamespaceRef, &out.NamespaceRef - *out = new(v1.Reference) - (*in).DeepCopyInto(*out) - } - if in.NamespaceSelector != nil { - in, out := &in.NamespaceSelector, &out.NamespaceSelector - *out = new(v1.Selector) - (*in).DeepCopyInto(*out) - } - if in.Region != nil { - in, out := &in.Region, &out.Region - *out = new(string) - **out = **in - } - if in.Storage != nil { - in, out := &in.Storage, &out.Storage - *out = new(string) - **out = **in - } - if in.StorageClassName != nil { - in, out := &in.StorageClassName, &out.StorageClassName - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PvcParameters. -func (in *PvcParameters) DeepCopy() *PvcParameters { - if in == nil { - return nil - } - out := new(PvcParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PvcSpec) DeepCopyInto(out *PvcSpec) { - *out = *in - in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) - in.ForProvider.DeepCopyInto(&out.ForProvider) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PvcSpec. -func (in *PvcSpec) DeepCopy() *PvcSpec { - if in == nil { - return nil - } - out := new(PvcSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PvcStatus) DeepCopyInto(out *PvcStatus) { - *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) - in.AtProvider.DeepCopyInto(&out.AtProvider) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PvcStatus. -func (in *PvcStatus) DeepCopy() *PvcStatus { - if in == nil { - return nil - } - out := new(PvcStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RootVolumeObservation) DeepCopyInto(out *RootVolumeObservation) { *out = *in diff --git a/apis/cce/v1beta1/zz_generated.managed.go b/apis/cce/v1beta1/zz_generated.managed.go index e11ffd63..617452f0 100644 --- a/apis/cce/v1beta1/zz_generated.managed.go +++ b/apis/cce/v1beta1/zz_generated.managed.go @@ -336,69 +336,3 @@ func (mg *NodePool) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetai func (mg *NodePool) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } - -// GetCondition of this Pvc. -func (mg *Pvc) GetCondition(ct xpv1.ConditionType) xpv1.Condition { - return mg.Status.GetCondition(ct) -} - -// GetDeletionPolicy of this Pvc. -func (mg *Pvc) GetDeletionPolicy() xpv1.DeletionPolicy { - return mg.Spec.DeletionPolicy -} - -// GetProviderConfigReference of this Pvc. -func (mg *Pvc) GetProviderConfigReference() *xpv1.Reference { - return mg.Spec.ProviderConfigReference -} - -/* -GetProviderReference of this Pvc. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *Pvc) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - -// GetPublishConnectionDetailsTo of this Pvc. -func (mg *Pvc) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { - return mg.Spec.PublishConnectionDetailsTo -} - -// GetWriteConnectionSecretToReference of this Pvc. -func (mg *Pvc) GetWriteConnectionSecretToReference() *xpv1.SecretReference { - return mg.Spec.WriteConnectionSecretToReference -} - -// SetConditions of this Pvc. -func (mg *Pvc) SetConditions(c ...xpv1.Condition) { - mg.Status.SetConditions(c...) -} - -// SetDeletionPolicy of this Pvc. -func (mg *Pvc) SetDeletionPolicy(r xpv1.DeletionPolicy) { - mg.Spec.DeletionPolicy = r -} - -// SetProviderConfigReference of this Pvc. -func (mg *Pvc) SetProviderConfigReference(r *xpv1.Reference) { - mg.Spec.ProviderConfigReference = r -} - -/* -SetProviderReference of this Pvc. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *Pvc) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - -// SetPublishConnectionDetailsTo of this Pvc. -func (mg *Pvc) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { - mg.Spec.PublishConnectionDetailsTo = r -} - -// SetWriteConnectionSecretToReference of this Pvc. -func (mg *Pvc) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { - mg.Spec.WriteConnectionSecretToReference = r -} diff --git a/apis/cce/v1beta1/zz_generated.managedlist.go b/apis/cce/v1beta1/zz_generated.managedlist.go index 5649fe4e..295330d6 100644 --- a/apis/cce/v1beta1/zz_generated.managedlist.go +++ b/apis/cce/v1beta1/zz_generated.managedlist.go @@ -51,12 +51,3 @@ func (l *NodePoolList) GetItems() []resource.Managed { } return items } - -// GetItems of this PvcList. -func (l *PvcList) GetItems() []resource.Managed { - items := make([]resource.Managed, len(l.Items)) - for i := range l.Items { - items[i] = &l.Items[i] - } - return items -} diff --git a/apis/cce/v1beta1/zz_generated.resolvers.go b/apis/cce/v1beta1/zz_generated.resolvers.go index 1199627e..007c44b6 100644 --- a/apis/cce/v1beta1/zz_generated.resolvers.go +++ b/apis/cce/v1beta1/zz_generated.resolvers.go @@ -311,45 +311,3 @@ func (mg *NodePool) ResolveReferences(ctx context.Context, c client.Reader) erro return nil } - -// ResolveReferences of this Pvc. -func (mg *Pvc) 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.ClusterID), - Extract: reference.ExternalName(), - Reference: mg.Spec.ForProvider.ClusterIDRef, - Selector: mg.Spec.ForProvider.ClusterIDSelector, - To: reference.To{ - List: &ClusterList{}, - Managed: &Cluster{}, - }, - }) - if err != nil { - return errors.Wrap(err, "mg.Spec.ForProvider.ClusterID") - } - mg.Spec.ForProvider.ClusterID = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.ForProvider.ClusterIDRef = rsp.ResolvedReference - - rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.Namespace), - Extract: reference.ExternalName(), - Reference: mg.Spec.ForProvider.NamespaceRef, - Selector: mg.Spec.ForProvider.NamespaceSelector, - To: reference.To{ - List: &CCENameSpaceList{}, - Managed: &CCENameSpace{}, - }, - }) - if err != nil { - return errors.Wrap(err, "mg.Spec.ForProvider.Namespace") - } - mg.Spec.ForProvider.Namespace = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.ForProvider.NamespaceRef = rsp.ResolvedReference - - return nil -} diff --git a/apis/cce/v1beta1/zz_generated_terraformed.go b/apis/cce/v1beta1/zz_generated_terraformed.go index f1977dd4..c761f579 100755 --- a/apis/cce/v1beta1/zz_generated_terraformed.go +++ b/apis/cce/v1beta1/zz_generated_terraformed.go @@ -382,77 +382,3 @@ func (tr *Node) LateInitialize(attrs []byte) (bool, error) { func (tr *Node) GetTerraformSchemaVersion() int { return 0 } - -// GetTerraformResourceType returns Terraform resource type for this Pvc -func (mg *Pvc) GetTerraformResourceType() string { - return "flexibleengine_cce_pvc" -} - -// GetConnectionDetailsMapping for this Pvc -func (tr *Pvc) GetConnectionDetailsMapping() map[string]string { - return nil -} - -// GetObservation of this Pvc -func (tr *Pvc) GetObservation() (map[string]any, error) { - o, err := json.TFParser.Marshal(tr.Status.AtProvider) - if err != nil { - return nil, err - } - base := map[string]any{} - return base, json.TFParser.Unmarshal(o, &base) -} - -// SetObservation for this Pvc -func (tr *Pvc) SetObservation(obs map[string]any) error { - p, err := json.TFParser.Marshal(obs) - if err != nil { - return err - } - return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) -} - -// GetID returns ID of underlying Terraform resource of this Pvc -func (tr *Pvc) GetID() string { - if tr.Status.AtProvider.ID == nil { - return "" - } - return *tr.Status.AtProvider.ID -} - -// GetParameters of this Pvc -func (tr *Pvc) GetParameters() (map[string]any, error) { - p, err := json.TFParser.Marshal(tr.Spec.ForProvider) - if err != nil { - return nil, err - } - base := map[string]any{} - return base, json.TFParser.Unmarshal(p, &base) -} - -// SetParameters for this Pvc -func (tr *Pvc) SetParameters(params map[string]any) error { - p, err := json.TFParser.Marshal(params) - if err != nil { - return err - } - return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) -} - -// LateInitialize this Pvc using its observed tfState. -// returns True if there are any spec changes for the resource. -func (tr *Pvc) LateInitialize(attrs []byte) (bool, error) { - params := &PvcParameters{} - if err := json.TFParser.Unmarshal(attrs, params); err != nil { - return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") - } - opts := []resource.GenericLateInitializerOption{resource.WithZeroValueJSONOmitEmptyFilter(resource.CNameWildcard)} - - li := resource.NewGenericLateInitializer(opts...) - return li.LateInitialize(&tr.Spec.ForProvider, params) -} - -// GetTerraformSchemaVersion returns the associated Terraform schema version -func (tr *Pvc) GetTerraformSchemaVersion() int { - return 0 -} diff --git a/apis/cce/v1beta1/zz_pvc_types.go b/apis/cce/v1beta1/zz_pvc_types.go deleted file mode 100755 index 0e93331e..00000000 --- a/apis/cce/v1beta1/zz_pvc_types.go +++ /dev/null @@ -1,141 +0,0 @@ -/* -Copyright 2022 Upbound Inc. -*/ - -// Code generated by upjet. DO NOT EDIT. - -package v1beta1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" - - v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" -) - -type PvcObservation struct { - - // The server time when PVC was created. - CreationTimestamp *string `json:"creationTimestamp,omitempty" tf:"creation_timestamp,omitempty"` - - // The PVC ID in UUID format. - ID *string `json:"id,omitempty" tf:"id,omitempty"` - - // The current phase of the PVC. - Status *string `json:"status,omitempty" tf:"status,omitempty"` -} - -type PvcParameters struct { - - // Specifies the desired access modes the volume should have. - // The valid values are as follows: - // +kubebuilder:validation:Required - AccessModes []*string `json:"accessModes" tf:"access_modes,omitempty"` - - // Specifies the unstructured key value map for external parameters. - // Changing this will create a new PVC resource. - // +kubebuilder:validation:Optional - Annotations map[string]*string `json:"annotations,omitempty" tf:"annotations,omitempty"` - - // Specifies the cluster ID to which the CCE PVC belongs. - // +crossplane:generate:reference:type=Cluster - // +kubebuilder:validation:Optional - ClusterID *string `json:"clusterId,omitempty" tf:"cluster_id,omitempty"` - - // Reference to a Cluster to populate clusterId. - // +kubebuilder:validation:Optional - ClusterIDRef *v1.Reference `json:"clusterIdRef,omitempty" tf:"-"` - - // Selector for a Cluster to populate clusterId. - // +kubebuilder:validation:Optional - ClusterIDSelector *v1.Selector `json:"clusterIdSelector,omitempty" tf:"-"` - - // Specifies the map of string keys and values for labels. - // Changing this will create a new PVC resource. - // +kubebuilder:validation:Optional - Labels map[string]*string `json:"labels,omitempty" tf:"labels,omitempty"` - - // Specifies the unique name of the PVC resource. This parameter can contain a - // maximum of 63 characters, which may consist of lowercase letters, digits and hyphens (-), and must start and end with - // lowercase letters and digits. Changing this will create a new PVC resource. - // +kubebuilder:validation:Required - Name *string `json:"name" tf:"name,omitempty"` - - // Specifies the namespace to logically divide your containers into different - // group. Changing this will create a new PVC resource. - // +crossplane:generate:reference:type=CCENameSpace - // +kubebuilder:validation:Optional - Namespace *string `json:"namespace,omitempty" tf:"namespace,omitempty"` - - // Reference to a CCENameSpace to populate namespace. - // +kubebuilder:validation:Optional - NamespaceRef *v1.Reference `json:"namespaceRef,omitempty" tf:"-"` - - // Selector for a CCENameSpace to populate namespace. - // +kubebuilder:validation:Optional - NamespaceSelector *v1.Selector `json:"namespaceSelector,omitempty" tf:"-"` - - // Specifies the region in which to create the PVC resource. - // If omitted, the provider-level region will be used. Changing this will create a new PVC resource. - // +kubebuilder:validation:Optional - Region *string `json:"region,omitempty" tf:"region,omitempty"` - - // Specifies the minimum amount of storage resources required. - // Changing this creates a new PVC resource. - // +kubebuilder:validation:Required - Storage *string `json:"storage" tf:"storage,omitempty"` - - // Specifies the type of the storage bound to the CCE PVC. - // The valid values are as follows: - // +kubebuilder:validation:Required - StorageClassName *string `json:"storageClassName" tf:"storage_class_name,omitempty"` -} - -// PvcSpec defines the desired state of Pvc -type PvcSpec struct { - v1.ResourceSpec `json:",inline"` - ForProvider PvcParameters `json:"forProvider"` -} - -// PvcStatus defines the observed state of Pvc. -type PvcStatus struct { - v1.ResourceStatus `json:",inline"` - AtProvider PvcObservation `json:"atProvider,omitempty"` -} - -// +kubebuilder:object:root=true - -// Pvc is the Schema for the Pvcs API. ""page_title: "flexibleengine_cce_pvc" -// +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,flexibleengine} -type Pvc struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - Spec PvcSpec `json:"spec"` - Status PvcStatus `json:"status,omitempty"` -} - -// +kubebuilder:object:root=true - -// PvcList contains a list of Pvcs -type PvcList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Pvc `json:"items"` -} - -// Repository type metadata. -var ( - Pvc_Kind = "Pvc" - Pvc_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: Pvc_Kind}.String() - Pvc_KindAPIVersion = Pvc_Kind + "." + CRDGroupVersion.String() - Pvc_GroupVersionKind = CRDGroupVersion.WithKind(Pvc_Kind) -) - -func init() { - SchemeBuilder.Register(&Pvc{}, &PvcList{}) -} diff --git a/config/cce/config.go b/config/cce/config.go index 57e8571a..9b5bbf14 100644 --- a/config/cce/config.go +++ b/config/cce/config.go @@ -74,13 +74,21 @@ func Configure(p *config.Provider) { // flexibleengine_cce_pvc // https://registry.terraform.io/providers/FlexibleEngineCloud/flexibleengine/latest/docs/resources/cce_pvc - p.AddResourceConfigurator("flexibleengine_cce_pvc", func(r *config.Resource) { - r.References["cluster_id"] = config.Reference{ - Type: "Cluster", - } - // Rename to avoid conflict with the Namespace Kind of Kubernetes - r.References["namespace"] = config.Reference{ - Type: "CCENameSpace", - } - }) + + // note(azrod): this resource is affected by a bug in the Upjet + // The resource fall into tainted state as a result of certain steps in the creation process fail. + // Please see tainted issue for details https://github.com/upbound/upjet/issues/80 + + // p.AddResourceConfigurator("flexibleengine_cce_pvc", func(r *config.Resource) { + + // r.References["cluster_id"] = config.Reference{ + // Type: "Cluster", + // } + + // r.References["namespace"] = config.Reference{ + // Type: "CCENameSpace", + // Extractor: tools.GenerateExtractor(false, "name"), + // } + + // }) } diff --git a/config/external_name.go b/config/external_name.go index 84848ecf..a71f174f 100644 --- a/config/external_name.go +++ b/config/external_name.go @@ -283,26 +283,32 @@ var ExternalNameConfigs = map[string]config.ExternalName{ // flexibleengine_dns_ptrrecord_v2 - Imported using the ID // https://registry.terraform.io/providers/FlexibleEngineCloud/flexibleengine/latest/docs/resources/dns_ptrrecord_v2 "flexibleengine_dns_ptrrecord_v2": TemplatedStringAsIdentifierWithNoName("{{ .parameters.region }}:{{ .external_name }}"), + /* > Cloud Container Engine (CCE) */ // flexibleengine_cce_addon_v3 - Imported using {cluster_id}/{addon_id} // https://registry.terraform.io/providers/FlexibleEngineCloud/flexibleengine/latest/docs/resources/cce_addon_v3 "flexibleengine_cce_addon_v3": TemplatedStringAsIdentifierWithNoName("{{ .parameters.cluster_id }}/{{ .external_name }}"), + // flexibleengine_cce_cluster_v3 - Imported using the ID // https://registry.terraform.io/providers/FlexibleEngineCloud/flexibleengine/latest/docs/resources/cce_cluster_v3 "flexibleengine_cce_cluster_v3": config.IdentifierFromProvider, + // flexibleengine_cce_namespace - Imported using {cluster_id}/{namespace} // https://registry.terraform.io/providers/FlexibleEngineCloud/flexibleengine/latest/docs/resources/cce_namespace "flexibleengine_cce_namespace": TemplatedStringAsIdentifierWithNoName("{{ .parameters.cluster_id }}/{{ .parameters.name }}"), + // flexibleengine_cce_node_pool_v3 - Imported using {cluster_id}/{node_pool_id} // https://registry.terraform.io/providers/FlexibleEngineCloud/flexibleengine/latest/docs/resources/cce_node_pool_v3 "flexibleengine_cce_node_pool_v3": TemplatedStringAsIdentifierWithNoName("{{ .parameters.cluster_id }}/{{ .external_name }}"), + // flexibleengine_cce_pvc - Imported using {cluster_id}/{namespace}/{name} // https://registry.terraform.io/providers/FlexibleEngineCloud/flexibleengine/latest/docs/resources/cce_pvc - "flexibleengine_cce_pvc": TemplatedStringAsIdentifierWithNoName("{{ .parameters.cluster_id }}/{{ .parameters.namespace }}/{{ .parameters.name }}"), + "flexibleengine_cce_pvc": TemplatedStringAsIdentifierWithNoName("{{ .parameters.cluster_id }}/{{ .parameters.namespace }}/{{ .external_name }}"), - // No import documented + // flexibleengine_cce_node_v3 - Imported using the ID + // https://registry.terraform.io/providers/FlexibleEngineCloud/flexibleengine/latest/docs/resources/cce_node_v3 "flexibleengine_cce_node_v3": config.IdentifierFromProvider, /* diff --git a/config/provider.go b/config/provider.go index 51393b20..5c60dc46 100644 --- a/config/provider.go +++ b/config/provider.go @@ -64,7 +64,9 @@ var ( var skipList = []string{ "flexibleengine_cts_tracker_v1$", // Only system tracker_name is available + "flexibleengine_cce_pvc$", // Ignored temporary due to issue https://github.com/FrangipaneTeam/provider-flexibleengine/issues/51 "flexibleengine_fgs_dependency$", // Cannot upload a zip file to reference it to a dependency + // Deprecated resources // https://github.com/FlexibleEngineCloud/terraform-provider-flexibleengine/pull/869 diff --git a/examples-generated/cce/pvc.yaml b/examples-generated/cce/pvc.yaml deleted file mode 100644 index aa531142..00000000 --- a/examples-generated/cce/pvc.yaml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: cce.flexibleengine.upbound.io/v1beta1 -kind: Pvc -metadata: - annotations: - meta.upbound.io/example-id: cce/v1beta1/pvc - labels: - testing.upbound.io/example-name: test - name: test -spec: - forProvider: - accessModes: - - ReadWriteOnce - annotations: - everest.io/disk-volume-type: SSD - clusterIdSelector: - matchLabels: - testing.upbound.io/example-name: example - name: ${var.pvc_name} - namespaceSelector: - matchLabels: - testing.upbound.io/example-name: example - storage: 10Gi - storageClassName: csi-disk - ---- - diff --git a/internal/controller/cce/pvc/zz_controller.go b/internal/controller/cce/pvc/zz_controller.go deleted file mode 100755 index 2343fbb3..00000000 --- a/internal/controller/cce/pvc/zz_controller.go +++ /dev/null @@ -1,51 +0,0 @@ -/* -Copyright 2022 Upbound Inc. -*/ - -// Code generated by upjet. DO NOT EDIT. - -package pvc - -import ( - "time" - - "github.com/crossplane/crossplane-runtime/pkg/connection" - "github.com/crossplane/crossplane-runtime/pkg/event" - "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" - "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" - xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - tjcontroller "github.com/upbound/upjet/pkg/controller" - "github.com/upbound/upjet/pkg/terraform" - ctrl "sigs.k8s.io/controller-runtime" - - v1beta1 "github.com/FrangipaneTeam/provider-flexibleengine/apis/cce/v1beta1" -) - -// Setup adds a controller that reconciles Pvc managed resources. -func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta1.Pvc_GroupVersionKind.String()) - var initializers managed.InitializerChain - cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} - if o.SecretStoreConfigGVK != nil { - cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK)) - } - r := managed.NewReconciler(mgr, - xpresource.ManagedKind(v1beta1.Pvc_GroupVersionKind), - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["flexibleengine_cce_pvc"], - tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Pvc_GroupVersionKind))), - )), - managed.WithLogger(o.Logger.WithValues("controller", name)), - managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), - managed.WithTimeout(3*time.Minute), - managed.WithInitializers(initializers), - managed.WithConnectionPublishers(cps...), - managed.WithPollInterval(o.PollInterval), - ) - - return ctrl.NewControllerManagedBy(mgr). - Named(name). - WithOptions(o.ForControllerRuntime()). - For(&v1beta1.Pvc{}). - Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) -} diff --git a/internal/controller/zz_setup.go b/internal/controller/zz_setup.go index d9bfe7e8..beb13e8a 100755 --- a/internal/controller/zz_setup.go +++ b/internal/controller/zz_setup.go @@ -35,7 +35,6 @@ import ( cluster "github.com/FrangipaneTeam/provider-flexibleengine/internal/controller/cce/cluster" node "github.com/FrangipaneTeam/provider-flexibleengine/internal/controller/cce/node" nodepool "github.com/FrangipaneTeam/provider-flexibleengine/internal/controller/cce/nodepool" - pvc "github.com/FrangipaneTeam/provider-flexibleengine/internal/controller/cce/pvc" alarmrule "github.com/FrangipaneTeam/provider-flexibleengine/internal/controller/ces/alarmrule" backup "github.com/FrangipaneTeam/provider-flexibleengine/internal/controller/csbs/backup" backuppolicy "github.com/FrangipaneTeam/provider-flexibleengine/internal/controller/csbs/backuppolicy" @@ -212,7 +211,6 @@ func Setup(mgr ctrl.Manager, o controller.Options) error { cluster.Setup, node.Setup, nodepool.Setup, - pvc.Setup, alarmrule.Setup, backup.Setup, backuppolicy.Setup, diff --git a/package/crds/cce.flexibleengine.upbound.io_pvcs.yaml b/package/crds/cce.flexibleengine.upbound.io_pvcs.yaml deleted file mode 100644 index d7230d99..00000000 --- a/package/crds/cce.flexibleengine.upbound.io_pvcs.yaml +++ /dev/null @@ -1,496 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.8.0 - creationTimestamp: null - name: pvcs.cce.flexibleengine.upbound.io -spec: - group: cce.flexibleengine.upbound.io - names: - categories: - - crossplane - - managed - - flexibleengine - kind: Pvc - listKind: PvcList - plural: pvcs - singular: pvc - scope: Cluster - versions: - - additionalPrinterColumns: - - jsonPath: .status.conditions[?(@.type=='Ready')].status - name: READY - type: string - - jsonPath: .status.conditions[?(@.type=='Synced')].status - name: SYNCED - type: string - - jsonPath: .metadata.annotations.crossplane\.io/external-name - name: EXTERNAL-NAME - type: string - - jsonPath: .metadata.creationTimestamp - name: AGE - type: date - name: v1beta1 - schema: - openAPIV3Schema: - description: 'Pvc is the Schema for the Pvcs API. ""page_title: "flexibleengine_cce_pvc"' - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: PvcSpec defines the desired state of Pvc - properties: - deletionPolicy: - default: Delete - description: DeletionPolicy specifies what will happen to the underlying - external when this managed resource is deleted - either "Delete" - or "Orphan" the external resource. - enum: - - Orphan - - Delete - type: string - forProvider: - properties: - accessModes: - description: 'Specifies the desired access modes the volume should - have. The valid values are as follows:' - items: - type: string - type: array - annotations: - additionalProperties: - type: string - description: Specifies the unstructured key value map for external - parameters. Changing this will create a new PVC resource. - type: object - clusterId: - description: Specifies the cluster ID to which the CCE PVC belongs. - type: string - clusterIdRef: - description: Reference to a Cluster to populate clusterId. - 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 - clusterIdSelector: - description: Selector for a Cluster to populate clusterId. - 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 - labels: - additionalProperties: - type: string - description: Specifies the map of string keys and values for labels. - Changing this will create a new PVC resource. - type: object - name: - description: Specifies the unique name of the PVC resource. This - parameter can contain a maximum of 63 characters, which may - consist of lowercase letters, digits and hyphens (-), and must - start and end with lowercase letters and digits. Changing this - will create a new PVC resource. - type: string - namespace: - description: Specifies the namespace to logically divide your - containers into different group. Changing this will create a - new PVC resource. - type: string - namespaceRef: - description: Reference to a CCENameSpace to populate namespace. - 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 - namespaceSelector: - description: Selector for a CCENameSpace to populate namespace. - 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 - region: - description: Specifies the region in which to create the PVC resource. - If omitted, the provider-level region will be used. Changing - this will create a new PVC resource. - type: string - storage: - description: Specifies the minimum amount of storage resources - required. Changing this creates a new PVC resource. - type: string - storageClassName: - description: 'Specifies the type of the storage bound to the CCE - PVC. The valid values are as follows:' - type: string - required: - - accessModes - - name - - storage - - storageClassName - type: object - providerConfigRef: - default: - name: default - description: ProviderConfigReference specifies how the provider that - will be used to create, observe, update, and delete this managed - resource should be configured. - 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 - providerRef: - description: 'ProviderReference specifies the provider that will be - used to create, observe, update, and delete this managed resource. - Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' - 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 - publishConnectionDetailsTo: - description: PublishConnectionDetailsTo specifies the connection secret - config which contains a name, metadata and a reference to secret - store config to which any connection details for this managed resource - should be written. Connection details frequently include the endpoint, - username, and password required to connect to the managed resource. - properties: - configRef: - default: - name: default - description: SecretStoreConfigRef specifies which secret store - config should be used for this ConnectionSecret. - 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 - metadata: - description: Metadata is the metadata for connection secret. - properties: - annotations: - additionalProperties: - type: string - description: Annotations are the annotations to be added to - connection secret. - For Kubernetes secrets, this will be - used as "metadata.annotations". - It is up to Secret Store - implementation for others store types. - type: object - labels: - additionalProperties: - type: string - description: Labels are the labels/tags to be added to connection - secret. - For Kubernetes secrets, this will be used as "metadata.labels". - - It is up to Secret Store implementation for others store - types. - type: object - type: - description: Type is the SecretType for the connection secret. - - Only valid for Kubernetes Secret Stores. - type: string - type: object - name: - description: Name is the name of the connection secret. - type: string - required: - - name - type: object - writeConnectionSecretToRef: - description: WriteConnectionSecretToReference specifies the namespace - and name of a Secret to which any connection details for this managed - resource should be written. Connection details frequently include - the endpoint, username, and password required to connect to the - managed resource. This field is planned to be replaced in a future - release in favor of PublishConnectionDetailsTo. Currently, both - could be set independently and connection details would be published - to both without affecting each other. - properties: - name: - description: Name of the secret. - type: string - namespace: - description: Namespace of the secret. - type: string - required: - - name - - namespace - type: object - required: - - forProvider - type: object - status: - description: PvcStatus defines the observed state of Pvc. - properties: - atProvider: - properties: - creationTimestamp: - description: The server time when PVC was created. - type: string - id: - description: The PVC ID in UUID format. - type: string - status: - description: The current phase of the PVC. - type: string - type: object - conditions: - description: Conditions of the resource. - items: - description: A Condition that may apply to a resource. - properties: - lastTransitionTime: - description: LastTransitionTime is the last time this condition - transitioned from one status to another. - format: date-time - type: string - message: - description: A Message containing details about this condition's - last transition from one status to another, if any. - type: string - reason: - description: A Reason for this condition's last transition from - one status to another. - type: string - status: - description: Status of this condition; is it currently True, - False, or Unknown? - type: string - type: - description: Type of this condition. At most one of each condition - type may apply to a resource at any point in time. - type: string - required: - - lastTransitionTime - - reason - - status - - type - type: object - type: array - type: object - required: - - spec - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: []