nomad icon indicating copy to clipboard operation
nomad copied to clipboard

Add command "nomad tls"

Open lhaig opened this issue 3 years ago • 2 comments

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

lhaig avatar Aug 24 '22 18:08 lhaig

  • 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.

lhaig avatar Aug 25 '22 10:08 lhaig

  • A couple of tests rely on t.Fatal and it would be nice if we could use require instead.

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'))
}

lhaig avatar Aug 25 '22 11:08 lhaig

Preview link https://nomad-nttruonxz-hashicorp.vercel.app/nomad/docs/commands/tls

tgross avatar Nov 18 '22 20:11 tgross

Let's get this merged so it can go out in the next release of Nomad (likely 1.4.4).

tgross avatar Nov 22 '22 19:11 tgross

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.

github-actions[bot] avatar Mar 24 '23 02:03 github-actions[bot]