@@ -550,14 +550,14 @@ type Config struct {
550550 // of pushgateway backends. If the address contains a hostname it will be resolved
551551 // using system DNS. If the address contains a port, the client will use it
552552 // directly, otherwise port 53 is used.
553- LookupDNSAuthority string `validate:"required_with=PushgatewayService,ip|hostname|hostname_port"`
553+ LookupDNSAuthority string `validate:"required_with=PushgatewayService,omitempty, ip|hostname|hostname_port"`
554554 // PushgatewayService entry contains a service and domain name that will be used
555555 // to construct a SRV DNS query to lookup pushgateway backends. For example: if
556556 // the resource record is 'foo.service.consul', then the 'Service' is 'foo'
557557 // and the 'Domain' is 'service.consul'. The expected dNSName to be
558558 // authenticated in the server certificate would be 'foo.service.consul'.
559- PushgatewayService cmd.ServiceDomain `validate:"required_with=LookupDNSAuthority"`
560- PushgatewayScheme string `validate:"required_with=PushgatewayService,oneof=http https"`
559+ PushgatewayService * cmd.ServiceDomain `validate:"required_with=LookupDNSAuthority"`
560+ PushgatewayScheme string `validate:"required_with=PushgatewayService,omitempty ,oneof=http https"`
561561 // Deprecated: cert-checker only logs bad results anyway.
562562 BadResultsOnly bool
563563 CheckPeriod config.Duration
@@ -725,7 +725,7 @@ func main() {
725725 metrics .checkerBadCount .Set (float64 (checker .issuedReport .BadCerts ))
726726
727727 if config .CertChecker .PushgatewayService .Service != "" {
728- pushgatewayURL , err := getPushgatewayURL (config .CertChecker .LookupDNSAuthority , config .CertChecker .PushgatewayScheme , config .CertChecker .PushgatewayService )
728+ pushgatewayURL , err := getPushgatewayURL (config .CertChecker .LookupDNSAuthority , config .CertChecker .PushgatewayScheme , * config .CertChecker .PushgatewayService )
729729 if err != nil {
730730 logger .Errf ("failed to get pushgateway URL: %s" , err )
731731 } else {
0 commit comments