Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions api/v1beta1/tempest_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -522,3 +522,8 @@ func (instance Tempest) RbacNamespace() string {
func (instance Tempest) RbacResourceName() string {
return instance.Name
}

// GetConditions - return the conditions from the status
func (instance *Tempest) GetConditions() *condition.Conditions {
return &instance.Status.Conditions
}
2 changes: 1 addition & 1 deletion controllers/ansibletest_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func (r *AnsibleTestReconciler) Reconcile(ctx context.Context, req ctrl.Request)

// Create a new pod
mountCerts := r.CheckSecretExists(ctx, instance, "combined-ca-bundle")
podName := r.GetPodName(instance, nextWorkflowStep)
podName := GetPodName(instance, nextWorkflowStep)
envVars := r.PrepareAnsibleEnv(instance)
logsPVCName := r.GetPVCLogsName(instance, 0)
containerImage, err := r.GetContainerImage(ctx, instance)
Expand Down
5 changes: 2 additions & 3 deletions controllers/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ func (r *Reconciler) GetContainerImage(
// GetPodName returns the name of the pod for the given instance and workflow step
func (r *Reconciler) GetPodName(instance interface{}, stepNum int) string {
v := reflect.ValueOf(instance)

name := GetStringField(v, "Name")
spec, err := SafetyCheck(v, "Spec")
if err != nil {
Expand Down Expand Up @@ -415,7 +414,7 @@ func (r *Reconciler) GetScheme() *runtime.Scheme {
}

// GetDefaultInt returns the string representation of an integer value with optional default value
func (r *Reconciler) GetDefaultInt(variable int64, defaultValue ...string) string {
func GetDefaultInt(variable int64, defaultValue ...string) string {
if variable != 0 {
return strconv.FormatInt(variable, 10)
} else if len(defaultValue) > 0 {
Expand Down Expand Up @@ -520,7 +519,7 @@ func (r *Reconciler) ReleaseLock(ctx context.Context, instance client.Object) (b
// PodExists checks if a pod exists for the given instance and workflow step
func (r *Reconciler) PodExists(ctx context.Context, instance client.Object, workflowStepNum int) bool {
pod := &corev1.Pod{}
podName := r.GetPodName(instance, workflowStepNum)
podName := GetPodName(instance, workflowStepNum)
objectKey := client.ObjectKey{Namespace: instance.GetNamespace(), Name: podName}
err := r.Client.Get(ctx, objectKey, pod)
if err != nil && k8s_errors.IsNotFound(err) {
Expand Down
Loading