Skip to content

Commit bfb9d0c

Browse files
authored
Merge pull request #236 from port-labs/ownership_title_fix
write ownership title to state
2 parents 1e3a7d2 + 8f12813 commit bfb9d0c

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

port/blueprint/resource.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ func refreshBlueprintState(ctx context.Context, bm *BlueprintModel, b *cli.Bluep
111111
if b.Ownership.Path != nil {
112112
bm.Ownership.Path = types.StringValue(*b.Ownership.Path)
113113
}
114+
if b.Ownership.Title != nil {
115+
bm.Ownership.Title = types.StringValue(*b.Ownership.Title)
116+
}
114117
}
115118
if b.Ownership == nil && bm.Ownership != nil {
116119
bm.Ownership = nil

port/blueprint/resource_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,7 @@ func TestAccPortBlueprintOwnership(t *testing.T) {
852852
}
853853
ownership = {
854854
type = "Direct"
855+
title = "My direct owning teams"
855856
}
856857
}
857858
`, parentIdentifier)
@@ -900,6 +901,7 @@ func TestAccPortBlueprintOwnership(t *testing.T) {
900901
ownership = {
901902
type = "Inherited"
902903
path = "parent"
904+
title = "My inherited owning teams"
903905
}
904906
}
905907
`, parentIdentifier, childIdentifier)
@@ -915,6 +917,7 @@ func TestAccPortBlueprintOwnership(t *testing.T) {
915917
resource.TestCheckResourceAttr("port_blueprint.parent_blueprint", "identifier", parentIdentifier),
916918
resource.TestCheckResourceAttr("port_blueprint.parent_blueprint", "ownership.type", "Direct"),
917919
resource.TestCheckNoResourceAttr("port_blueprint.parent_blueprint", "ownership.path"),
920+
resource.TestCheckResourceAttr("port_blueprint.parent_blueprint", "ownership.title", "My direct owning teams"),
918921
),
919922
},
920923
{
@@ -924,6 +927,7 @@ func TestAccPortBlueprintOwnership(t *testing.T) {
924927
resource.TestCheckResourceAttr("port_blueprint.child_blueprint", "identifier", childIdentifier),
925928
resource.TestCheckResourceAttr("port_blueprint.child_blueprint", "ownership.type", "Inherited"),
926929
resource.TestCheckResourceAttr("port_blueprint.child_blueprint", "ownership.path", "parent"),
930+
resource.TestCheckResourceAttr("port_blueprint.child_blueprint", "ownership.title", "My inherited owning teams"),
927931
),
928932
},
929933
},

0 commit comments

Comments
 (0)