func (i *ClowdJobInvocation) MakeOwnerReference() metav1.OwnerReference {
	return metav1.OwnerReference{
		APIVersion: i.APIVersion,
		Kind:       i.Kind,
		Name:       i.ObjectMeta.Name,
		UID:        i.ObjectMeta.UID,
		Controller: common.TruePtr(),
	}
}
MakeOwnerReference defines the owner reference pointing to the ClowdJobInvocation resource.
package v1alpha1
import (
	"fmt"
	"context"
	batchv1 "k8s.io/api/batch/v1"
	"github.com/RedHatInsights/clowder/apis/cloud.redhat.com/v1alpha1/common"
	"github.com/RedHatInsights/clowder/controllers/cloud.redhat.com/utils"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/types"
	"sigs.k8s.io/controller-runtime/pkg/client"
)
type JobConditionState string
const (
	JobInvoked  JobConditionState = "Invoked"
	JobComplete JobConditionState = "Complete"
	JobFailed   JobConditionState = "Failed"
)
type JobTestingSpec struct {
	Iqe IqeJobSpec `json:"iqe,omitempty"`
}
type IqeJobSpec struct {
	ImageTag string `json:"imageTag,omitempty"`
	UI UiSpec `json:"ui,omitempty"`
	Marker string `json:"marker,omitempty"`
	DynaconfEnvName string `json:"dynaconfEnvName"`
	Filter string `json:"filter,omitempty"`
	Debug bool `json:"debug,omitempty"`
	Requirements *[]string `json:"requirements,omitempty"`
	RequirementsPriority *[]string `json:"requirementsPriority,omitempty"`
	TestImportance *[]string `json:"testImportance,omitempty"`
}
type UiSpec struct {
	Enabled bool `json:"enabled"`
}
type ClowdJobInvocationSpec struct {
	AppName string `json:"appName"`
	Jobs []string `json:"jobs,omitempty"`
	Testing JobTestingSpec `json:"testing,omitempty"`
}
type ClowdJobInvocationStatus struct {
	Completed bool `json:"completed"`
	Jobs []string `json:"jobs,omitempty"`
	JobMap     map[string]JobConditionState `json:"jobMap"`
	Conditions []ClowdCondition             `json:"conditions,omitempty"`
}
type ClowdJobInvocation struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec   ClowdJobInvocationSpec   `json:"spec,omitempty"`
	Status ClowdJobInvocationStatus `json:"status,omitempty"`
}
type ClowdJobInvocationList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ClowdJobInvocation `json:"items"`
}
func init() {
	SchemeBuilder.Register(&ClowdJobInvocation{}, &ClowdJobInvocationList{})
}
func (i *ClowdJobInvocation) GetLabels() map[string]string {
	if i.Labels == nil {
		i.Labels = map[string]string{}
	}
	if _, ok := i.Labels["clowdjob"]; !ok {
		i.Labels["clowdjob"] = i.ObjectMeta.Name
	}
	newMap := make(map[string]string, len(i.Labels))
	for k, v := range i.Labels {
		newMap[k] = v
	}
	return newMap
}
func (i *ClowdJobInvocation) GetNamespacedName(pattern string) types.NamespacedName {
	return types.NamespacedName{
		Namespace: i.Namespace,
		Name:      fmt.Sprintf(pattern, i.Name),
	}
}