controllers

package
v0.0.0-...-92cabdc Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventCreate string = "Create"
	EventUpdate string = "Update"
	EventDelete string = "Delete"
)

Variables

View Source
var ImageJob = "6zar/docker-agent:latest"
View Source
var NamespaceJobs = "default"

!TODO: Set by LD Flags on Dockerfile

View Source
var ServiceAccountJob = "docker-agent-sa"

var NamespaceJobs = "operator-system"

Functions

func AddHostConnectionVars

func AddHostConnectionVars(crd *v1.DockerHost, varList *[]apiV1.EnvVar) *[]apiV1.EnvVar

func CreateDockerAgentPod

func CreateDockerAgentPod(env []apiV1.EnvVar, command string) apiV1.PodSpec

func CreateDockerComposeRunnerJob

func CreateDockerComposeRunnerJob(crd *v1.CrdDefinition, action string, configMapName string) (*v1batch.Job, error)

func CreateDockerComposeRunnerPodSpec

func CreateDockerComposeRunnerPodSpec(name, action, configMapNMame string) (apiV1.PodSpec, error)

func CreateDockerHostCronJob

func CreateDockerHostCronJob(crd *v1.DockerHost) (*v1batch.CronJob, error)

func CreateDockerHostPodSpec

func CreateDockerHostPodSpec(crd *v1.DockerHost) (apiV1.PodSpec, error)

func CreateSSHDockerComposeRunnerConfigMap

func CreateSSHDockerComposeRunnerConfigMap(crd *v1.DockerComposeRunner, sshUser string, hostIp string, configMapName string) *apiV1.ConfigMap

func CreateTLSDockerComposeRunnerConfigMap

func CreateTLSDockerComposeRunnerConfigMap(crd *v1.DockerComposeRunner, configMapName string) *apiV1.ConfigMap

func GenerateComposeRunnerConfigMapName

func GenerateComposeRunnerConfigMapName(crdName string) string

func GetLabels

func GetLabels(crdConfig *v1.CrdDefinition) map[string]string

func InstantiateMinimalDockerComposeRunnerJob

func InstantiateMinimalDockerComposeRunnerJob(name string, namespace string) *v1batch.Job

func InstantiateMinimalDockerHostCronJob

func InstantiateMinimalDockerHostCronJob(name string, namespace string) *v1batch.CronJob

func RandStringRunes

func RandStringRunes(n int) string

func ValidateDockerHost

func ValidateDockerHost(crd *v1.DockerHost) (*v1.DockerHost, error)

Types

type DockerComposeRunnerReconciler

type DockerComposeRunnerReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

DockerComposeRunnerReconciler reconciles a DockerComposeRunner object

func (*DockerComposeRunnerReconciler) CleanOldJob

func (r *DockerComposeRunnerReconciler) CleanOldJob(definition *toolv1.CrdDefinition) error

func (*DockerComposeRunnerReconciler) CreateDockerComposeRunnerJob

func (r *DockerComposeRunnerReconciler) CreateDockerComposeRunnerJob(desiredJob *v1batch.Job, instance *toolv1.DockerComposeRunner) error

func (*DockerComposeRunnerReconciler) CreateJob

func (r *DockerComposeRunnerReconciler) CreateJob(definition *toolv1.CrdDefinition, action string, configMapName string) error

func (*DockerComposeRunnerReconciler) DefineConfigMapName

func (r *DockerComposeRunnerReconciler) DefineConfigMapName(instance *toolv1.DockerComposeRunner, configMapName string, dockerHost toolv1.DockerHost) error

func (*DockerComposeRunnerReconciler) DeleteDockerComposeRunnerJob

func (r *DockerComposeRunnerReconciler) DeleteDockerComposeRunnerJob(name string, namespace string) error

func (*DockerComposeRunnerReconciler) GetDockerComposeRunnerCurrentState

func (r *DockerComposeRunnerReconciler) GetDockerComposeRunnerCurrentState(crdName string) (*v1batch.Job, error)

func (*DockerComposeRunnerReconciler) Reconcile

func (*DockerComposeRunnerReconciler) RunComposeDownJob

func (r *DockerComposeRunnerReconciler) RunComposeDownJob(name string, namespace string) error

func (*DockerComposeRunnerReconciler) RunComposeUpJob

func (r *DockerComposeRunnerReconciler) RunComposeUpJob(instance *toolv1.DockerComposeRunner) error

func (*DockerComposeRunnerReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager and its filters.

type DockerHostReconciler

type DockerHostReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

DockerHostReconciler reconciles a DockerHost object

func (*DockerHostReconciler) CreateDockerHostCronJob

func (r *DockerHostReconciler) CreateDockerHostCronJob(desiredJob *v1batch.CronJob, instance *toolv1.DockerHost) error

func (*DockerHostReconciler) DeleteDockerHostCronJob

func (r *DockerHostReconciler) DeleteDockerHostCronJob(name string, namespace string) error

func (*DockerHostReconciler) GetDockerHostCurrentState

func (r *DockerHostReconciler) GetDockerHostCurrentState(crdName string) (*v1batch.CronJob, error)

func (*DockerHostReconciler) Reconcile

func (r *DockerHostReconciler) 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 DockerHost 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.14.1/pkg/reconcile

func (*DockerHostReconciler) RemoveOldDockerHostCronJob

func (r *DockerHostReconciler) RemoveOldDockerHostCronJob(instance *toolv1.DockerHost) error

func (*DockerHostReconciler) SetupWithManager

func (r *DockerHostReconciler) 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