-
Notifications
You must be signed in to change notification settings - Fork 2k
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
vault: add new nomad setup vault -check
commmand
#19720
Conversation
The new `nomad setup vault -check` commmand can be used to retrieve information about the changes required before a cluster is migrated from the deprecated legacy authentication flow with Vault to use only workload identities.
|
||
// Verify only jobs without Vault identity are returned. | ||
must.Len(t, 2, resp.JobsWithoutVaultIdentity) | ||
must.SliceContains(t, resp.JobsWithoutVaultIdentity, jobNoWID.Stub(nil, nil), must.Cmp(cmpopts.IgnoreFields( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I knew somebody would use must.Cmp
one day!! 🥳
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've used them a in a few places while working on node pools. Very handy for ignoring these Raft indexes that we usually don't care about 😄
https://github.com/search?q=repo%3Ahashicorp%2Fnomad%20%22must.Cmp%22&type=code
|
||
// MinNomadVersionVaultWID is the minimum version of Nomad that supports | ||
// workload identities for Vault. | ||
MinNomadVersionVaultWID = version.Must(version.NewVersion("1.7.0-a")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the 1.7.0-a
literal correct? (which I guess could make sense as -a is the first possible pre-release version in semver 2)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, I should've copied this info from the implicit constraint:
nomad/nomad/job_endpoint_hook_implicit_identities.go
Lines 53 to 59 in b2aa6ff
// "-a" is used here so that it is "less than" all pre-release versions of | |
// Nomad 1.7.0 as well | |
return &structs.Constraint{ | |
LTarget: "${attr.nomad.version}", | |
RTarget: ">= 1.7.0-a", | |
Operand: structs.ConstraintSemver, | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great @lgfa29! Just the small suggestions
The new
nomad setup vault -check
commmand can be used to retrieve information about the changes required before a cluster is migrated from the deprecated legacy authentication flow with Vault to use only workload identities.