controllers

package
v5.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequeueDelay = 10 * time.Second
)

Variables

This section is empty.

Functions

func GetMatchingInstances

func GetMatchingInstances(ctx context.Context, k8sClient client.Client, labelSelector *v1.LabelSelector) (v1beta1.GrafanaList, error)

func ReconcilePlugins

func ReconcilePlugins(ctx context.Context, k8sClient client.Client, scheme *runtime.Scheme, grafana *v1beta1.Grafana, plugins v1beta1.PluginList, resource string) error

Types

type GrafanaDashboardReconciler

type GrafanaDashboardReconciler struct {
	Client    client.Client
	Log       logr.Logger
	Scheme    *runtime.Scheme
	Discovery discovery.DiscoveryInterface
}

GrafanaDashboardReconciler reconciles a GrafanaDashboard object

func (*GrafanaDashboardReconciler) DeleteFolderIfEmpty

func (r *GrafanaDashboardReconciler) DeleteFolderIfEmpty(client *grapi.Client, folderID int64) (http.Response, error)

func (*GrafanaDashboardReconciler) Exists

func (r *GrafanaDashboardReconciler) Exists(client *grapi.Client, uid string, title string, folderID int64) (bool, string, error)

func (*GrafanaDashboardReconciler) GetFolderID

func (r *GrafanaDashboardReconciler) GetFolderID(client *grapi.Client,
	title string,
) (bool, int64, error)

func (*GrafanaDashboardReconciler) GetMatchingDashboardInstances

func (r *GrafanaDashboardReconciler) GetMatchingDashboardInstances(ctx context.Context, dashboard *v1beta1.GrafanaDashboard, k8sClient client.Client) (v1beta1.GrafanaList, error)

func (*GrafanaDashboardReconciler) GetOrCreateFolder

func (r *GrafanaDashboardReconciler) GetOrCreateFolder(client *grapi.Client, cr *v1beta1.GrafanaDashboard) (int64, error)

func (*GrafanaDashboardReconciler) Reconcile

func (*GrafanaDashboardReconciler) SetupWithManager

func (r *GrafanaDashboardReconciler) SetupWithManager(mgr ctrl.Manager, ctx context.Context) error

SetupWithManager sets up the controller with the Manager.

func (*GrafanaDashboardReconciler) UpdateHomeDashboard

func (r *GrafanaDashboardReconciler) UpdateHomeDashboard(ctx context.Context, grafana v1beta1.Grafana, uid string, dashboard *v1beta1.GrafanaDashboard) error

type GrafanaDatasourceReconciler

type GrafanaDatasourceReconciler struct {
	client.Client
	Scheme *runtime.Scheme
	Log    logr.Logger
}

GrafanaDatasourceReconciler reconciles a GrafanaDatasource object

func (*GrafanaDatasourceReconciler) Exists

func (r *GrafanaDatasourceReconciler) Exists(client *gapi.Client, uid, name string) (bool, int64, error)

func (*GrafanaDatasourceReconciler) GetMatchingDatasourceInstances

func (r *GrafanaDatasourceReconciler) GetMatchingDatasourceInstances(ctx context.Context, datasource *v1beta1.GrafanaDatasource, k8sClient client.Client) (v1beta1.GrafanaList, error)

func (*GrafanaDatasourceReconciler) Reconcile

func (*GrafanaDatasourceReconciler) SetupWithManager

func (r *GrafanaDatasourceReconciler) SetupWithManager(mgr ctrl.Manager, ctx context.Context) error

SetupWithManager sets up the controller with the Manager.

type GrafanaFolderReconciler

type GrafanaFolderReconciler struct {
	client.Client
	Log    logr.Logger
	Scheme *runtime.Scheme
}

GrafanaFolderReconciler reconciles a GrafanaFolder object

func (*GrafanaFolderReconciler) Exists

func (*GrafanaFolderReconciler) GetMatchingFolderInstances

func (r *GrafanaFolderReconciler) GetMatchingFolderInstances(ctx context.Context, folder *grafanav1beta1.GrafanaFolder, k8sClient client.Client) (grafanav1beta1.GrafanaList, error)

func (*GrafanaFolderReconciler) Reconcile

func (r *GrafanaFolderReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the GrafanaFolder object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.9.2/pkg/reconcile

func (*GrafanaFolderReconciler) SetupWithManager

func (r *GrafanaFolderReconciler) SetupWithManager(mgr ctrl.Manager, ctx context.Context) error

SetupWithManager sets up the controller with the Manager.

func (*GrafanaFolderReconciler) UpdateStatus

type GrafanaReconciler

type GrafanaReconciler struct {
	client.Client
	Log         logr.Logger
	Scheme      *runtime.Scheme
	Discovery   discovery.DiscoveryInterface
	IsOpenShift bool
}

GrafanaReconciler reconciles a Grafana object

func (*GrafanaReconciler) Reconcile

func (r *GrafanaReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*GrafanaReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

Directories

Path Synopsis
Package autodetect is for auto-detecting traits from the environment (platform, APIs, ...).
Package autodetect is for auto-detecting traits from the environment (platform, APIs, ...).

Jump to

Keyboard shortcuts

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