Rename Function to reflect correct outcome. (#17948)

This commit is contained in:
Lance Haig
2023-07-24 11:43:51 +02:00
committed by GitHub
parent ea37488e54
commit 03cde51720

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