Skip to content

Commit

Permalink
Set ForceNew on the path field of namespaces (#1713)
Browse files Browse the repository at this point in the history
* Sets ForceNew on the path field of namespaces
  • Loading branch information
kschoche authored Jan 5, 2023
1 parent 0ecc78e commit cd5e179
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions vault/resource_namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func namespaceResource() *schema.Resource {
consts.FieldPath: {
Type: schema.TypeString,
Required: true,
ForceNew: true,
Description: "Namespace path.",
ValidateFunc: provider.ValidateNoLeadingTrailingSlashes,
},
Expand All @@ -45,6 +46,7 @@ func namespaceResource() *schema.Resource {
consts.FieldPathFQ: {
Type: schema.TypeString,
Computed: true,
Optional: true,
Description: "The fully qualified namespace path.",
},
},
Expand Down
6 changes: 6 additions & 0 deletions vault/resource_namespace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ func TestAccNamespace(t *testing.T) {
append(checks, getNestedChecks(0)...)...,
),
},
{
Config: testNestedNamespaces(namespacePath+"-foo", 0),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(resourceNameParent, consts.FieldPath, namespacePath+"-foo"),
testNamespaceDestroy(namespacePath)),
},
},
})
}
Expand Down

0 comments on commit cd5e179

Please sign in to comment.