client

package
v0.0.0-...-8a7802e Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 29 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrClientNotExist client not exist error
	ErrClientNotExist = "cluster [%s] not exist"
	// ErrClientNotConnected client disconnected
	ErrClientNotConnected = "cluster [%s] disconnected"
)

Functions

func BuildNormalClient

func BuildNormalClient(clsInfo api.ClusterCfgInfo, opts *Options) (api.MingleClient, error)

func DefaultClusterCfgInfo

func DefaultClusterCfgInfo(clusterName string) api.ClusterCfgInfo

DefaultClusterCfgInfo default clusterCfgInfo kubeconfig use default ~/.kube/config or Kubernetes cluster internal config

func NewFackeClient

func NewFackeClient(clusterCfg api.ClusterCfgInfo, opt *Options) (api.MingleClient, error)

func NewMingleClient

func NewMingleClient(clusterCfg api.ClusterCfgInfo, opt *Options) (api.MingleClient, error)

NewMingleClient build api.MingleClient

func NewProxyGatewayMingleClient

func NewProxyGatewayMingleClient(clusterCfg api.ClusterCfgInfo, scheme *runtime.Scheme) (api.MingleProxyClient, error)

Types

type BuildClientFunc

type BuildClientFunc func(api.ClusterCfgInfo, *Options) (api.MingleClient, error)

type CompletedConfig

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

func Complete

func Complete(mcc *MultiClientConfig) (*CompletedConfig, error)

func (*CompletedConfig) New

New build multiclient

type FakeClient

type FakeClient struct {
	rtclient.WithWatch

	StopCh chan struct{}

	*Options
	ClusterCfg api.ClusterCfgInfo

	AddResourceEventHandlerFunc func(obj rtclient.Object, handler cache.ResourceEventHandler) error
	CreateFunc                  func(obj rtclient.Object, opts ...rtclient.CreateOption) error
	DeleteFunc                  func(obj rtclient.Object, opts ...rtclient.DeleteOption) error
	DeleteAllOfFunc             func(obj rtclient.Object, opts ...rtclient.DeleteAllOfOption) error
	GetFunc                     func(key ktypes.NamespacedName, obj rtclient.Object) error
	GetInformerFunc             func(obj rtclient.Object) (rtcache.Informer, error)
	HasSyncedFunc               func() bool
	ListFunc                    func(obj rtclient.ObjectList, opts ...rtclient.ListOption) error
	PatchFunc                   func(obj rtclient.Object, patch rtclient.Patch, opts ...rtclient.PatchOption) error
	SetIndexFieldFunc           func(obj rtclient.Object, field string, extractValue rtclient.IndexerFunc) error
	StatusUpdateFunc            func(obj rtclient.Object, opts ...rtclient.SubResourceUpdateOption) error
	UpdateFunc                  func(obj rtclient.Object, opts ...rtclient.UpdateOption) error
	AnnotatedEventfFunc         func(object runtime.Object, annotations map[string]string, eventtype string, reason string, messageFmt string, args ...interface{})
	EventFunc                   func(object runtime.Object, eventtype string, reason string, message string)
	EventfFunc                  func(object runtime.Object, eventtype string, reason string, messageFmt string, args ...interface{})
	GetDynamicInterfaceFunc     func() dynamic.Interface
	GetKubeInterfaceFunc        func() kubernetes.Interface
	GetKubeRestConfigFunc       func() *rest.Config
	GetCtrlRtCacheFunc          func() rtcache.Cache
	GetCtrlRtClientFunc         func() rtclient.Client
	GetCtrlRtManagerFunc        func() rtmanager.Manager
	WatchFunc                   func(src rtclient.Object, queue api.WorkQueue, handler api.EventHandler, predicates ...api.Predicate) error
	GetClusterCfgInfoFunc       func() api.ClusterCfgInfo
	IsConnectedFunc             func() bool
}

func (*FakeClient) AddResourceEventHandler

func (f *FakeClient) AddResourceEventHandler(obj rtclient.Object, handler cache.ResourceEventHandler) error

AddResourceEventHandler implements api.MingleClient

func (*FakeClient) AnnotatedEventf

func (f *FakeClient) AnnotatedEventf(object runtime.Object, annotations map[string]string, eventtype string, reason string, messageFmt string, args ...interface{})

AnnotatedEventf implements api.MingleClient

func (*FakeClient) Create

func (f *FakeClient) Create(obj rtclient.Object, opts ...rtclient.CreateOption) error

Create implements api.MingleClient

func (*FakeClient) Delete

func (f *FakeClient) Delete(obj rtclient.Object, opts ...rtclient.DeleteOption) error

Delete implements api.MingleClient

func (*FakeClient) DeleteAllOf

func (f *FakeClient) DeleteAllOf(obj rtclient.Object, opts ...rtclient.DeleteAllOfOption) error

DeleteAllOf implements api.MingleClient

func (*FakeClient) Event

func (f *FakeClient) Event(object runtime.Object, eventtype string, reason string, message string)

Event implements api.MingleClient

func (*FakeClient) Eventf

func (f *FakeClient) Eventf(object runtime.Object, eventtype string, reason string, messageFmt string, args ...interface{})

Eventf implements api.MingleClient

func (*FakeClient) Get

Get implements api.MingleClient

func (*FakeClient) GetClusterCfgInfo

func (f *FakeClient) GetClusterCfgInfo() api.ClusterCfgInfo

GetClusterCfgInfo implements api.MingleClient

func (*FakeClient) GetCtrlRtCache

func (f *FakeClient) GetCtrlRtCache() rtcache.Cache

GetCtrlRtCache implements api.MingleClient

func (*FakeClient) GetCtrlRtClient

func (f *FakeClient) GetCtrlRtClient() rtclient.Client

GetCtrlRtClient implements api.MingleClient

func (*FakeClient) GetCtrlRtManager

func (f *FakeClient) GetCtrlRtManager() rtmanager.Manager

GetCtrlRtManager implements api.MingleClient

func (*FakeClient) GetDynamicInterface

func (f *FakeClient) GetDynamicInterface() dynamic.Interface

GetDynamicInterface implements api.MingleClient

func (*FakeClient) GetInformer

func (f *FakeClient) GetInformer(obj rtclient.Object) (rtcache.Informer, error)

GetInformer implements api.MingleClient

func (*FakeClient) GetKubeInterface

func (f *FakeClient) GetKubeInterface() kubernetes.Interface

GetKubeInterface implements api.MingleClient

func (*FakeClient) GetKubeRestConfig

func (f *FakeClient) GetKubeRestConfig() *rest.Config

GetKubeRestConfig implements api.MingleClient

func (*FakeClient) HasSynced

func (f *FakeClient) HasSynced() bool

HasSynced implements api.MingleClient

func (*FakeClient) IsConnected

func (f *FakeClient) IsConnected() bool

IsConnected implements api.MingleClient

func (*FakeClient) List

func (f *FakeClient) List(obj rtclient.ObjectList, opts ...rtclient.ListOption) error

List implements api.MingleClient

func (*FakeClient) Patch

func (f *FakeClient) Patch(obj rtclient.Object, patch rtclient.Patch, opts ...rtclient.PatchOption) error

Patch implements api.MingleClient

func (*FakeClient) SetIndexField

func (f *FakeClient) SetIndexField(obj rtclient.Object, field string, extractValue rtclient.IndexerFunc) error

SetIndexField implements api.MingleClient

func (*FakeClient) Start

func (f *FakeClient) Start(ctx context.Context) error

Start implements api.MingleClient

func (*FakeClient) StatusUpdate

func (f *FakeClient) StatusUpdate(obj rtclient.Object, opts ...rtclient.SubResourceUpdateOption) error

StatusUpdate implements api.MingleClient

func (*FakeClient) Stop

func (f *FakeClient) Stop()

Stop implements api.MingleClient

func (*FakeClient) Update

func (f *FakeClient) Update(obj rtclient.Object, opts ...rtclient.UpdateOption) error

Update implements api.MingleClient

func (*FakeClient) Watch

func (f *FakeClient) Watch(src rtclient.Object, queue api.WorkQueue, handler api.EventHandler, predicates ...api.Predicate) error

Watch implements api.MingleClient

type MultiClientConfig

type MultiClientConfig struct {
	*Options
	FetchInterval     time.Duration
	ClusterCfgManager api.ClusterConfigurationManager
	BuildClientFunc   BuildClientFunc
}

func NewMultiClientConfig

func NewMultiClientConfig() *MultiClientConfig

type Options

type Options struct {
	WebhookOptions

	Scheme                  *runtime.Scheme
	Logger                  logr.Logger
	LoggerDevMode           bool
	LeaderElection          bool
	LeaderElectionNamespace string
	LeaderElectionID        string
	SyncPeriod              time.Duration
	HealthCheckInterval     time.Duration
	ExecTimeout             time.Duration
	UserAgent               string
	QPS                     int
	Burst                   int
	SetKubeRestConfigFnList []api.SetKubeRestConfig
}

Options options

func DefaultOptions

func DefaultOptions() *Options

DefaultOptions use default config use default Kubernetes resource disable leader

func DefaultOptionsWithScheme

func DefaultOptionsWithScheme(scheme *runtime.Scheme) *Options

DefaultOptionsWithScheme use default config if scheme is empty use default Kubernetes resource disable leader

type WebhookOptions

type WebhookOptions struct {
	// Port is the port that the webhook server serves at.
	// It is used to set webhook.Server.Port if WebhookServer is not set.
	Port int
	// Host is the hostname that the webhook server binds to.
	// It is used to set webhook.Server.Host if WebhookServer is not set.
	Host string

	// CertDir is the directory that contains the server key and certificate.
	// If not set, webhook server would look up the server key and certificate in
	// {TempDir}/k8s-webhook-server/serving-certs. The server key and certificate
	// must be named tls.key and tls.crt, respectively.
	// It is used to set webhook.Server.CertDir if WebhookServer is not set.
	CertDir string

	// TLSOpts is used to allow configuring the TLS config used for the webhook server.
	TLSOpts []func(*tls.Config)
}

WebhookOptions webhook configuration for controller-manager

Jump to

Keyboard shortcuts

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