From e25c8be307c4f70c00af4a7de5b13f00cea273d1 Mon Sep 17 00:00:00 2001 From: Dean Date: Thu, 19 Jan 2023 17:39:02 +0100 Subject: [PATCH] fix ACL error (#91) Co-authored-by: Dean Oren --- .../mongodb-flex/instance/data_source_test.go | 2 +- .../internal/resources/kubernetes/cluster/helpers.go | 11 +---------- .../internal/resources/kubernetes/cluster/schema.go | 2 -- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/stackit/internal/data-sources/mongodb-flex/instance/data_source_test.go b/stackit/internal/data-sources/mongodb-flex/instance/data_source_test.go index 806dfcf1..e8958056 100644 --- a/stackit/internal/data-sources/mongodb-flex/instance/data_source_test.go +++ b/stackit/internal/data-sources/mongodb-flex/instance/data_source_test.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) -const run_this_test = true +const run_this_test = false func TestAcc_MongoDBFlexInstance(t *testing.T) { if !common.ShouldAccTestRun(run_this_test) { diff --git a/stackit/internal/resources/kubernetes/cluster/helpers.go b/stackit/internal/resources/kubernetes/cluster/helpers.go index 437d6b24..67410c24 100644 --- a/stackit/internal/resources/kubernetes/cluster/helpers.go +++ b/stackit/internal/resources/kubernetes/cluster/helpers.go @@ -422,16 +422,7 @@ func (c *Cluster) transformExtensions(cl cluster.Cluster) { if c.Extensions == nil || cl.Extensions == nil { return } - c.Extensions = &Extensions{ - Argus: &ArgusExtension{ - Enabled: types.BoolValue(false), - ArgusInstanceID: types.StringNull(), - }, - ACL: &ACL{ - Enabled: types.BoolValue(false), - AllowedCIDRs: types.ListNull(types.StringType), - }, - } + if cl.Extensions.Argus != nil { c.Extensions.Argus = &ArgusExtension{ Enabled: types.BoolValue(cl.Extensions.Argus.Enabled), diff --git a/stackit/internal/resources/kubernetes/cluster/schema.go b/stackit/internal/resources/kubernetes/cluster/schema.go index 173a9923..2e065337 100644 --- a/stackit/internal/resources/kubernetes/cluster/schema.go +++ b/stackit/internal/resources/kubernetes/cluster/schema.go @@ -339,7 +339,6 @@ func (r *Resource) Schema(ctx context.Context, req resource.SchemaRequest, resp "argus": schema.SingleNestedAttribute{ Description: "A single argus block as defined below", Optional: true, - Computed: true, Attributes: map[string]schema.Attribute{ "enabled": schema.BoolAttribute{ Description: "Flag to enable/disable argus extensions. Defaults to `false`", @@ -355,7 +354,6 @@ func (r *Resource) Schema(ctx context.Context, req resource.SchemaRequest, resp "acl": schema.SingleNestedAttribute{ Description: "Cluster access control configuration", Optional: true, - Computed: true, Attributes: map[string]schema.Attribute{ "enabled": schema.BoolAttribute{ Description: "Is ACL enabled? Defaults to `false`",