backport of commit 0a5e90120b18ff450457463d6bcee68ec6804bb0 (#17900)

This pull request was automerged via backport-assistant
This commit is contained in:
hc-github-team-nomad-core 2023-07-11 10:00:05 -05:00 committed by GitHub
parent 9f0f897077
commit 0951fe1c50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 10 deletions

View File

@ -120,6 +120,24 @@ meta {
input: "",
expected: &api.Namespace{},
},
{
name: "lists in node pool config are nil if not provided",
input: `
name = "nil-lists"
node_pool_config {
default = "default"
}
`,
expected: &api.Namespace{
Name: "nil-lists",
NodePoolConfiguration: &api.NamespaceNodePoolConfiguration{
Default: "default",
Allowed: nil,
Denied: nil,
},
},
},
}
for _, tc := range testCases {

View File

@ -5396,10 +5396,10 @@ type NamespaceNodePoolConfiguration struct {
Default string
// Allowed specifies the node pools that are allowed to be used by jobs in
// this namespace. This field supports wildcard globbing through the use
// of `*` for multi-character matching. If specified, only the node pools
// that match these patterns are allowed. This field cannot be used
// with Denied.
// this namespace. By default, all node pools are allowed. If an empty list
// is provided only the namespace's default node pool is allowed. This field
// supports wildcard globbing through the use of `*` for multi-character
// matching. This field cannot be used with Denied.
Allowed []string
// Denied specifies the node pools that are not allowed to be used by jobs

View File

@ -79,13 +79,13 @@ node_pool_config {
- `default` `(string: "default")` - Specifies the node pool to use for jobs in
this namespace that don't define a node pool in their specification.
- `allowed` `(array<string>: [])` - Specifies the node pools that are allowed
to be used by jobs in this namespace. This field supports wildcard globbing
through the use of `*` for multi-character matching. If specified, only the
node pools that match these patterns are allowed. This field cannot be used
with `denied`.
- `allowed` `(array<string>: nil)` - Specifies the node pools that are allowed
to be used by jobs in this namespace. By default, all node pools are allowed.
If an empty list is provided only the namespace's default node pool is
allowed. This field supports wildcard globbing through the use of `*` for
multi-character matching. This field cannot be used with `denied`.
- `denied` `(array<string>: [])` - Specifies the node pools that are not
- `denied` `(array<string>: nil)` - Specifies the node pools that are not
allowed to be used by jobs in this namespace. This field supports wildcard
globbing through the use of `*` for multi-character matching. If specified,
any node pool is allowed to be used, except for those that match any of these