client

package
v0.14.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2022 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// TaskGVK gvk for task
	TaskGVK = k8s.PodGVK
)

Functions

func CreateKubeRuntimeClient

func CreateKubeRuntimeClient(config *rest.Config, cluster *pfschema.Cluster) (framework.RuntimeClientInterface, error)

Types

type KubeRuntimeClient

type KubeRuntimeClient struct {
	Client kubernetes.Interface
	// DynamicClient dynamic client
	DynamicClient  dynamic.Interface
	DynamicFactory dynamicinformer.DynamicSharedInformerFactory
	// DiscoveryClient client for discovery
	DiscoveryClient discovery.DiscoveryInterface
	// TODO: adjust field Config
	Config      *rest.Config
	ClusterInfo *pfschema.Cluster
	// GVKToGVR contains GroupVersionKind map to GroupVersionResource
	GVKToGVR sync.Map

	// JobInformerMap contains GroupVersionKind and informer for different kubernetes job
	JobInformerMap map[schema.GroupVersionKind]cache.SharedIndexInformer

	// QueueInformerMap
	QueueInformerMap map[schema.GroupVersionKind]cache.SharedIndexInformer
	// contains filtered or unexported fields
}

KubeRuntimeClient for kubernetes client

func NewFakeKubeRuntimeClient

func NewFakeKubeRuntimeClient(server *httptest.Server) *KubeRuntimeClient

func (*KubeRuntimeClient) Cluster

func (krc *KubeRuntimeClient) Cluster() string

func (*KubeRuntimeClient) ClusterID

func (krc *KubeRuntimeClient) ClusterID() string

func (*KubeRuntimeClient) Create

func (krc *KubeRuntimeClient) Create(resource interface{}, fv pfschema.FrameworkVersion) error

func (*KubeRuntimeClient) Delete

func (krc *KubeRuntimeClient) Delete(namespace string, name string, fv pfschema.FrameworkVersion) error

func (*KubeRuntimeClient) Get

func (krc *KubeRuntimeClient) Get(namespace string, name string, fv pfschema.FrameworkVersion) (interface{}, error)

func (*KubeRuntimeClient) GetGVR

func (*KubeRuntimeClient) GetJobTypeFramework

func (*KubeRuntimeClient) GetTaskLog

func (krc *KubeRuntimeClient) GetTaskLog(namespace, name, logFilePosition string, pageSize, pageNo int) ([]pfschema.TaskLogInfo, error)

func (*KubeRuntimeClient) JobFrameworkVersion

func (krc *KubeRuntimeClient) JobFrameworkVersion(jobType pfschema.JobType, fw pfschema.Framework) pfschema.FrameworkVersion

func (*KubeRuntimeClient) ListNodeQuota

func (*KubeRuntimeClient) Patch

func (krc *KubeRuntimeClient) Patch(namespace, name string, fv pfschema.FrameworkVersion, data []byte) error

func (*KubeRuntimeClient) RegisterListener

func (krc *KubeRuntimeClient) RegisterListener(listenerType string, workQueue workqueue.RateLimitingInterface) error

func (*KubeRuntimeClient) StartListener

func (krc *KubeRuntimeClient) StartListener(listenerType string, stopCh <-chan struct{}) error

func (*KubeRuntimeClient) Update

func (krc *KubeRuntimeClient) Update(resource interface{}, fv pfschema.FrameworkVersion) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL