Documentation ¶
Index ¶
- Constants
- Variables
- func AddHostConnectionVars(crd *v1.DockerHost, varList *[]apiV1.EnvVar) *[]apiV1.EnvVar
- func CreateDockerAgentPod(env []apiV1.EnvVar, command string) apiV1.PodSpec
- func CreateDockerComposeRunnerJob(crd *v1.CrdDefinition, action string, configMapName string) (*v1batch.Job, error)
- func CreateDockerComposeRunnerPodSpec(name, action, configMapNMame string) (apiV1.PodSpec, error)
- func CreateDockerHostCronJob(crd *v1.DockerHost) (*v1batch.CronJob, error)
- func CreateDockerHostPodSpec(crd *v1.DockerHost) (apiV1.PodSpec, error)
- func CreateSSHDockerComposeRunnerConfigMap(crd *v1.DockerComposeRunner, sshUser string, hostIp string, ...) *apiV1.ConfigMap
- func CreateTLSDockerComposeRunnerConfigMap(crd *v1.DockerComposeRunner, configMapName string) *apiV1.ConfigMap
- func GenerateComposeRunnerConfigMapName(crdName string) string
- func GetLabels(crdConfig *v1.CrdDefinition) map[string]string
- func InstantiateMinimalDockerComposeRunnerJob(name string, namespace string) *v1batch.Job
- func InstantiateMinimalDockerHostCronJob(name string, namespace string) *v1batch.CronJob
- func RandStringRunes(n int) string
- func ValidateDockerHost(crd *v1.DockerHost) (*v1.DockerHost, error)
- type DockerComposeRunnerReconciler
- func (r *DockerComposeRunnerReconciler) CleanOldJob(definition *toolv1.CrdDefinition) error
- func (r *DockerComposeRunnerReconciler) CreateDockerComposeRunnerJob(desiredJob *v1batch.Job, instance *toolv1.DockerComposeRunner) error
- func (r *DockerComposeRunnerReconciler) CreateJob(definition *toolv1.CrdDefinition, action string, configMapName string) error
- func (r *DockerComposeRunnerReconciler) DefineConfigMapName(instance *toolv1.DockerComposeRunner, configMapName string, ...) error
- func (r *DockerComposeRunnerReconciler) DeleteDockerComposeRunnerJob(name string, namespace string) error
- func (r *DockerComposeRunnerReconciler) GetDockerComposeRunnerCurrentState(crdName string) (*v1batch.Job, error)
- func (r *DockerComposeRunnerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *DockerComposeRunnerReconciler) RunComposeDownJob(name string, namespace string) error
- func (r *DockerComposeRunnerReconciler) RunComposeUpJob(instance *toolv1.DockerComposeRunner) error
- func (r *DockerComposeRunnerReconciler) SetupWithManager(mgr ctrl.Manager) error
- type DockerHostReconciler
- func (r *DockerHostReconciler) CreateDockerHostCronJob(desiredJob *v1batch.CronJob, instance *toolv1.DockerHost) error
- func (r *DockerHostReconciler) DeleteDockerHostCronJob(name string, namespace string) error
- func (r *DockerHostReconciler) GetDockerHostCurrentState(crdName string) (*v1batch.CronJob, error)
- func (r *DockerHostReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *DockerHostReconciler) RemoveOldDockerHostCronJob(instance *toolv1.DockerHost) error
- func (r *DockerHostReconciler) SetupWithManager(mgr ctrl.Manager) error
Constants ¶
const ( EventCreate string = "Create" EventUpdate string = "Update" EventDelete string = "Delete" )
Variables ¶
var ImageJob = "6zar/docker-agent:latest"
var NamespaceJobs = "default"
!TODO: Set by LD Flags on Dockerfile
var ServiceAccountJob = "docker-agent-sa"
var NamespaceJobs = "operator-system"
Functions ¶
func AddHostConnectionVars ¶
func CreateDockerAgentPod ¶
func CreateDockerHostCronJob ¶
func CreateDockerHostCronJob(crd *v1.DockerHost) (*v1batch.CronJob, error)
func CreateDockerHostPodSpec ¶
func CreateDockerHostPodSpec(crd *v1.DockerHost) (apiV1.PodSpec, error)
func CreateTLSDockerComposeRunnerConfigMap ¶
func CreateTLSDockerComposeRunnerConfigMap(crd *v1.DockerComposeRunner, configMapName string) *apiV1.ConfigMap
func RandStringRunes ¶
func ValidateDockerHost ¶
func ValidateDockerHost(crd *v1.DockerHost) (*v1.DockerHost, error)
Types ¶
type DockerComposeRunnerReconciler ¶
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) 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 ¶
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.