Add validation

This commit is contained in:
Nail Islamov 2018-11-28 12:20:09 +11:00
parent 3f1b120eda
commit 88c0ad0b6a
No known key found for this signature in database
GPG key ID: 36245154B2536826

View file

@ -109,6 +109,10 @@ func (cmd *PrometheusAdapter) makeProvider(promClient prom.Client, stopCh <-chan
return nil, nil
}
if cmd.MetricsMaxAge < cmd.MetricsRelistInterval {
return nil, fmt.Errorf("max age must not be less than relist interval")
}
// grab the mapper and dynamic client
mapper, err := cmd.RESTMapper()
if err != nil {