From 93f792cf33b935f4a03eabcae9dc63d605c0bea1 Mon Sep 17 00:00:00 2001 From: Marcin Maciaszczyk Date: Wed, 17 Apr 2024 16:45:52 +0200 Subject: [PATCH] some fixes --- example/byok/main.tf | 1 + internal/resource/cluster.go | 2 +- internal/resource/cluster_schema.go | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/example/byok/main.tf b/example/byok/main.tf index b98979d..5cd75a7 100644 --- a/example/byok/main.tf +++ b/example/byok/main.tf @@ -25,6 +25,7 @@ resource "plural_cluster" "byok" { abc = false }) }) + helm_repo_url = "https://pluralsh.github.io/deployment-operator" tags = { "managed-by" = "terraform-provider-plural" } diff --git a/internal/resource/cluster.go b/internal/resource/cluster.go index b03e9ca..26ce893 100644 --- a/internal/resource/cluster.go +++ b/internal/resource/cluster.go @@ -71,7 +71,7 @@ func (r *clusterResource) Create(ctx context.Context, req resource.CreateRequest return } - handler, err := NewOperatorHandler(ctx, data.GetKubeconfig(), data.HelmRepoUrl.String(), data.HelmValues.ValueStringPointer(), r.consoleUrl) + handler, err := NewOperatorHandler(ctx, data.GetKubeconfig(), data.HelmRepoUrl.ValueString(), data.HelmValues.ValueStringPointer(), r.consoleUrl) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Unable to init operator handler, got error: %s", err)) return diff --git a/internal/resource/cluster_schema.go b/internal/resource/cluster_schema.go index 1c93eb4..dae73df 100644 --- a/internal/resource/cluster_schema.go +++ b/internal/resource/cluster_schema.go @@ -121,6 +121,7 @@ func (r *clusterResource) schema() schema.Schema { Optional: true, Computed: true, Default: stringdefault.StaticString(console.RepoUrl), + PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "helm_values": schema.StringAttribute{ Description: "Additional Helm values you'd like to use in deployment agent Helm installs. This is useful for BYOK clusters that need to use custom images or other constructs.",