nomad
nomad copied to clipboard
Add command "nomad tls"
This PR adds the same functionality that is currently available in Consul.
It adds the following commands 'nomad tls ca create ' 'nomad tls cert create -server / -client / - cli ' 'nomad tls cert -info '
It also adds the docs
- The create commands take an optional argument which determines the output file prefix. Is there a reason why this couldn't be a flag instead, which seems to suit the optional nature better?
I have removed this as the prefix did nothing in the code.
- A couple of tests rely on
t.Fataland it would be nice if we could userequireinstead.
I have changed the test @jrasell but now I am thinking I should change the name of the test from TestValidateTLSCACreateCommand_noTabs to TestValidateTLSCACreateCommand_hasTabs
This is the new test
func TestValidateTLSCACreateCommand_HasTabs(t *testing.T) {
t.Parallel()
ui := cli.NewMockUi()
cmd := &TLSCACreateCommand{Meta: Meta{Ui: ui}}
code := cmd.Help()
require.False(t, strings.ContainsRune(code, '\t'))
}
Preview link https://nomad-nttruonxz-hashicorp.vercel.app/nomad/docs/commands/tls
Let's get this merged so it can go out in the next release of Nomad (likely 1.4.4).
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.