From edf3c01950aaae4847aff9894513868df16a1617 Mon Sep 17 00:00:00 2001 From: Anil Gadiyar Date: Thu, 19 Sep 2024 15:52:51 +0530 Subject: [PATCH 1/2] Resolved the non-null realm issue affecting address blocks and subnets --- .gitignore | 3 +++ internal/service/ipam/model_ipamsvc_address_block.go | 3 ++- internal/service/ipam/model_ipamsvc_subnet.go | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e47c3ca7..8eb6750e 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,6 @@ terraform.tfstate .openapi-generator/ internal/service/*/.openapi-generator-ignore + +# Ignore the metadata files +**/.DS_Store \ No newline at end of file diff --git a/internal/service/ipam/model_ipamsvc_address_block.go b/internal/service/ipam/model_ipamsvc_address_block.go index c7525556..a4fd71f9 100644 --- a/internal/service/ipam/model_ipamsvc_address_block.go +++ b/internal/service/ipam/model_ipamsvc_address_block.go @@ -292,6 +292,7 @@ var IpamsvcAddressBlockResourceSchemaAttributes = map[string]schema.Attribute{ "federated_realms": schema.ListAttribute{ ElementType: types.StringType, Optional: true, + Computed: true, MarkdownDescription: "Federated realms to which this address block belongs.", }, "header_option_filename": schema.StringAttribute{ @@ -536,7 +537,7 @@ func (m *IpamsvcAddressBlockModel) Flatten(ctx context.Context, from *ipam.Addre m.DiscoveryAttrs = flex.FlattenFrameworkMapString(ctx, from.DiscoveryAttrs, diags) m.DiscoveryMetadata = flex.FlattenFrameworkMapString(ctx, from.DiscoveryMetadata, diags) m.ExternalKeys = flex.FlattenFrameworkMapString(ctx, from.ExternalKeys, diags) - m.FederatedRealms = flex.FlattenFrameworkListString(ctx, from.FederatedRealms, diags) + m.FederatedRealms = flex.FlattenFrameworkListStringNotNull(ctx, from.FederatedRealms, diags) m.HeaderOptionFilename = flex.FlattenStringPointer(from.HeaderOptionFilename) m.HeaderOptionServerAddress = flex.FlattenStringPointer(from.HeaderOptionServerAddress) m.HeaderOptionServerName = flex.FlattenStringPointer(from.HeaderOptionServerName) diff --git a/internal/service/ipam/model_ipamsvc_subnet.go b/internal/service/ipam/model_ipamsvc_subnet.go index a44a5c97..620eba1f 100644 --- a/internal/service/ipam/model_ipamsvc_subnet.go +++ b/internal/service/ipam/model_ipamsvc_subnet.go @@ -322,6 +322,7 @@ var IpamsvcSubnetResourceSchemaAttributes = map[string]schema.Attribute{ "federated_realms": schema.ListAttribute{ ElementType: types.StringType, Optional: true, + Computed: true, MarkdownDescription: "Federated realms to which this subnet belongs.", }, "header_option_filename": schema.StringAttribute{ @@ -570,7 +571,7 @@ func (m *IpamsvcSubnetModel) Flatten(ctx context.Context, from *ipam.Subnet, dia m.DiscoveryAttrs = flex.FlattenFrameworkMapString(ctx, from.DiscoveryAttrs, diags) m.DiscoveryMetadata = flex.FlattenFrameworkMapString(ctx, from.DiscoveryMetadata, diags) m.ExternalKeys = flex.FlattenFrameworkMapString(ctx, from.ExternalKeys, diags) - m.FederatedRealms = flex.FlattenFrameworkListString(ctx, from.FederatedRealms, diags) + m.FederatedRealms = flex.FlattenFrameworkListStringNotNull(ctx, from.FederatedRealms, diags) m.HeaderOptionFilename = flex.FlattenStringPointer(from.HeaderOptionFilename) m.HeaderOptionServerAddress = flex.FlattenStringPointer(from.HeaderOptionServerAddress) m.HeaderOptionServerName = flex.FlattenStringPointer(from.HeaderOptionServerName) From c33443abe2b4c22ecf7911bf4e90e5128fe5e212 Mon Sep 17 00:00:00 2001 From: Anil Gadiyar Date: Thu, 19 Sep 2024 16:46:53 +0530 Subject: [PATCH 2/2] added space --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 8eb6750e..7982d8e9 100644 --- a/.gitignore +++ b/.gitignore @@ -41,4 +41,4 @@ terraform.tfstate internal/service/*/.openapi-generator-ignore # Ignore the metadata files -**/.DS_Store \ No newline at end of file +**/.DS_Store