func GetCurrentUser(defaultUser int64) (int64, error) {
	currentUser, err := user.Current()
	if err != nil {
		return 0, err
	}
	intCurrentUser, err := strconv.ParseInt(currentUser.Uid, 0, 64)
	if err != nil {
		return 0, err
	}
	if intCurrentUser == 0 {
		return defaultUser, nil
	}
	return intCurrentUser, nil
}
GetCurrentUser checks which os use that is running the app
package util
import (
	"context"
	"io/ioutil"
	"os"
	"os/user"
	"strconv"
	"strings"
	log "github.com/sirupsen/logrus"
	apiv1 "k8s.io/api/core/v1"
	k8sErrors "k8s.io/apimachinery/pkg/api/errors"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/client-go/kubernetes"
)
const (
	podAPIVersion = "v1"
	podKind       = "Pod"
)
func GetOwnerRef(client *kubernetes.Clientset, namespace string) ([]metav1.OwnerReference, error) {
	ctx := context.TODO()
	podName, err := os.Hostname()
	if err != nil {
		return nil, err
	}
	podSpec, err := getKuberhealthyPod(ctx, client, namespace, strings.ToLower(podName))
	if err != nil {
		return nil, err
	}
	return []metav1.OwnerReference{
		{
			APIVersion: podAPIVersion,
			Kind:       podKind,
			Name:       podSpec.GetName(),
			UID:        podSpec.GetUID(),
		},
	}, nil
}
func getKuberhealthyPod(ctx context.Context, client *kubernetes.Clientset, namespace, podName string) (*apiv1.Pod, error) {
	podClient := client.CoreV1().Pods(namespace)
	kHealthyPod, err := podClient.Get(ctx, podName, metav1.GetOptions{})
	if err != nil {
		return nil, err
	}
	return kHealthyPod, nil
}