mirror of
https://github.com/prometheus-operator/prometheus-operator.git
synced 2025-04-21 11:48:53 +00:00
Add default for crd-kinds
This commit is contained in:
parent
39bcca276f
commit
f99b25bdda
2 changed files with 10 additions and 9 deletions
|
@ -44,8 +44,8 @@ var (
|
|||
)
|
||||
|
||||
func init() {
|
||||
cfg.CrdKinds = monitoringv1.DefaultCrdKinds
|
||||
flagset := flag.NewFlagSet(os.Args[0], flag.ExitOnError)
|
||||
|
||||
flagset.StringVar(&cfg.Host, "apiserver", "", "API Server addr, e.g. ' - NOT RECOMMENDED FOR PRODUCTION - http://127.0.0.1:8080'. Omit parameter to run in on-cluster mode and utilize the service account token.")
|
||||
flagset.StringVar(&cfg.TLSConfig.CertFile, "cert-file", "", " - NOT RECOMMENDED FOR PRODUCTION - Path to public TLS certificate file.")
|
||||
flagset.StringVar(&cfg.TLSConfig.KeyFile, "key-file", "", "- NOT RECOMMENDED FOR PRODUCTION - Path to private TLS certificate file.")
|
||||
|
|
|
@ -27,7 +27,7 @@ import (
|
|||
const (
|
||||
Group = "monitoring.coreos.com"
|
||||
PrometheusKindKey = "prometheus"
|
||||
AlertManagerKindKey = "alermanager"
|
||||
AlertManagerKindKey = "alertmanager"
|
||||
ServiceMonitorKindKey = "servicemonitor"
|
||||
)
|
||||
|
||||
|
@ -43,6 +43,13 @@ type CrdKinds struct {
|
|||
ServiceMonitor CrdKind
|
||||
}
|
||||
|
||||
var DefaultCrdKinds CrdKinds = CrdKinds{
|
||||
KindsString: "",
|
||||
Prometheus: CrdKind{Plural: PrometheusName, Kind: PrometheusesKind},
|
||||
ServiceMonitor: CrdKind{Plural: ServiceMonitorName, Kind: ServiceMonitorsKind},
|
||||
Alertmanager: CrdKind{Plural: AlertmanagerName, Kind: AlertmanagersKind},
|
||||
}
|
||||
|
||||
// Implement the flag.Value interface
|
||||
func (crdkinds *CrdKinds) String() string {
|
||||
return crdkinds.KindsString
|
||||
|
@ -50,6 +57,7 @@ func (crdkinds *CrdKinds) String() string {
|
|||
|
||||
// Set Implement the flag.Set interface
|
||||
func (crdkinds *CrdKinds) Set(value string) error {
|
||||
*crdkinds = DefaultCrdKinds
|
||||
if value == "" {
|
||||
value = fmt.Sprintf("%s=%s:%s,%s=%s:%s,%s=%s:%s",
|
||||
PrometheusKindKey, PrometheusesKind, PrometheusName,
|
||||
|
@ -77,13 +85,6 @@ func (crdkinds *CrdKinds) Set(value string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
var DefaultCrdKinds CrdKinds = CrdKinds{
|
||||
KindsString: "",
|
||||
Prometheus: CrdKind{Plural: PrometheusName, Kind: PrometheusesKind},
|
||||
ServiceMonitor: CrdKind{Plural: ServiceMonitorName, Kind: ServiceMonitorsKind},
|
||||
Alertmanager: CrdKind{Plural: AlertmanagerName, Kind: AlertmanagersKind},
|
||||
}
|
||||
|
||||
var Version = "v1"
|
||||
|
||||
type MonitoringV1Interface interface {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue