-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4698 from hashicorp/t-vault-matrix
Vault test matrix
- Loading branch information
Showing
8 changed files
with
422 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package vault | ||
|
||
import ( | ||
"github.com/hashicorp/nomad/api" | ||
"github.com/hashicorp/nomad/helper" | ||
) | ||
|
||
const ( | ||
// policy is the recommended Nomad Vault policy | ||
policy = `path "auth/token/create/nomad-cluster" { | ||
capabilities = ["update"] | ||
} | ||
path "auth/token/roles/nomad-cluster" { | ||
capabilities = ["read"] | ||
} | ||
path "auth/token/lookup-self" { | ||
capabilities = ["read"] | ||
} | ||
path "auth/token/lookup" { | ||
capabilities = ["update"] | ||
} | ||
path "auth/token/revoke-accessor" { | ||
capabilities = ["update"] | ||
} | ||
path "sys/capabilities-self" { | ||
capabilities = ["update"] | ||
} | ||
path "auth/token/renew-self" { | ||
capabilities = ["update"] | ||
}` | ||
) | ||
|
||
var ( | ||
// role is the recommended nomad cluster role | ||
role = map[string]interface{}{ | ||
"disallowed_policies": "nomad-server", | ||
"explicit_max_ttl": 0, | ||
"name": "nomad-cluster", | ||
"orphan": false, | ||
"period": 259200, | ||
"renewable": true, | ||
} | ||
|
||
// job is a test job that is used to request a Vault token and cat the token | ||
// out before exiting. | ||
job = &api.Job{ | ||
ID: helper.StringToPtr("test"), | ||
Type: helper.StringToPtr("batch"), | ||
Datacenters: []string{"dc1"}, | ||
TaskGroups: []*api.TaskGroup{ | ||
{ | ||
Name: helper.StringToPtr("test"), | ||
Tasks: []*api.Task{ | ||
{ | ||
Name: "test", | ||
Driver: "raw_exec", | ||
Config: map[string]interface{}{ | ||
"command": "cat", | ||
"args": []string{"${NOMAD_SECRETS_DIR}/vault_token"}, | ||
}, | ||
Vault: &api.Vault{ | ||
Policies: []string{"default"}, | ||
}, | ||
}, | ||
}, | ||
RestartPolicy: &api.RestartPolicy{ | ||
Attempts: helper.IntToPtr(0), | ||
Mode: helper.StringToPtr("fail"), | ||
}, | ||
}, | ||
}, | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package vault | ||
|
||
var ( | ||
// versions is the set of Vault versions we test for backwards compatibility | ||
versions = []string{ | ||
"0.11.1", | ||
"0.11.0", | ||
"0.10.4", | ||
"0.10.3", | ||
"0.10.2", | ||
"0.10.1", | ||
"0.10.0", | ||
"0.9.6", | ||
"0.9.5", | ||
"0.9.4", | ||
"0.9.3", | ||
"0.9.2", | ||
"0.9.1", | ||
"0.9.0", | ||
"0.8.3", | ||
"0.8.2", | ||
"0.8.1", | ||
"0.8.0", | ||
"0.7.3", | ||
"0.7.2", | ||
"0.7.1", | ||
"0.7.0", | ||
"0.6.5", | ||
"0.6.4", | ||
"0.6.3", | ||
"0.6.2", | ||
} | ||
) |
Oops, something went wrong.