common

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: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConditionStatusSuccess = "True"
)
View Source
const (
	RouteKind = "Route"
)

Route kind is not provided by the openshift api

Variables

View Source
var ControllerEvents = make(chan ControllerState, 1)

Functions

func IsDeploymentReady

func IsDeploymentReady(deployment *v12.Deployment) (bool, error)

func IsIngressReady

func IsIngressReady(ingress *netv1.Ingress) bool

func IsRouteReady

func IsRouteReady(route *v1.Route) bool

Types

type ActionRunner

type ActionRunner interface {
	RunAll(desiredState DesiredClusterState) error
	// contains filtered or unexported methods
}

func NewClusterActionRunner

func NewClusterActionRunner(ctx context.Context, client client.Client, scheme *runtime.Scheme, cr client.Object) ActionRunner

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 ClusterAction

type ClusterAction interface {
	Run(runner ActionRunner) (string, error)
}

type ClusterActionRunner

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

func (*ClusterActionRunner) RunAll

func (i *ClusterActionRunner) RunAll(desiredState DesiredClusterState) error

type ClusterState

type ClusterState struct {
	GrafanaService                   *v1.Service
	GrafanaDataPersistentVolumeClaim *v1.PersistentVolumeClaim
	GrafanaServiceAccount            *v1.ServiceAccount
	GrafanaConfig                    *v1.ConfigMap
	GrafanaRoute                     *v12.Route
	GrafanaIngress                   *netv1.Ingress
	GrafanaDeployment                *v13.Deployment
	GrafanaDataSourceConfig          *v1.ConfigMap
	AdminSecret                      *v1.Secret
}

func NewClusterState

func NewClusterState() *ClusterState

func (*ClusterState) Read

func (i *ClusterState) Read(ctx context.Context, cr *v1alpha1.Grafana, client client.Client) error

type ControllerState

type ControllerState struct {
	DashboardSelectors         []*v1.LabelSelector
	DashboardNamespaceSelector *v1.LabelSelector
	AdminUrl                   string
	GrafanaReady               bool
	ClientTimeout              int
}

type DataSourcesState

type DataSourcesState struct {
	ClusterDataSources *v1alpha1.GrafanaDataSourceList
	KnownDataSources   *v1.ConfigMap
}

func NewDataSourcesState

func NewDataSourcesState() *DataSourcesState

func (*DataSourcesState) Read

func (i *DataSourcesState) Read(ctx context.Context, client client.Client, ns string) error

type DeploymentReadyAction

type DeploymentReadyAction struct {
	Ref client.Object
	Msg string
}

func (DeploymentReadyAction) Run

type DesiredClusterState

type DesiredClusterState []ClusterAction

The desired cluster state is defined by a list of actions that have to be run to get from the current state to the desired state

func (*DesiredClusterState) AddAction

func (*DesiredClusterState) AddActions

func (d *DesiredClusterState) AddActions(actions []ClusterAction) DesiredClusterState

type ExposeConfigMapEnvVarAction

type ExposeConfigMapEnvVarAction struct {
	Ref       *v14.ConfigMapEnvSource
	Msg       string
	Namespace string
}

Expose credentials from a secret as an env var to the operator container

func (ExposeConfigMapEnvVarAction) Run

type ExposeSecretEnvVarAction

type ExposeSecretEnvVarAction struct {
	Ref       *v14.SecretEnvSource
	Msg       string
	Namespace string
}

Expose credentials from a secret as an env var to the operator container

func (ExposeSecretEnvVarAction) Run

type GenericCreateAction

type GenericCreateAction struct {
	Ref client.Object
	Msg string
}

An action to create generic kubernetes resources (resources that don't require special treatment)

func (GenericCreateAction) Run

func (i GenericCreateAction) Run(runner ActionRunner) (string, error)

type GenericDeleteAction

type GenericDeleteAction struct {
	Ref client.Object
	Msg string
}

An action to delete generic kubernetes resources (resources that don't require special treatment)

func (GenericDeleteAction) Run

func (i GenericDeleteAction) Run(runner ActionRunner) (string, error)

type GenericUpdateAction

type GenericUpdateAction struct {
	Ref client.Object
	Msg string
}

An action to update generic kubernetes resources (resources that don't require special treatment)

func (GenericUpdateAction) Run

func (i GenericUpdateAction) Run(runner ActionRunner) (string, error)

type IngressReadyAction

type IngressReadyAction struct {
	Ref client.Object
	Msg string
}

func (IngressReadyAction) Run

func (i IngressReadyAction) Run(runner ActionRunner) (string, error)

type LogAction

type LogAction struct {
	Msg string
}

func (LogAction) Run

func (i LogAction) Run(_ ActionRunner) (string, error)

type RouteReadyAction

type RouteReadyAction struct {
	Ref client.Object
	Msg string
}

func (RouteReadyAction) Run

func (i RouteReadyAction) Run(runner ActionRunner) (string, error)

type WaitForRouteAction

type WaitForRouteAction struct {
	Ref client.Object
	Msg string
}

Jump to

Keyboard shortcuts

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