backport of commit 8cabda5ec5c1d0dd3290ece4789cd8fea1ca3f5c (#18043)

This pull request was automerged via backport-assistant
This commit is contained in:
hc-github-team-nomad-core 2023-07-24 04:44:15 -05:00 committed by GitHub
parent 40549e1132
commit 0400ec6df4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -88,9 +88,9 @@ type CertOpts struct {
ExtKeyUsage []x509.ExtKeyUsage
}
// IsCustom checks whether any of CAOpts parameters have been populated with
// IsNotCustom checks whether any of CAOpts parameters have been populated with
// non-default values.
func (c *CAOpts) IsCustom() bool {
func (c *CAOpts) IsNotCustom() bool {
return c.Country == "" &&
c.PostalCode == "" &&
c.Province == "" &&
@ -131,7 +131,7 @@ func GenerateCA(opts CAOpts) (string, string, error) {
}
}
if opts.IsCustom() {
if opts.IsNotCustom() {
opts.Name = fmt.Sprintf("Nomad Agent CA %d", sn)
if opts.Days == 0 {
opts.Days = 1825