LIGHTSAIL SD: Validate HTTP config
Related-to #12810 Signed-off-by: Jayapriya Pai <janantha@redhat.com>
This commit is contained in:
parent
d27cb0564d
commit
57988fda75
|
@ -1749,6 +1749,10 @@ var expectedErrors = []struct {
|
||||||
filename: "ec2_token_file.bad.yml",
|
filename: "ec2_token_file.bad.yml",
|
||||||
errMsg: `at most one of bearer_token & bearer_token_file must be configured`,
|
errMsg: `at most one of bearer_token & bearer_token_file must be configured`,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
filename: "lightsail_token_file.bad.yml",
|
||||||
|
errMsg: `at most one of bearer_token & bearer_token_file must be configured`,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
filename: "section_key_dup.bad.yml",
|
filename: "section_key_dup.bad.yml",
|
||||||
errMsg: "field scrape_configs already set in type config.plain",
|
errMsg: "field scrape_configs already set in type config.plain",
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
scrape_configs:
|
||||||
|
- job_name: foo
|
||||||
|
lightsail_sd_configs:
|
||||||
|
- region: us-east-1
|
||||||
|
bearer_token: foo
|
||||||
|
bearer_token_file: foo
|
|
@ -109,7 +109,7 @@ func (c *LightsailSDConfig) UnmarshalYAML(unmarshal func(interface{}) error) err
|
||||||
}
|
}
|
||||||
c.Region = region
|
c.Region = region
|
||||||
}
|
}
|
||||||
return nil
|
return c.HTTPClientConfig.Validate()
|
||||||
}
|
}
|
||||||
|
|
||||||
// LightsailDiscovery periodically performs Lightsail-SD requests. It implements
|
// LightsailDiscovery periodically performs Lightsail-SD requests. It implements
|
||||||
|
|
Loading…
Reference in New Issue