Skip to content

Commit

Permalink
fix: fixed wording in internal/provider/resource_kubernetes_cloud.go
Browse files Browse the repository at this point in the history
Co-authored-by: Kian Parvin <[email protected]>
  • Loading branch information
alesstimec and kian99 committed Dec 19, 2024
1 parent ee0178a commit 7ef5c27
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
4 changes: 2 additions & 2 deletions docs/resources/kubernetes_cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ resource "juju_model" "my-model" {
### Optional

- `kubernetes_config` (String, Sensitive) The kubernetes config file path for the cloud. Cloud credentials will be added to the Juju controller for you.
- `parent_cloud_name` (String) The parent cloud name in case adding k8s cluster from existed cloud. Changing this value will cause the cloud to be destroyed and recreated by terraform. *Note* that this value must be set when running against a JAAS controller.
- `parent_cloud_region` (String) The parent cloud region name in case adding k8s cluster from existed cloud. Changing this value will cause the cloud to be destroyed and recreated by terraform. *Note* that this value must be set when running against a JAAS controller.
- `parent_cloud_name` (String) The parent cloud name, for adding a k8s cluster from an existing cloud. Changing this value will cause the cloud to be destroyed and recreated by terraform. *Note* that this value must be set when running against a JAAS controller.
- `parent_cloud_region` (String) The parent cloud region name, for adding a k8s cluster from an existing cloud. Changing this value will cause the cloud to be destroyed and recreated by terraform. *Note* that this value must be set when running against a JAAS controller.

### Read-Only

Expand Down
10 changes: 3 additions & 7 deletions internal/provider/resource_kubernetes_cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ func (r *kubernetesCloudResource) Schema(_ context.Context, req resource.SchemaR
Sensitive: true,
},
"parent_cloud_name": schema.StringAttribute{
Description: "The parent cloud name in case adding k8s cluster from existed cloud. Changing this value will cause the cloud to be destroyed and recreated by terraform. *Note* that this value must be set when running against a JAAS controller.",
Description: "The parent cloud name, for adding a k8s cluster from an existing cloud. Changing this value will cause the cloud to be destroyed and recreated by terraform. *Note* that this value must be set when running against a JAAS controller.",
Optional: true,
},
"parent_cloud_region": schema.StringAttribute{
Description: "The parent cloud region name in case adding k8s cluster from existed cloud. Changing this value will cause the cloud to be destroyed and recreated by terraform. *Note* that this value must be set when running against a JAAS controller.",
Description: "The parent cloud region name, for adding a k8s cluster from an existing cloud. Changing this value will cause the cloud to be destroyed and recreated by terraform. *Note* that this value must be set when running against a JAAS controller.",
Optional: true,
},
"id": schema.StringAttribute{
Expand Down Expand Up @@ -293,11 +293,7 @@ func (v *kuberenetesCloudJAASValidator) ValidateResource(ctx context.Context, re
}

if data.ParentCloudName.ValueString() == "" {
resp.Diagnostics.AddError("Plan Error", "parent_cloud_name must be specified when applying to a JAAS controller")
}

if data.ParentCloudRegion.ValueString() == "" {
resp.Diagnostics.AddError("Plan Error", "parent_cloud_region must be specified when applying to a JAAS controller")
resp.Diagnostics.AddError("Plan Error", "Field `parent_cloud_name` must be specified when applying to a JAAS controller.")
}
}

Expand Down

0 comments on commit 7ef5c27

Please sign in to comment.