Skip to content

Commit

Permalink
chore: drop kubernetes config from Read input
Browse files Browse the repository at this point in the history
  • Loading branch information
anvial committed Oct 2, 2024
1 parent b106a60 commit 988feb7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
5 changes: 1 addition & 4 deletions internal/juju/kubernetes_clouds.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@ type CreateKubernetesCloudInput struct {
}

type ReadKubernetesCloudInput struct {
Name string
KubernetesConfig string
Name string
}

type ReadKubernetesCloudOutput struct {
Name string
KubernetesConfig string
ParentCloudName string
ParentCloudRegion string
}
Expand Down Expand Up @@ -124,7 +122,6 @@ func (c *kubernetesCloudsClient) ReadKubernetesCloud(input ReadKubernetesCloudIn
Name: input.Name,
ParentCloudName: parentCloudName,
ParentCloudRegion: parentCloudRegion,
KubernetesConfig: input.KubernetesConfig,
}, nil
}
}
Expand Down
10 changes: 4 additions & 6 deletions internal/provider/resource_kubernetes_cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,8 @@ func (r *kubernetesCloudResource) Read(ctx context.Context, req resource.ReadReq

// Read the kubernetes cloud.
cloud, err := r.client.Clouds.ReadKubernetesCloud(
&juju.ReadKubernetesCloudInput{
Name: plan.CloudName.ValueString(),
KubernetesConfig: plan.KubernetesConfig.ValueString(),
juju.ReadKubernetesCloudInput{
Name: plan.CloudName.ValueString(),
},
)
if err != nil {
Expand All @@ -179,7 +178,6 @@ func (r *kubernetesCloudResource) Read(ctx context.Context, req resource.ReadReq
plan.ParentCloudName = types.StringValue(cloud.ParentCloudName)
plan.ParentCloudRegion = types.StringValue(cloud.ParentCloudRegion)
plan.CloudName = types.StringValue(cloud.Name)
plan.KubernetesConfig = types.StringValue(cloud.KubernetesConfig)
plan.ID = types.StringValue(newKubernetesCloudID(cloud.Name))

// Set the plan onto the Terraform state
Expand All @@ -204,7 +202,7 @@ func (r *kubernetesCloudResource) Update(ctx context.Context, req resource.Updat

// Update the kubernetes cloud.
err := r.client.Clouds.UpdateKubernetesCloud(
&juju.UpdateKubernetesCloudInput{
juju.UpdateKubernetesCloudInput{
Name: plan.CloudName.ValueString(),
KubernetesConfig: plan.KubernetesConfig.ValueString(),
},
Expand Down Expand Up @@ -235,7 +233,7 @@ func (r *kubernetesCloudResource) Delete(ctx context.Context, req resource.Delet

// Remove the kubernetes cloud.
err := r.client.Clouds.RemoveKubernetesCloud(
&juju.DestroyKubernetesCloudInput{
juju.DestroyKubernetesCloudInput{
Name: plan.CloudName.ValueString(),
},
)
Expand Down

0 comments on commit 988feb7

Please sign in to comment.