diff --git a/apis/mrs/v1beta1/zz_cluster_types.go b/apis/mrs/v1beta1/zz_cluster_types.go index 2203de75..a327999e 100755 --- a/apis/mrs/v1beta1/zz_cluster_types.go +++ b/apis/mrs/v1beta1/zz_cluster_types.go @@ -254,15 +254,34 @@ type ClusterParameters struct { // Specifies the name of a key pair, which is used to login to the each // nodes(ECSs). Changing this will create a new MRS cluster resource. - // +kubebuilder:validation:Required - NodeKeyPairSecretRef v1.SecretKeySelector `json:"nodeKeyPairSecretRef" tf:"-"` + // +crossplane:generate:reference:type=github.com/FrangipaneTeam/provider-flexibleengine/apis/ecs/v1beta1.KeyPair + // +kubebuilder:validation:Optional + NodeKeyPair *string `json:"nodeKeyPair,omitempty" tf:"node_key_pair,omitempty"` + + // Reference to a KeyPair in ecs to populate nodeKeyPair. + // +kubebuilder:validation:Optional + NodeKeyPairRef *v1.Reference `json:"nodeKeyPairRef,omitempty" tf:"-"` + + // Selector for a KeyPair in ecs to populate nodeKeyPair. + // +kubebuilder:validation:Optional + NodeKeyPairSelector *v1.Selector `json:"nodeKeyPairSelector,omitempty" tf:"-"` // Specifies the EIP address which bound to the MRS cluster. // The EIP must have been created and must be in the same region as the cluster. // Changing this will create a new MRS cluster resource. + // +crossplane:generate:reference:type=github.com/FrangipaneTeam/provider-flexibleengine/apis/eip/v1beta1.EIP + // +crossplane:generate:reference:extractor=github.com/FrangipaneTeam/provider-flexibleengine/pkg/tools.ExtractorParamPathfunc(true, "address") // +kubebuilder:validation:Optional PublicIP *string `json:"publicIp,omitempty" tf:"public_ip,omitempty"` + // Reference to a EIP in eip to populate publicIp. + // +kubebuilder:validation:Optional + PublicIPRef *v1.Reference `json:"publicIpRef,omitempty" tf:"-"` + + // Selector for a EIP in eip to populate publicIp. + // +kubebuilder:validation:Optional + PublicIPSelector *v1.Selector `json:"publicIpSelector,omitempty" tf:"-"` + // The region in which to create the MRS cluster resource. If omitted, the // provider-level region will be used. Changing this will create a new MRS cluster resource. // +kubebuilder:validation:Optional @@ -289,6 +308,14 @@ type ClusterParameters struct { // +kubebuilder:validation:Optional SecurityGroupIds []*string `json:"securityGroupIds,omitempty" tf:"security_group_ids,omitempty"` + // References to SecurityGroup in vpc to populate securityGroupIds. + // +kubebuilder:validation:Optional + SecurityGroupRefs []v1.Reference `json:"securityGroupRefs,omitempty" tf:"-"` + + // Selector for a list of SecurityGroup in vpc to populate securityGroupIds. + // +kubebuilder:validation:Optional + SecurityGroupSelector *v1.Selector `json:"securityGroupSelector,omitempty" tf:"-"` + // Specifies a list of the informations about the streaming core nodes in the // MRS cluster. // The nodes object structure of the streaming_core_nodes is documented below. diff --git a/apis/mrs/v1beta1/zz_generated.deepcopy.go b/apis/mrs/v1beta1/zz_generated.deepcopy.go index cf9b9f1d..42359273 100644 --- a/apis/mrs/v1beta1/zz_generated.deepcopy.go +++ b/apis/mrs/v1beta1/zz_generated.deepcopy.go @@ -424,12 +424,36 @@ func (in *ClusterParameters) DeepCopyInto(out *ClusterParameters) { *out = new(string) **out = **in } - out.NodeKeyPairSecretRef = in.NodeKeyPairSecretRef + if in.NodeKeyPair != nil { + in, out := &in.NodeKeyPair, &out.NodeKeyPair + *out = new(string) + **out = **in + } + if in.NodeKeyPairRef != nil { + in, out := &in.NodeKeyPairRef, &out.NodeKeyPairRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.NodeKeyPairSelector != nil { + in, out := &in.NodeKeyPairSelector, &out.NodeKeyPairSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.PublicIP != nil { in, out := &in.PublicIP, &out.PublicIP *out = new(string) **out = **in } + if in.PublicIPRef != nil { + in, out := &in.PublicIPRef, &out.PublicIPRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.PublicIPSelector != nil { + in, out := &in.PublicIPSelector, &out.PublicIPSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Region != nil { in, out := &in.Region, &out.Region *out = new(string) @@ -463,6 +487,18 @@ func (in *ClusterParameters) DeepCopyInto(out *ClusterParameters) { } } } + if in.SecurityGroupRefs != nil { + in, out := &in.SecurityGroupRefs, &out.SecurityGroupRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SecurityGroupSelector != nil { + in, out := &in.SecurityGroupSelector, &out.SecurityGroupSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.StreamingCoreNodes != nil { in, out := &in.StreamingCoreNodes, &out.StreamingCoreNodes *out = make([]StreamingCoreNodesParameters, len(*in)) @@ -832,6 +868,16 @@ func (in *JobParameters) DeepCopyInto(out *JobParameters) { *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.Name != nil { in, out := &in.Name, &out.Name *out = new(string) diff --git a/apis/mrs/v1beta1/zz_generated.resolvers.go b/apis/mrs/v1beta1/zz_generated.resolvers.go index 4353f51b..6aeb3f24 100644 --- a/apis/mrs/v1beta1/zz_generated.resolvers.go +++ b/apis/mrs/v1beta1/zz_generated.resolvers.go @@ -7,8 +7,9 @@ package v1beta1 import ( "context" + v1beta11 "github.com/FrangipaneTeam/provider-flexibleengine/apis/ecs/v1beta1" v1beta1 "github.com/FrangipaneTeam/provider-flexibleengine/apis/eip/v1beta1" - v1beta11 "github.com/FrangipaneTeam/provider-flexibleengine/apis/vpc/v1beta1" + v1beta12 "github.com/FrangipaneTeam/provider-flexibleengine/apis/vpc/v1beta1" tools "github.com/FrangipaneTeam/provider-flexibleengine/pkg/tools" reference "github.com/crossplane/crossplane-runtime/pkg/reference" errors "github.com/pkg/errors" @@ -55,14 +56,62 @@ func (mg *Cluster) ResolveReferences(ctx context.Context, c client.Reader) error mg.Spec.ForProvider.SecurityGroupIds = reference.ToPtrValues(mrsp.ResolvedValues) mg.Spec.ForProvider.SecurityGroupIDRefs = mrsp.ResolvedReferences + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.NodeKeyPair), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.NodeKeyPairRef, + Selector: mg.Spec.ForProvider.NodeKeyPairSelector, + To: reference.To{ + List: &v1beta11.KeyPairList{}, + Managed: &v1beta11.KeyPair{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.NodeKeyPair") + } + mg.Spec.ForProvider.NodeKeyPair = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.NodeKeyPairRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.PublicIP), + Extract: tools.ExtractorParamPathfunc(true, "address"), + Reference: mg.Spec.ForProvider.PublicIPRef, + Selector: mg.Spec.ForProvider.PublicIPSelector, + To: reference.To{ + List: &v1beta1.EIPList{}, + Managed: &v1beta1.EIP{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.PublicIP") + } + mg.Spec.ForProvider.PublicIP = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.PublicIPRef = rsp.ResolvedReference + + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.SecurityGroupIds), + Extract: tools.ExtractorParamPathfunc(true, "id"), + References: mg.Spec.ForProvider.SecurityGroupRefs, + Selector: mg.Spec.ForProvider.SecurityGroupSelector, + To: reference.To{ + List: &v1beta12.SecurityGroupList{}, + Managed: &v1beta12.SecurityGroup{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.SecurityGroupIds") + } + mg.Spec.ForProvider.SecurityGroupIds = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.SecurityGroupRefs = mrsp.ResolvedReferences + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.SubnetID), Extract: tools.ExtractorParamPathfunc(true, "id"), Reference: mg.Spec.ForProvider.SubnetIDRef, Selector: mg.Spec.ForProvider.SubnetIDSelector, To: reference.To{ - List: &v1beta11.VPCSubnetList{}, - Managed: &v1beta11.VPCSubnet{}, + List: &v1beta12.VPCSubnetList{}, + Managed: &v1beta12.VPCSubnet{}, }, }) if err != nil { @@ -77,8 +126,8 @@ func (mg *Cluster) ResolveReferences(ctx context.Context, c client.Reader) error Reference: mg.Spec.ForProvider.VPCIDRef, Selector: mg.Spec.ForProvider.VPCIDSelector, To: reference.To{ - List: &v1beta11.VPCList{}, - Managed: &v1beta11.VPC{}, + List: &v1beta12.VPCList{}, + Managed: &v1beta12.VPC{}, }, }) if err != nil { @@ -89,3 +138,29 @@ func (mg *Cluster) ResolveReferences(ctx context.Context, c client.Reader) error return nil } + +// ResolveReferences of this Job. +func (mg *Job) 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 + + return nil +} diff --git a/apis/mrs/v1beta1/zz_generated_terraformed.go b/apis/mrs/v1beta1/zz_generated_terraformed.go index 7a195868..36ae7b4b 100755 --- a/apis/mrs/v1beta1/zz_generated_terraformed.go +++ b/apis/mrs/v1beta1/zz_generated_terraformed.go @@ -20,7 +20,7 @@ func (mg *Cluster) GetTerraformResourceType() string { // GetConnectionDetailsMapping for this Cluster func (tr *Cluster) GetConnectionDetailsMapping() map[string]string { - return map[string]string{"manager_admin_pwd": "spec.forProvider.managerAdminPwdSecretRef", "node_key_pair": "spec.forProvider.nodeKeyPairSecretRef"} + return map[string]string{"manager_admin_pwd": "spec.forProvider.managerAdminPwdSecretRef"} } // GetObservation of this Cluster diff --git a/apis/mrs/v1beta1/zz_job_types.go b/apis/mrs/v1beta1/zz_job_types.go index 0ab819af..e30bd810 100755 --- a/apis/mrs/v1beta1/zz_job_types.go +++ b/apis/mrs/v1beta1/zz_job_types.go @@ -35,8 +35,17 @@ type JobParameters struct { // Specifies an ID of the MRS cluster to which the job belongs to. // Changing this will create a new MRS job resource. - // +kubebuilder:validation:Required - ClusterID *string `json:"clusterId" tf:"cluster_id,omitempty"` + // +crossplane:generate:reference:type=github.com/FrangipaneTeam/provider-flexibleengine/apis/mrs/v1beta1.Cluster + // +kubebuilder:validation:Optional + ClusterID *string `json:"clusterId,omitempty" tf:"cluster_id,omitempty"` + + // Reference to a Cluster in mrs to populate clusterId. + // +kubebuilder:validation:Optional + ClusterIDRef *v1.Reference `json:"clusterIdRef,omitempty" tf:"-"` + + // Selector for a Cluster in mrs to populate clusterId. + // +kubebuilder:validation:Optional + ClusterIDSelector *v1.Selector `json:"clusterIdSelector,omitempty" tf:"-"` // Specifies the name of the MRS job. The name can contain 1 to 64 // characters, which may consist of letters, digits, underscores (_) and hyphens (-). diff --git a/config/external_name.go b/config/external_name.go index 57ce851e..e10a2b44 100644 --- a/config/external_name.go +++ b/config/external_name.go @@ -731,22 +731,11 @@ var ExternalNameConfigs = map[string]config.ExternalName{ /* > MapReduce Service (MRS) */ - // flexibleengine_mrs_cluster_v1 - Imported using the ID - // https://registry.terraform.io/providers/FlexibleEngineCloud/flexibleengine/latest/docs/resources/mrs_cluster_v1 - "flexibleengine_mrs_cluster_v1": config.IdentifierFromProvider, // flexibleengine_mrs_cluster_v2 - Imported using the ID // https://registry.terraform.io/providers/FlexibleEngineCloud/flexibleengine/latest/docs/resources/mrs_cluster_v2 "flexibleengine_mrs_cluster_v2": config.IdentifierFromProvider, - // flexibleengine_mrs_hybrid_cluster_v1 - Imported using the ID - // https://registry.terraform.io/providers/FlexibleEngineCloud/flexibleengine/latest/docs/resources/mrs_hybrid_cluster_v1 - "flexibleengine_mrs_hybrid_cluster_v1": config.IdentifierFromProvider, - - // flexibleengine_mrs_job_v1 - Imported using the ID - // https://registry.terraform.io/providers/FlexibleEngineCloud/flexibleengine/latest/docs/resources/mrs_job_v1 - "flexibleengine_mrs_job_v1": config.IdentifierFromProvider, - // flexibleengine_mrs_job_v2 - Imported using template // https://registry.terraform.io/providers/FlexibleEngineCloud/flexibleengine/latest/docs/resources/mrs_job_v2 "flexibleengine_mrs_job_v2": TemplatedStringAsIdentifierWithNoName("{{ .parameters.cluster_id }}/{{ .external_name }}"), diff --git a/config/groups.go b/config/groups.go index 420996f5..3b1a4c24 100644 --- a/config/groups.go +++ b/config/groups.go @@ -156,6 +156,10 @@ var GroupMap = map[string]GroupKindCalculator{ // EPS "flexibleengine_enterprise_project": ReplaceGroupWords("eps", 1), // Group: eps, Kind: Project + // MRS + "flexibleengine_mrs_cluster_v2": ReplaceGroupWords("mrs", 1), // Group: mrs, Kind: Cluster + "flexibleengine_mrs_job_v2": ReplaceGroupWords("mrs", 1), // Group: mrs, Kind: Job + // NetACL "flexibleengine_network_acl": ReplaceGroupWords("netacl", 1), // Group: netacl, Kind: ACL "flexibleengine_network_acl_rule": ReplaceGroupWords("netacl", 1), // Group: netacl, Kind: ACLRule diff --git a/config/mrs/config.go b/config/mrs/config.go index 8fb998ca..d92d2241 100644 --- a/config/mrs/config.go +++ b/config/mrs/config.go @@ -3,6 +3,8 @@ package mrs import ( "github.com/upbound/upjet/pkg/config" + + "github.com/FrangipaneTeam/provider-flexibleengine/pkg/tools" ) // Configure configures individual resources by adding custom ResourceConfigurators. @@ -10,15 +12,24 @@ func Configure(p *config.Provider) { // flexibleengine_mrs_cluster_v2 // https://registry.terraform.io/providers/FlexibleEngineCloud/flexibleengine/latest/docs/resources/mrs_cluster_v2 p.AddResourceConfigurator("flexibleengine_mrs_cluster_v2", func(r *config.Resource) { - // node_key_pair is sensitive ? - r.TerraformResource.Schema["node_key_pair"].Sensitive = true + // public_ip + r.References["public_ip"] = config.Reference{ + Type: tools.GenerateType("eip", "EIP"), + Extractor: tools.GenerateExtractor(true, "address"), + } + // node_key_pair + r.References["node_key_pair"] = config.Reference{ + Type: tools.GenerateType("ecs", "KeyPair"), + } }) // flexibleengine_mrs_job_v2 // https://registry.terraform.io/providers/FlexibleEngineCloud/flexibleengine/latest/docs/resources/mrs_job_v2 p.AddResourceConfigurator("flexibleengine_mrs_job_v2", func(r *config.Resource) { - - r.UseAsync = true + // cluster_id + r.References["cluster_id"] = config.Reference{ + Type: tools.GenerateType("mrs", "Cluster"), + } }) } diff --git a/examples-generated/mrs/cluster.yaml b/examples-generated/mrs/cluster.yaml index 81ea9ea3..57811bbc 100644 --- a/examples-generated/mrs/cluster.yaml +++ b/examples-generated/mrs/cluster.yaml @@ -35,10 +35,9 @@ spec: rootVolumeSize: 300 rootVolumeType: SAS name: ${var.cluster_name} - nodeKeyPairSecretRef: - key: example-key - name: example-secret - namespace: upbound-system + nodeKeyPairSelector: + matchLabels: + testing.upbound.io/example-name: example subnetIdSelector: matchLabels: testing.upbound.io/example-name: example_subnet diff --git a/examples-generated/mrs/job.yaml b/examples-generated/mrs/job.yaml index ee6ca5b8..900e76d1 100644 --- a/examples-generated/mrs/job.yaml +++ b/examples-generated/mrs/job.yaml @@ -8,7 +8,9 @@ metadata: name: test spec: forProvider: - clusterId: ${var.cluster_id} + clusterIdSelector: + matchLabels: + testing.upbound.io/example-name: example name: ${var.job_name} parameters: ${var.access_key} ${var.secret_key} 1 s3a://obs-demo-analysis/input s3a://obs-demo-analysis/output diff --git a/examples/mrs/cluster.yaml b/examples/mrs/cluster.yaml new file mode 100644 index 00000000..b178ba47 --- /dev/null +++ b/examples/mrs/cluster.yaml @@ -0,0 +1,47 @@ +apiVersion: mrs.flexibleengine.upbound.io/v1beta1 +kind: Cluster +metadata: + annotations: + meta.upbound.io/example-id: mrs/v1beta1/cluster + labels: + testing.upbound.io/example-name: example_mrs_cluster + name: example-mrs-cluster +spec: + forProvider: + analysisCoreNodes: + - dataVolumeCount: 1 + dataVolumeSize: 100 + dataVolumeType: SAS + flavor: c3.2xlarge.2.linux.mrs + nodeNumber: 3 + rootVolumeSize: 100 + rootVolumeType: SAS + availabilityZone: eu-west-0a + componentList: + - Hadoop + - Spark + - Hive + managerAdminPwdSecretRef: + key: example-mrs-admin-password + name: example-mrs-secret + namespace: crossplane-system + masterNodes: + - dataVolumeCount: 1 + dataVolumeSize: 100 + dataVolumeType: SAS + flavor: c3.2xlarge.2.linux.mrs + nodeNumber: 2 + rootVolumeSize: 100 + rootVolumeType: SAS + name: example-mrs-cluster + nodeKeyPairSelector: + matchLabels: + testing.upbound.io/example-name: example_keypair + subnetIdSelector: + matchLabels: + testing.upbound.io/example-name: example_subnet + type: ANALYSIS + version: MRS 2.0.1 + vpcIdSelector: + matchLabels: + testing.upbound.io/example-name: example_vpc \ No newline at end of file diff --git a/examples/mrs/cluster.yaml.secret b/examples/mrs/cluster.yaml.secret new file mode 100644 index 00000000..e9863f92 --- /dev/null +++ b/examples/mrs/cluster.yaml.secret @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Secret +metadata: + labels: + testing.upbound.io/example-name: example_mrs_secret + name: example-mrs-secret + namespace: crossplane-system +type: Opaque +stringData: + example-mrs-admin-password: SuperS3cr3tP4ssw@rd \ No newline at end of file diff --git a/list-tested.md b/list-tested.md index 9b0fec0f..1b78f33e 100644 --- a/list-tested.md +++ b/list-tested.md @@ -67,13 +67,6 @@ | Backup | :white_check_mark: | | BackupPolicy | :white_check_mark: | -## cse.flexibleengine.upbound.io -| Kind | Tested | -| ---- | ------ | -| Microservice | :x: | -| MicroserviceEngine | :x: | -| MicroserviceInstance | :x: | - ## css.flexibleengine.upbound.io | Kind | Tested | | ---- | ------ | @@ -236,22 +229,13 @@ ## modelarts.flexibleengine.upbound.io | Kind | Tested | | ---- | ------ | -| Dataset | :x: | -| DatasetVersion | :x: | | Dataset | :white_check_mark: | | DatasetVersion | :white_check_mark: | ## mrs.flexibleengine.upbound.io | Kind | Tested | | ---- | ------ | -| Cluster | :x: | -| Job | :x: | - -## mrsd.flexibleengine.upbound.io -| Kind | Tested | -| ---- | ------ | -| Cluster | :x: | -| HybridCluster | :x: | +| Cluster | :white_check_mark: | | Job | :x: | ## nat.flexibleengine.upbound.io diff --git a/package/crds/mrs.flexibleengine.upbound.io_clusters.yaml b/package/crds/mrs.flexibleengine.upbound.io_clusters.yaml index 09cc6cf6..da7e834e 100644 --- a/package/crds/mrs.flexibleengine.upbound.io_clusters.yaml +++ b/package/crds/mrs.flexibleengine.upbound.io_clusters.yaml @@ -420,24 +420,83 @@ spec: underscores (_) and hyphens (-). Changing this will create a new MRS cluster resource. type: string - nodeKeyPairSecretRef: + nodeKeyPair: description: Specifies the name of a key pair, which is used to login to the each nodes(ECSs). Changing this will create a new MRS cluster resource. + type: string + nodeKeyPairRef: + description: Reference to a KeyPair in ecs to populate nodeKeyPair. properties: - key: - description: The key to select. - type: string name: - description: Name of the secret. - type: string - namespace: - description: Namespace of the secret. + 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: - - key - name - - namespace + type: object + nodeKeyPairSelector: + description: Selector for a KeyPair in ecs to populate nodeKeyPair. + 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 publicIp: description: Specifies the EIP address which bound to the MRS @@ -445,6 +504,79 @@ spec: region as the cluster. Changing this will create a new MRS cluster resource. type: string + publicIpRef: + description: Reference to a EIP in eip to populate publicIp. + 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 + publicIpSelector: + description: Selector for a EIP in eip to populate publicIp. + 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: The region in which to create the MRS cluster resource. If omitted, the provider-level region will be used. Changing @@ -538,6 +670,83 @@ spec: items: type: string type: array + securityGroupRefs: + description: References to SecurityGroup in vpc to populate securityGroupIds. + items: + description: A Reference to a named object. + 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 + type: array + securityGroupSelector: + description: Selector for a list of SecurityGroup in vpc to populate + securityGroupIds. + 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 streamingCoreNodes: description: Specifies a list of the informations about the streaming core nodes in the MRS cluster. The nodes object structure of @@ -832,7 +1041,6 @@ spec: - managerAdminPwdSecretRef - masterNodes - name - - nodeKeyPairSecretRef - version type: object providerConfigRef: diff --git a/package/crds/mrs.flexibleengine.upbound.io_jobs.yaml b/package/crds/mrs.flexibleengine.upbound.io_jobs.yaml index 348c53e0..82e82eeb 100644 --- a/package/crds/mrs.flexibleengine.upbound.io_jobs.yaml +++ b/package/crds/mrs.flexibleengine.upbound.io_jobs.yaml @@ -67,6 +67,79 @@ spec: description: Specifies an ID of the MRS cluster to which the job belongs to. Changing this will create a new MRS job resource. type: string + clusterIdRef: + description: Reference to a Cluster in mrs 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 in mrs 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 name: description: Specifies the name of the MRS job. The name can contain 1 to 64 characters, which may consist of letters, digits, underscores @@ -118,7 +191,6 @@ spec: Flink, HiveSql, HiveScript, SparkSubmit, SparkSql and SparkScript. type: string required: - - clusterId - name - type type: object