grafana

package
v4.10.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 33 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ControllerName              = "grafana-controller"
	DefaultClientTimeoutSeconds = 5
)
View Source
const (
	JsonnetExtension  = ".libsonnet"
	JsonnetAnnotation = "jsonnet/library"
)

Variables

This section is empty.

Functions

func Add

func Add(mgr manager.Manager, autodetectChannel chan schema.GroupVersionKind, _ string) error

Add creates a new Grafana Controller and adds it to the Manager. The Manager will set fields on the Controller and Start it when the Manager is Started.

func NewReconciler

func NewReconciler(mgr manager.Manager) reconcile.Reconciler

NewReconciler returns a new reconcile.Reconciler

Types

type GrafanaReconciler

type GrafanaReconciler struct {
	DsHash          string
	ConfigHash      string
	CredentialsHash string
	PluginsEnv      string
	Plugins         *PluginsHelperImpl
}

func NewGrafanaReconciler

func NewGrafanaReconciler() *GrafanaReconciler

func (*GrafanaReconciler) Reconcile

type PluginsHelperImpl

type PluginsHelperImpl struct {
	BaseUrl    string
	HttpClient *http.Client
}

func NewPluginsHelper

func NewPluginsHelper() *PluginsHelperImpl

func (*PluginsHelperImpl) BuildEnv

Turns an array of plugins into a string representation of the form `<name>:<version>,...` that is used as the value for the GRAFANA_PLUGINS environment variable

func (*PluginsHelperImpl) FilterPlugins

Creates the list of plugins that can be added or updated Does not directly deal with removing plugins: if a plugin is not in the list and the env var is updated, it will automatically be removed

func (*PluginsHelperImpl) PluginExists

func (h *PluginsHelperImpl) PluginExists(plugin grafanav1alpha1.GrafanaPlugin) bool

Query the Grafana plugin database for the given plugin and version A 200 OK response indicates that the plugin exists and can be downloaded

type ReconcileGrafana

type ReconcileGrafana struct {
	// This client, initialized using mgr.Client() above, is a split client
	// that reads objects from the cache and writes to the apiserver
	Client   client.Client
	Scheme   *runtime.Scheme
	Plugins  *PluginsHelperImpl
	Context  context.Context
	Log      logr.Logger
	Cancel   context.CancelFunc
	Config   *config.ControllerConfig
	Recorder record.EventRecorder
}

ReconcileGrafana reconciles a Grafana object

func (*ReconcileGrafana) Reconcile

func (r *ReconcileGrafana) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)

Reconcile reads that state of the cluster for a Grafana object and makes changes based on the state read and what is in the Grafana.Spec

func (*ReconcileGrafana) SetupWithManager

func (r *ReconcileGrafana) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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