client

package
v0.14.6-beta0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: Apache-2.0 Imports: 39 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)

func GetPodResource added in v0.14.6

func GetPodResource(pod *corev1.Pod) *resources.Resource

Types

type KubeRuntimeClient

type KubeRuntimeClient struct {
	Client          kubernetes.Interface
	InformerFactory informers.SharedInformerFactory
	// 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) ClusterName added in v0.14.6

func (krc *KubeRuntimeClient) ClusterName() 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)

GetTaskLog using pageSize and pageNo to paging logs

func (*KubeRuntimeClient) GetTaskLogV2 added in v0.14.6

func (krc *KubeRuntimeClient) GetTaskLogV2(namespace, name string, logpage utils.LogPage) ([]pfschema.TaskLogInfo, error)

GetTaskLogV2 using lineLimit and sizeLimit to paging logs

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

type NodeHandler added in v0.14.6

type NodeHandler struct {
	// contains filtered or unexported fields
}

func NewNodeHandler added in v0.14.6

func NewNodeHandler(q workqueue.RateLimitingInterface, cluster string) *NodeHandler

func (*NodeHandler) AddNode added in v0.14.6

func (n *NodeHandler) AddNode(obj interface{})

func (*NodeHandler) DeleteNode added in v0.14.6

func (n *NodeHandler) DeleteNode(obj interface{})

func (*NodeHandler) UpdateNode added in v0.14.6

func (n *NodeHandler) UpdateNode(old, new interface{})

type NodeTaskHandler added in v0.14.6

type NodeTaskHandler struct {
	// contains filtered or unexported fields
}

func NewNodeTaskHandler added in v0.14.6

func NewNodeTaskHandler(q workqueue.RateLimitingInterface, cluster string) *NodeTaskHandler

func (*NodeTaskHandler) AddPod added in v0.14.6

func (n *NodeTaskHandler) AddPod(obj interface{})

func (*NodeTaskHandler) DeletePod added in v0.14.6

func (n *NodeTaskHandler) DeletePod(obj interface{})

func (*NodeTaskHandler) UpdatePod added in v0.14.6

func (n *NodeTaskHandler) UpdatePod(old, new interface{})

Jump to

Keyboard shortcuts

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