config

package
v4.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2021 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ConfigGrafanaImage                      = "grafana.image.url"
	ConfigGrafanaImageTag                   = "grafana.image.tag"
	ConfigPluginsInitContainerImage         = "grafana.plugins.init.container.image.url"
	ConfigPluginsInitContainerTag           = "grafana.plugins.init.container.image.tag"
	ConfigOperatorNamespace                 = "grafana.operator.namespace"
	ConfigDashboardLabelSelector            = "grafana.dashboard.selector"
	ConfigOpenshift                         = "mode.openshift"
	ConfigJsonnetBasePath                   = "grafonnet.location"
	GrafanaDataPath                         = "/var/lib/grafana"
	GrafanaLogsPath                         = "/var/log/grafana"
	GrafanaPluginsPath                      = "/var/lib/grafana/plugins"
	GrafanaProvisioningPath                 = "/etc/grafana/provisioning/"
	GrafanaProvisioningPluginsPath          = "/etc/grafana/provisioning/plugins"
	GrafanaProvisioningDashboardsPath       = "/etc/grafana/provisioning/dashboards"
	GrafanaProvisioningNotifiersPath        = "/etc/grafana/provisioning/notifiers"
	PluginsInitContainerImage               = "quay.io/grafana-operator/grafana_plugins_init"
	PluginsInitContainerTag                 = "0.0.5"
	PluginsUrl                              = "https://grafana.com/api/plugins/%s/versions/%s"
	RequeueDelay                            = time.Second * 10
	SecretsMountDir                         = "/etc/grafana-secrets/" // #nosec G101
	ConfigMapsMountDir                      = "/etc/grafana-configmaps/"
	ConfigRouteWatch                        = "watch.routes"
	ConfigGrafanaDashboardsSynced           = "grafana.dashboards.synced"
	ConfigGrafanaNotificationChannelsSynced = "grafana.notificationchannels.synced"
	JsonnetBasePath                         = "/opt/jsonnet"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ControllerConfig

type ControllerConfig struct {
	*sync.Mutex
	Values     map[string]interface{}
	Plugins    map[string]v1alpha1.PluginList
	Dashboards []*v1alpha1.GrafanaDashboardRef
}

func GetControllerConfig

func GetControllerConfig() *ControllerConfig

func (*ControllerConfig) AddConfigItem

func (c *ControllerConfig) AddConfigItem(key string, value interface{})

func (*ControllerConfig) AddDashboard

func (c *ControllerConfig) AddDashboard(dashboard *v1alpha1.GrafanaDashboard, folderId *int64, folderName string)

func (*ControllerConfig) Cleanup

func (c *ControllerConfig) Cleanup(plugins bool)

func (*ControllerConfig) GetAllPlugins

func (c *ControllerConfig) GetAllPlugins() v1alpha1.PluginList

func (*ControllerConfig) GetConfigBool

func (c *ControllerConfig) GetConfigBool(key string, defaultValue bool) bool

func (*ControllerConfig) GetConfigItem

func (c *ControllerConfig) GetConfigItem(key string, defaultValue interface{}) interface{}

func (*ControllerConfig) GetConfigString

func (c *ControllerConfig) GetConfigString(key, defaultValue string) string

func (*ControllerConfig) GetConfigTimestamp

func (c *ControllerConfig) GetConfigTimestamp(key string, defaultValue time.Time) time.Time

func (*ControllerConfig) GetDashboardId

func (c *ControllerConfig) GetDashboardId(namespace, name string) string

func (*ControllerConfig) GetDashboards

func (c *ControllerConfig) GetDashboards(namespace string) []*v1alpha1.GrafanaDashboardRef

func (*ControllerConfig) GetPluginsFor

func (c *ControllerConfig) GetPluginsFor(dashboard *v1alpha1.GrafanaDashboard) v1alpha1.PluginList

func (*ControllerConfig) HasConfigItem

func (c *ControllerConfig) HasConfigItem(key string) bool

func (*ControllerConfig) HasDashboard

func (c *ControllerConfig) HasDashboard(str string) (int, bool)

func (*ControllerConfig) InvalidateDashboards

func (c *ControllerConfig) InvalidateDashboards()

func (*ControllerConfig) RemoveConfigItem

func (c *ControllerConfig) RemoveConfigItem(key string)

func (*ControllerConfig) RemoveDashboard

func (c *ControllerConfig) RemoveDashboard(hash string)

func (*ControllerConfig) RemovePluginsFor

func (c *ControllerConfig) RemovePluginsFor(namespace, name string)

func (*ControllerConfig) SetDashboards

func (c *ControllerConfig) SetDashboards(dashboards []*v1alpha1.GrafanaDashboardRef)

func (*ControllerConfig) SetPluginsFor

func (c *ControllerConfig) SetPluginsFor(dashboard *v1alpha1.GrafanaDashboard)

type GrafanaIni

type GrafanaIni struct {
	// contains filtered or unexported fields
}

func NewGrafanaIni

func NewGrafanaIni(cfg *v1alpha1.GrafanaConfig) *GrafanaIni

func (*GrafanaIni) Write

func (i *GrafanaIni) Write() (string, string)

type NotificationControllerConfig

type NotificationControllerConfig struct {
	*sync.Mutex
	Values               map[string]interface{}
	NotificationChannels map[string][]*v1alpha1.GrafanaNotificationChannelRef
}

func GetNotificationControllerConfig

func GetNotificationControllerConfig() *NotificationControllerConfig

func (*NotificationControllerConfig) AddConfigItem

func (c *NotificationControllerConfig) AddConfigItem(key string, value interface{})

func (*NotificationControllerConfig) AddNotificationChannel

func (c *NotificationControllerConfig) AddNotificationChannel(notificationchannel *v1alpha1.GrafanaNotificationChannel)

func (*NotificationControllerConfig) GetConfigBool

func (c *NotificationControllerConfig) GetConfigBool(key string, defaultValue bool) bool

func (*NotificationControllerConfig) GetConfigItem

func (c *NotificationControllerConfig) GetConfigItem(key string, defaultValue interface{}) interface{}

func (*NotificationControllerConfig) GetConfigString

func (c *NotificationControllerConfig) GetConfigString(key, defaultValue string) string

func (*NotificationControllerConfig) GetConfigTimestamp

func (c *NotificationControllerConfig) GetConfigTimestamp(key string, defaultValue time.Time) time.Time

func (*NotificationControllerConfig) GetNotificationChannelId

func (c *NotificationControllerConfig) GetNotificationChannelId(namespace, name string) string

func (*NotificationControllerConfig) GetNotificationChannels

func (c *NotificationControllerConfig) GetNotificationChannels(namespace string) []*v1alpha1.GrafanaNotificationChannelRef

func (*NotificationControllerConfig) HasConfigItem

func (c *NotificationControllerConfig) HasConfigItem(key string) bool

func (*NotificationControllerConfig) HasNotificationChannel

func (c *NotificationControllerConfig) HasNotificationChannel(namespace, name string) (int, bool)

func (*NotificationControllerConfig) InvalidateNotificationChannels

func (c *NotificationControllerConfig) InvalidateNotificationChannels()

func (*NotificationControllerConfig) RemoveConfigItem

func (c *NotificationControllerConfig) RemoveConfigItem(key string)

func (*NotificationControllerConfig) RemoveNotificationChannel

func (c *NotificationControllerConfig) RemoveNotificationChannel(namespace, name string)

func (*NotificationControllerConfig) SetNotificationChannels

func (c *NotificationControllerConfig) SetNotificationChannels(notificationchannels map[string][]*v1alpha1.GrafanaNotificationChannelRef)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL