Skip to content

Commit

Permalink
Fix issue included_library_variable_sets: was cty.ListValEmpty(cty.St…
Browse files Browse the repository at this point in the history
…ring), but now null.
  • Loading branch information
HuyPhanNguyen committed Aug 15, 2024
1 parent 3708cae commit 3fab218
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions octopusdeploy_framework/resource_project_expand.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
7 changes: 6 additions & 1 deletion octopusdeploy_framework/resource_project_flatten.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 3fab218

Please sign in to comment.