@@ -47,9 +47,6 @@ type Config struct {
4747}
4848
4949func (c * Config ) validate (mode Mode ) ([]Warning , error ) {
50- if c .HTTPListenAddr == "" {
51- c .HTTPListenAddr = DefaultAddress
52- }
5350 if c .Matcher .DisableUpdaters {
5451 c .Updaters .Sets = []string {}
5552 }
@@ -59,23 +56,25 @@ func (c *Config) validate(mode Mode) ([]Warning, error) {
5956 default :
6057 return nil , fmt .Errorf ("unknown mode: %q" , mode )
6158 }
62- if _ , _ , err := net .SplitHostPort (c .HTTPListenAddr ); err != nil {
63- return nil , err
59+ if c .HTTPListenAddr != "" {
60+ if _ , _ , err := net .SplitHostPort (c .HTTPListenAddr ); err != nil {
61+ return nil , err
62+ }
6463 }
6564 return c .lint ()
6665}
6766
6867func (c * Config ) lint () (ws []Warning , err error ) {
69- if c .HTTPListenAddr = = "" {
68+ if c .HTTPListenAddr ! = "" {
7069 ws = append (ws , Warning {
71- path : ".http_listen_addr" ,
72- msg : `http listen address not provided, default will be used` ,
70+ path : ".http_listen_addr" ,
71+ inner : fmt . Errorf ( `configuration via $.api.v1 is preferred: %w` , ErrDeprecated ) ,
7372 })
7473 }
75- if c .IntrospectionAddr = = "" {
74+ if c .IntrospectionAddr ! = "" {
7675 ws = append (ws , Warning {
77- path : ".introspection_addr" ,
78- msg : `introspection address not provided, default will be used` ,
76+ path : ".introspection_addr" ,
77+ inner : fmt . Errorf ( `configuration via $.introspection is preferred: %w` , ErrDeprecated ) ,
7978 })
8079 }
8180 return ws , nil
0 commit comments