common

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

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"
	ConfigGrafanaPluginsUpdated     = "grafana.plugins.updated"
	ConfigOpenshift                 = "mode.openshift"
	GrafanaImage                    = "quay.io/openshift/origin-grafana"
	GrafanaVersion                  = "4.2"
	GrafanaConfigMapName            = "grafana-config"
	GrafanaConfigFileName           = "grafana.ini"
	GrafanaProvidersConfigMapName   = "grafana-providers"
	GrafanaDatasourcesConfigMapName = "grafana-datasources"
	GrafanaDashboardsConfigMapName  = "grafana-dashboards"
	GrafanaServiceAccountName       = "grafana-serviceaccount"
	GrafanaDeploymentName           = "grafana-deployment"
	GrafanaRouteName                = "grafana-route"
	GrafanaIngressName              = "grafana-ingress"
	GrafanaServiceName              = "grafana-service"
	GrafanaDataPath                 = "/var/lib/grafana"
	GrafanaLogsPath                 = "/var/log/grafana"
	GrafanaPluginsPath              = "/var/lib/grafana/plugins"
	GrafanaProvisioningPath         = "/etc/grafana/provisioning"
	PluginsInitContainerImage       = "quay.io/integreatly/grafana_plugins_init"
	PluginsInitContainerTag         = "0.0.2"
	PluginsEnvVar                   = "GRAFANA_PLUGINS"
	PluginsUrl                      = "https://grafana.com/api/plugins/%s/versions/%s"
	PluginsMinAge                   = 5
	InitContainerName               = "grafana-plugins-init"
	ResourceFinalizerName           = "grafana.cleanup"
	RequeueDelay                    = time.Second * 15
)
View Source
const (
	StatusResourceUninitialized int = iota
	StatusResourceSetFinalizer
	StatusResourceCreated
	StatusResourceOrphaned
)

Variables

This section is empty.

Functions

func AppendMessage added in v1.2.0

func AppendMessage(message string, dashboard *v1alpha1.GrafanaDashboard)

Append a status message to the origin dashboard of a plugin

Types

type ControllerConfig

type ControllerConfig struct {
	Values  map[string]interface{}
	Plugins map[string]v1alpha1.PluginList
}

func GetControllerConfig

func GetControllerConfig() *ControllerConfig

func (*ControllerConfig) AddConfigItem

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

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(dashboard *v1alpha1.GrafanaDashboard) string

func (*ControllerConfig) GetPluginsFor

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

func (*ControllerConfig) HasConfigItem

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

func (*ControllerConfig) RemovePluginsFor

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

func (*ControllerConfig) SetPluginsFor

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

type KubeHelperImpl

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

func NewKubeHelper

func NewKubeHelper() *KubeHelperImpl

func (KubeHelperImpl) DeleteDashboard

func (h KubeHelperImpl) DeleteDashboard(d *v1alpha1.GrafanaDashboard) error

func (KubeHelperImpl) DeleteDataSources

func (h KubeHelperImpl) DeleteDataSources(name, namespace string) error

func (KubeHelperImpl) IsKnown added in v1.3.1

func (h KubeHelperImpl) IsKnown(kind string, o runtime.Object) (bool, error)

func (KubeHelperImpl) RestartGrafana

func (h KubeHelperImpl) RestartGrafana() error

func (KubeHelperImpl) UpdateDashboard

func (h KubeHelperImpl) UpdateDashboard(d *v1alpha1.GrafanaDashboard) (bool, error)

func (KubeHelperImpl) UpdateDataSources

func (h KubeHelperImpl) UpdateDataSources(name, namespace, ds string) (bool, error)

func (KubeHelperImpl) UpdateGrafanaConfig added in v1.2.0

func (h KubeHelperImpl) UpdateGrafanaConfig(config string, cr *v1alpha1.Grafana) error

func (KubeHelperImpl) UpdateGrafanaDeployment

func (h KubeHelperImpl) UpdateGrafanaDeployment(newEnv string) error

Jump to

Keyboard shortcuts

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