From 3fab21884244672cc04976460a281604effb8b13 Mon Sep 17 00:00:00 2001 From: Huy Nguyen Date: Thu, 15 Aug 2024 15:09:41 +1000 Subject: [PATCH] Fix issue included_library_variable_sets: was cty.ListValEmpty(cty.String), but now null. --- octopusdeploy_framework/resource_project_expand.go | 2 ++ octopusdeploy_framework/resource_project_flatten.go | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/octopusdeploy_framework/resource_project_expand.go b/octopusdeploy_framework/resource_project_expand.go index e0a3316da..692dd5166 100644 --- a/octopusdeploy_framework/resource_project_expand.go +++ b/octopusdeploy_framework/resource_project_expand.go @@ -40,6 +40,8 @@ func expandProject(ctx context.Context, model projectResourceModel) *projects.Pr var includedSets []string model.IncludedLibraryVariableSets.ElementsAs(ctx, &includedSets, false) project.IncludedLibraryVariableSets = includedSets + } else { + project.IncludedLibraryVariableSets = []string{} } if !model.ConnectivityPolicy.IsNull() { diff --git a/octopusdeploy_framework/resource_project_flatten.go b/octopusdeploy_framework/resource_project_flatten.go index 6e411b08d..15a5199b7 100644 --- a/octopusdeploy_framework/resource_project_flatten.go +++ b/octopusdeploy_framework/resource_project_flatten.go @@ -50,7 +50,12 @@ func flattenProject(ctx context.Context, project *projects.Project, state *proje model.ID = types.StringValue(project.GetID()) - model.IncludedLibraryVariableSets = util.FlattenStringList(project.IncludedLibraryVariableSets) + if len(project.IncludedLibraryVariableSets) > 0 { + model.IncludedLibraryVariableSets = util.FlattenStringList(project.IncludedLibraryVariableSets) + } else { + model.IncludedLibraryVariableSets = types.ListValueMust(types.StringType, []attr.Value{}) + } + model.AutoDeployReleaseOverrides = flattenAutoDeployReleaseOverrides(project.AutoDeployReleaseOverrides) if state.ConnectivityPolicy.IsNull() {