func (k *Kubeclient) GetRaw(name string) ([]byte, error) {
	cli, err := k.getClientOrCached()
	if err != nil {
		return nil, err
	}
	d, err := k.get(cli, name, k.namespace, &metav1.GetOptions{})
	if err != nil {
		return nil, err
	}
	return json.Marshal(d)
}
GetRaw returns deployment object for given name
package deployment
import (
	"context"
	"encoding/json"
	"strings"
	"github.com/openebs/maya/pkg/debug"
	"github.com/openebs/dynamic-nfs-provisioner/pkg/kubernetes/client"
	"github.com/pkg/errors"
	appsv1 "k8s.io/api/apps/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	types "k8s.io/apimachinery/pkg/types"
	"k8s.io/client-go/kubernetes"
)
type getClientsetFn func() (*kubernetes.Clientset, error)
type getClientsetForPathFn func(path string) (*kubernetes.Clientset, error)
type getFn func(
	cli *kubernetes.Clientset,
	name string,
	namespace string,
	opts *metav1.GetOptions,
) (*appsv1.Deployment, error)
type listFn func(
	cli *kubernetes.Clientset,
	namespace string,
	opts *metav1.ListOptions,
) (*appsv1.DeploymentList, error)
type createFn func(
	cli *kubernetes.Clientset,
	namespace string,
	deploy *appsv1.Deployment,
	createOpts metav1.CreateOptions,
) (*appsv1.Deployment, error)
type updateFn func(
	cli *kubernetes.Clientset,
	namespace string,
	deploy *appsv1.Deployment,
	updateOpts metav1.UpdateOptions,
) (*appsv1.Deployment, error)
type deleteFn func(
	cli *kubernetes.Clientset,
	namespace string,
	name string,
	opts *metav1.DeleteOptions,
) error
type patchFn func(
	cli *kubernetes.Clientset,
	name, namespace string,
	pt types.PatchType,
	data []byte,
	opts metav1.PatchOptions,
	subresources ...string,
) (*appsv1.Deployment, error)
type rolloutStatusFn func(d *appsv1.Deployment) (*RolloutOutput, error)
type rolloutStatusfFn func(d *appsv1.Deployment) ([]byte, error)
func defaultGetClientset() (*kubernetes.Clientset, error) {
	return client.Instance().Clientset()
}
func defaultGetClientsetForPath(path string) (*kubernetes.Clientset, error) {
	return client.New(client.WithKubeConfigPath(path)).Clientset()
}
func defaultGet(
	cli *kubernetes.Clientset,
	name string,
	namespace string,
	opts *metav1.GetOptions,
) (*appsv1.Deployment, error) {
	return cli.AppsV1().Deployments(namespace).Get(context.TODO(), name, *opts)
}
func defaultList(
	cli *kubernetes.Clientset,
	namespace string,
	opts *metav1.ListOptions,
) (*appsv1.DeploymentList, error) {
	return cli.AppsV1().Deployments(namespace).List(context.TODO(), *opts)
}
func defaultCreate(
	cli *kubernetes.Clientset,
	namespace string,
	deploy *appsv1.Deployment,
	createOpts metav1.CreateOptions,
) (*appsv1.Deployment, error) {
	return cli.AppsV1().Deployments(namespace).Create(context.TODO(), deploy, createOpts)
}
func defaultUpdate(
	cli *kubernetes.Clientset,
	namespace string,
	deploy *appsv1.Deployment,
	updateOpts metav1.UpdateOptions,
) (*appsv1.Deployment, error) {
	return cli.AppsV1().Deployments(namespace).Update(context.TODO(), deploy, updateOpts)
}
func defaultDel(
	cli *kubernetes.Clientset,
	namespace string,
	name string,
	opts *metav1.DeleteOptions,
) error {
	return cli.AppsV1().Deployments(namespace).Delete(context.TODO(), name, *opts)
}
func defaultPatch(
	cli *kubernetes.Clientset,
	name, namespace string,
	pt types.PatchType,
	data []byte,
	patchOpts metav1.PatchOptions,
	subresources ...string,
) (*appsv1.Deployment, error) {
	return cli.AppsV1().Deployments(namespace).Patch(context.TODO(), name, pt, data, patchOpts, subresources...)
}
func defaultRolloutStatus(d *appsv1.Deployment) (*RolloutOutput, error) {
	b := NewForAPIObject(d)
	return b.RolloutStatus()
}
func defaultRolloutStatusf(d *appsv1.Deployment) ([]byte, error) {
	b := NewForAPIObject(d)
	return b.RolloutStatusRaw()
}
type Kubeclient struct {
	clientset *kubernetes.Clientset
	namespace string
	kubeConfigPath string
	getClientset        getClientsetFn
	getClientsetForPath getClientsetForPathFn
	get                 getFn
	list                listFn
	create              createFn
	update              updateFn
	del                 deleteFn
	patch               patchFn
	rolloutStatus       rolloutStatusFn
	rolloutStatusf      rolloutStatusfFn
}
type KubeclientBuildOption func(*Kubeclient)
func (k *Kubeclient) withDefaults() {
	if k.getClientset == nil {
		k.getClientset = defaultGetClientset
	}
	if k.getClientsetForPath == nil {
		k.getClientsetForPath = defaultGetClientsetForPath
	}
	if k.get == nil {
		k.get = defaultGet
	}
	if k.list == nil {
		k.list = defaultList
	}
	if k.create == nil {
		k.create = defaultCreate
	}
	if k.update == nil {
		k.update = defaultUpdate
	}
	if k.del == nil {
		k.del = defaultDel
	}
	if k.patch == nil {
		k.patch = defaultPatch
	}
	if k.rolloutStatus == nil {
		k.rolloutStatus = defaultRolloutStatus
	}
	if k.rolloutStatusf == nil {
		k.rolloutStatusf = defaultRolloutStatusf
	}
}
func WithClientset(c *kubernetes.Clientset) KubeclientBuildOption {
	return func(k *Kubeclient) {
		k.clientset = c
	}
}
func (k *Kubeclient) WithNamespace(namespace string) *Kubeclient {
	k.namespace = namespace
	return k
}
func WithKubeConfigPath(path string) KubeclientBuildOption {
	return func(k *Kubeclient) {
		k.kubeConfigPath = path
	}
}
func WithNamespace(namespace string) KubeclientBuildOption {
	return func(k *Kubeclient) {
		k.namespace = namespace
	}
}
func NewKubeClient(opts ...KubeclientBuildOption) *Kubeclient {
	k := &Kubeclient{}
	for _, o := range opts {
		o(k)
	}
	k.withDefaults()
	return k
}
func (k *Kubeclient) getClientsetForPathOrDirect() (*kubernetes.Clientset, error) {
	if k.kubeConfigPath != "" {
		return k.getClientsetForPath(k.kubeConfigPath)
	}
	return k.getClientset()
}
func (k *Kubeclient) getClientOrCached() (*kubernetes.Clientset, error) {
	if k.clientset != nil {
		return k.clientset, nil
	}
	c, err := k.getClientsetForPathOrDirect()
	if err != nil {
		return nil, err
	}
	k.clientset = c
	return k.clientset, nil
}
func (k *Kubeclient) Get(name string) (*appsv1.Deployment, error) {
	cli, err := k.getClientOrCached()
	if err != nil {
		return nil, err
	}
	return k.get(cli, name, k.namespace, &metav1.GetOptions{})
}
func (k *Kubeclient) List(opts *metav1.ListOptions) (*appsv1.DeploymentList, error) {
	cli, err := k.getClientOrCached()
	if err != nil {
		return nil, err
	}
	return k.list(cli, k.namespace, opts)
}
func (k *Kubeclient) Patch(
	name string,
	pt types.PatchType,
	data []byte,
	patchOpts metav1.PatchOptions,
	subresources ...string,
) (*appsv1.Deployment, error) {
	cli, err := k.getClientOrCached()
	if err != nil {
		return nil, err
	}
	return k.patch(cli, name, k.namespace, pt, data, patchOpts, subresources...)
}