mirror of
https://github.com/kemko/nomad.git
synced 2026-01-05 09:55:44 +03:00
Add NodePolicy test helper
This commit is contained in:
@@ -24,6 +24,11 @@ func NamespacePolicy(namespace string, policy string, capabilities []string) str
|
||||
return policyHCL
|
||||
}
|
||||
|
||||
// NodePolicy is a helper for generating the hcl for a given node policy.
|
||||
func NodePolicy(policy string) string {
|
||||
return fmt.Sprintf("node {\n\tpolicy = %q\n}\n", policy)
|
||||
}
|
||||
|
||||
// CreatePolicy creates a policy with the given name and rule.
|
||||
func CreatePolicy(t *testing.T, state *state.StateStore, index uint64, name, rule string) {
|
||||
t.Helper()
|
||||
|
||||
Reference in New Issue
Block a user