Documentation
¶
Index ¶
- Constants
- func EnsureCloudsConfigMapExists(ctx context.Context, instance client.Object, helper *helper.Helper, ...) (ctrl.Result, error)
- func GetCommonRbacRules(privileged bool) []rbacv1.PolicyRule
- func GetCustomDataConfigMapName(instance interface{}, workflowStepNum int) string
- func GetEnvVarsConfigMapName(instance interface{}, workflowStepNum int) string
- func GetStringHash(str string, hashLength int) string
- type AnsibleTestReconciler
- func (r *AnsibleTestReconciler) GetLogger(ctx context.Context) logr.Logger
- func (r *AnsibleTestReconciler) PrepareAnsibleEnv(instance *testv1beta1.AnsibleTest, step int) (map[string]env.Setter, map[string]string)
- func (r *AnsibleTestReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, _err error)
- func (r *AnsibleTestReconciler) SetupWithManager(mgr ctrl.Manager) error
- type HorizonTestReconciler
- func (r *HorizonTestReconciler) GetLogger(ctx context.Context) logr.Logger
- func (r *HorizonTestReconciler) PrepareHorizonTestEnvVars(instance *testv1beta1.HorizonTest) map[string]env.Setter
- func (r *HorizonTestReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, _err error)
- func (r *HorizonTestReconciler) SetupWithManager(mgr ctrl.Manager) error
- type NextAction
- type Reconciler
- func (r *Reconciler) AcquireLock(ctx context.Context, instance client.Object, h *helper.Helper, parallel bool) (bool, error)
- func (r *Reconciler) CheckSecretExists(ctx context.Context, instance client.Object, secretName string) bool
- func (r *Reconciler) EnsureLogsPVCExists(ctx context.Context, instance client.Object, helper *helper.Helper, ...) (ctrl.Result, error)
- func (r *Reconciler) GetClient() client.Client
- func (r *Reconciler) GetContainerImage(ctx context.Context, containerImage string, instance interface{}) (string, error)
- func (r *Reconciler) GetDefaultBool(variable bool) string
- func (r *Reconciler) GetDefaultInt(variable int64, defaultValue ...string) string
- func (r *Reconciler) GetJobName(instance interface{}, workflowStepNum int) string
- func (r *Reconciler) GetLastJob(ctx context.Context, instance client.Object) (*batchv1.Job, error)
- func (r *Reconciler) GetLockInfo(ctx context.Context, instance client.Object) (*corev1.ConfigMap, error)
- func (r *Reconciler) GetLogger() logr.Logger
- func (r *Reconciler) GetPVCLogsName(instance client.Object, workflowStepNum int) string
- func (r *Reconciler) GetScheme() *runtime.Scheme
- func (r *Reconciler) GetWorkflowConfigMapName(instance client.Object) string
- func (r *Reconciler) JobExists(ctx context.Context, instance client.Object, workflowStepNum int) bool
- func (r *Reconciler) NextAction(ctx context.Context, instance client.Object, workflowLength int) (NextAction, int, error)
- func (r *Reconciler) OverwriteAnsibleWithWorkflow(instance v1beta1.AnsibleTestSpec, sectionName string, workflowValueType string, ...) interface{}
- func (r *Reconciler) OverwriteValueWithWorkflow(instance v1beta1.TobikoSpec, sectionName string, workflowValueType string, ...) interface{}
- func (r *Reconciler) ReleaseLock(ctx context.Context, instance client.Object) (bool, error)
- type TempestReconciler
- type TobikoReconciler
- func (r *TobikoReconciler) GetLogger(ctx context.Context) logr.Logger
- func (r *TobikoReconciler) PrepareTobikoEnvVars(ctx context.Context, labels map[string]string, instance *testv1beta1.Tobiko, ...) map[string]env.Setter
- func (r *TobikoReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, _err error)
- func (r *TobikoReconciler) SetupWithManager(mgr ctrl.Manager) error
Constants ¶
const ( ErrNetworkAttachments = "not all pods have interfaces with ips as configured in NetworkAttachments: %s" ErrReceivedUnexpectedAction = "unexpected action received" ErrConfirmLockOwnership = "can not confirm ownership of %s lock" )
const ( InfoWaitingOnJob = "Waiting on either job to finish or release of the lock." InfoTestingCompleted = "Testing completed. All pods spawned by the test-operator finished." InfoCreatingFirstPod = "Creating first test pod (workflow step %d)." InfoCreatingNextPod = "Creating next test pod (workflow step %d)." InfoCanNotAcquireLock = "Can not acquire %s lock." InfoCanNotReleaseLock = "Can not release %s lock." )
const ( // Wait indicates that we should wait for the state of the OpenShift cluster // to change Wait = iota // CreateFirstJob indicates that the Reconcile loop should create the first job // either specified in the .Spec section or in the .Spec.Workflow section. CreateFirstJob // CreateNextJob indicates that the Reconcile loop should create a next job // specified in the .Spec.Workflow section (if .Spec.Workflow is defined) CreateNextJob // EndTesting indicates that all jobs have already finished. The Reconcile // loop should end the testing and release resources that are required to // be release (e.g., global lock) EndTesting // Failure indicates that an unexpected error was encountered Failure )
const ( // RequeueAfterValue tells how much time should we wait before calling Reconcile // loop again. RequeueAfterValue = time.Second * 60 )
Variables ¶
This section is empty.
Functions ¶
func EnsureCloudsConfigMapExists ¶
func EnsureCloudsConfigMapExists( ctx context.Context, instance client.Object, helper *helper.Helper, labels map[string]string, ) (ctrl.Result, error)
Some frameworks like (e.g., Tobiko and Horizon) require password value to be present in clouds.yaml. This code ensures that we set a default value of 12345678 when password value is missing in the clouds.yaml
func GetCommonRbacRules ¶
func GetCommonRbacRules(privileged bool) []rbacv1.PolicyRule
func GetEnvVarsConfigMapName ¶
func GetStringHash ¶
Types ¶
type AnsibleTestReconciler ¶
type AnsibleTestReconciler struct {
Reconciler
}
func (*AnsibleTestReconciler) GetLogger ¶
func (r *AnsibleTestReconciler) GetLogger(ctx context.Context) logr.Logger
GetLogger returns a logger object with a prefix of "controller.name" and additional controller context fields
func (*AnsibleTestReconciler) PrepareAnsibleEnv ¶
func (r *AnsibleTestReconciler) PrepareAnsibleEnv( instance *testv1beta1.AnsibleTest, step int, ) (map[string]env.Setter, map[string]string)
This function prepares env variables for a single workflow step.
func (*AnsibleTestReconciler) Reconcile ¶
func (r *AnsibleTestReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, _err error)
Reconcile - AnsibleTest
func (*AnsibleTestReconciler) SetupWithManager ¶
func (r *AnsibleTestReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type HorizonTestReconciler ¶
type HorizonTestReconciler struct {
Reconciler
}
HorizonTestReconciler reconciles a HorizonTest object
func (*HorizonTestReconciler) GetLogger ¶
func (r *HorizonTestReconciler) GetLogger(ctx context.Context) logr.Logger
GetLogger returns a logger object with a prefix of "controller.name" and additional controller context fields
func (*HorizonTestReconciler) PrepareHorizonTestEnvVars ¶
func (r *HorizonTestReconciler) PrepareHorizonTestEnvVars( instance *testv1beta1.HorizonTest, ) map[string]env.Setter
func (*HorizonTestReconciler) Reconcile ¶
func (r *HorizonTestReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, _err error)
Reconcile - HorizonTest
func (*HorizonTestReconciler) SetupWithManager ¶
func (r *HorizonTestReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type NextAction ¶
type NextAction int
NextAction holds an action that should be performed by the Reconcile loop.
type Reconciler ¶
type Reconciler struct { Client client.Client Kclient kubernetes.Interface Log logr.Logger Scheme *runtime.Scheme }
func (*Reconciler) AcquireLock ¶
func (*Reconciler) CheckSecretExists ¶
func (*Reconciler) EnsureLogsPVCExists ¶
func (*Reconciler) GetClient ¶
func (r *Reconciler) GetClient() client.Client
func (*Reconciler) GetContainerImage ¶
func (*Reconciler) GetDefaultBool ¶
func (r *Reconciler) GetDefaultBool(variable bool) string
func (*Reconciler) GetDefaultInt ¶
func (r *Reconciler) GetDefaultInt(variable int64, defaultValue ...string) string
func (*Reconciler) GetJobName ¶
func (r *Reconciler) GetJobName(instance interface{}, workflowStepNum int) string
func (*Reconciler) GetLastJob ¶
func (r *Reconciler) GetLastJob( ctx context.Context, instance client.Object, ) (*batchv1.Job, error)
GetLastJob returns job associated with an instance which has the highest value stored in the workflowStep label
func (*Reconciler) GetLockInfo ¶
func (*Reconciler) GetLogger ¶
func (r *Reconciler) GetLogger() logr.Logger
func (*Reconciler) GetPVCLogsName ¶
func (r *Reconciler) GetPVCLogsName(instance client.Object, workflowStepNum int) string
func (*Reconciler) GetScheme ¶
func (r *Reconciler) GetScheme() *runtime.Scheme
func (*Reconciler) GetWorkflowConfigMapName ¶
func (r *Reconciler) GetWorkflowConfigMapName(instance client.Object) string
func (*Reconciler) NextAction ¶
func (r *Reconciler) NextAction( ctx context.Context, instance client.Object, workflowLength int, ) (NextAction, int, error)
NextAction indicates what action needs to be performed by the Reconcile loop based on the current state of the OpenShift cluster.
func (*Reconciler) OverwriteAnsibleWithWorkflow ¶
func (r *Reconciler) OverwriteAnsibleWithWorkflow( instance v1beta1.AnsibleTestSpec, sectionName string, workflowValueType string, workflowStepNum int, ) interface{}
func (*Reconciler) OverwriteValueWithWorkflow ¶
func (r *Reconciler) OverwriteValueWithWorkflow( instance v1beta1.TobikoSpec, sectionName string, workflowValueType string, workflowStepNum int, ) interface{}
func (*Reconciler) ReleaseLock ¶
type TempestReconciler ¶
type TempestReconciler struct {
Reconciler
}
func (*TempestReconciler) GetLogger ¶
func (r *TempestReconciler) GetLogger(ctx context.Context) logr.Logger
GetLogger returns a logger object with a prefix of "controller.name" and additional controller context fields
func (*TempestReconciler) Reconcile ¶
func (r *TempestReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, _err error)
Reconcile - Tempest
func (*TempestReconciler) SetupWithManager ¶
func (r *TempestReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type TobikoReconciler ¶
type TobikoReconciler struct {
Reconciler
}
TobikoReconciler reconciles a Tobiko object
func (*TobikoReconciler) GetLogger ¶
func (r *TobikoReconciler) GetLogger(ctx context.Context) logr.Logger
GetLogger returns a logger object with a prefix of "controller.name" and additional controller context fields
func (*TobikoReconciler) PrepareTobikoEnvVars ¶
func (r *TobikoReconciler) PrepareTobikoEnvVars( ctx context.Context, labels map[string]string, instance *testv1beta1.Tobiko, helper *helper.Helper, step int, ) map[string]env.Setter
This function prepares env variables for a single workflow step.
func (*TobikoReconciler) Reconcile ¶
func (r *TobikoReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, _err error)
Reconcile - Tobiko
func (*TobikoReconciler) SetupWithManager ¶
func (r *TobikoReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.