common

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2019 License: Apache-2.0 Imports: 20 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"
	ConfigPodLabelValue             = "grafana.pod.label"
	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
	PodLabelDefaultValue            = "grafana"
	DefaultServiceType              = "ClusterIP"
	DefaultLogLevel                 = "info"
	SecretsMountDir                 = "/etc/grafana-secrets/"
	ConfigMapsMountDir              = "/etc/grafana-configmaps/"
)
View Source
const (
	StatusResourceUninitialized int = iota
	StatusResourceSetFinalizer
	StatusResourceCreated
	StatusResourceOrphaned
)
View Source
const (
	RouteKind = "Route"
)

Route kind is not provided by the openshift api

Variables

This section is empty.

Functions

func AppendMessage added in v1.2.0

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

AppendMessage a status message to the origin dashboard of a plugin

Types

type Background

type Background struct {
	SubscriptionChannel chan schema.GroupVersionKind
	// contains filtered or unexported fields
}

Background represents a procedure that runs in the background, periodically auto-detecting features

func NewAutoDetect

func NewAutoDetect(mgr manager.Manager) (*Background, error)

New creates a new auto-detect runner

func (*Background) Start

func (b *Background) Start()

Start initializes the auto-detection process that runs in the background

func (*Background) Stop

func (b *Background) Stop()

Stop causes the background process to stop auto detecting capabilities

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) RemoveConfigItem

func (c *ControllerConfig) RemoveConfigItem(key string)

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

RestartGrafana is reponsipble for restarting the pods

func (KubeHelperImpl) UpdateDashboard

func (h KubeHelperImpl) UpdateDashboard(d *v1alpha1.GrafanaDashboard, json string) (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(hash string) error

UpdateGrafanaDeployment is responsible for update the config hash on the deployment

func (KubeHelperImpl) UpdateGrafanaInitContainersDeployment

func (h KubeHelperImpl) UpdateGrafanaInitContainersDeployment(newEnv string) error

UpdateGrafanaInitContainersDeployment updates the initcontainer config environment vars

Jump to

Keyboard shortcuts

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