You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: kubernetes.go
    path of file: ./repos/meshery/server/helpers
    
    the code of the file until where you have to start completion: package helpers

import (
	"context"
	"time"

	"github.com/layer5io/meshery/server/models"
	"github.com/sirupsen/logrus"
	me
    
func getK8SClientSet(kubeconfig []byte, contextName string) (*kubernetes.Clientset, error) {
	var clientConfig *rest.Config
	var err error
	if len(kubeconfig) == 0 {
		clientConfig, err = rest.InClusterConfig()
		if err != nil {
			return nil, ErrInClusterConfig(err)
		}
	} else {
		config, err := clientcmd.Load(kubeconfig)
		if err != nil {
			return nil, ErrInvalidK8SConfig(err)
		}
		if contextName != "" {
			config.CurrentContext = contextName
		}
		clientConfig, err = clientcmd.NewDefaultClientConfig(*config, &clientcmd.ConfigOverrides{}).ClientConfig()
		if err != nil {
			return nil, ErrClientConfig(err)
		}
	}
	clientConfig.Timeout = 2 * time.Minute
	clientset, err := kubernetes.NewForConfig(clientConfig)
	if err != nil {
		return nil, ErrClientSet(err)
	}
	return clientset, nil
}