Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set ForceNew on the path field of namespaces #1713

Merged
merged 4 commits into from
Jan 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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