func NewClient(cfg *rest.Config) (ClientInterface, error) {
	scheme := runtime.NewScheme()
	schemaBuilder := runtime.NewSchemeBuilder(addKnownTypes)
	if err := schemaBuilder.AddToScheme(scheme); err != nil {
		return nil, err
	}
	config := *cfg
	config.GroupVersion = &schemeGroupVersion
	config.APIPath = "/apis"
	config.ContentType = runtime.ContentTypeJSON
	config.NegotiatedSerializer = serializer.DirectCodecFactory{
		CodecFactory: serializer.NewCodecFactory(scheme)}
	client, err := rest.RESTClientFor(&config)
	if err != nil {
		return nil, err
	}
	return &clientImpl{restClient: client}, nil
}
NewClient creates a new real client for the SparkApplication CRD.
package crd
import (
	"github.com/liyinan926/spark-operator/pkg/apis/v1alpha1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/runtime/schema"
	"k8s.io/apimachinery/pkg/runtime/serializer"
	"k8s.io/client-go/rest"
)
type ClientInterface interface {
	RESTClient() rest.Interface
	Create(app *v1alpha1.SparkApplication) (*v1alpha1.SparkApplication, error)
	Delete(name string, namespace string) error
	Get(name string, namespace string) (*v1alpha1.SparkApplication, error)
	Update(app *v1alpha1.SparkApplication) (*v1alpha1.SparkApplication, error)
	UpdateStatus(app *v1alpha1.SparkApplication) (*v1alpha1.SparkApplication, error)
}
type clientImpl struct {
	restClient rest.Interface
}
var schemeGroupVersion = schema.GroupVersion{Group: Group, Version: Version}