Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

123 mrs resources not tested #142

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions apis/mrs/v1beta1/zz_cluster_types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 47 additions & 1 deletion apis/mrs/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

85 changes: 80 additions & 5 deletions apis/mrs/v1beta1/zz_generated.resolvers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apis/mrs/v1beta1/zz_generated_terraformed.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions apis/mrs/v1beta1/zz_job_types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 0 additions & 11 deletions config/external_name.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"),
Expand Down
4 changes: 4 additions & 0 deletions config/groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 15 additions & 4 deletions config/mrs/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,33 @@ package mrs

import (
"github.com/upbound/upjet/pkg/config"

"github.com/FrangipaneTeam/provider-flexibleengine/pkg/tools"
)

// Configure configures individual resources by adding custom ResourceConfigurators.
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"),
}
})

}
7 changes: 3 additions & 4 deletions examples-generated/mrs/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion examples-generated/mrs/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading