mx

package
v0.0.0-...-bc45f5a Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2018 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNeedServiceOrURL = errors.New("webhook configuration must have either service or URL")
)
View Source
var (

	// KeyFunc is the short name to DeletionHandlingMetaNamespaceKeyFunc.
	// IndexerInformer uses a delta queue, therefore for deletes we have to use this
	// key function but it should be just fine for non delete events.
	KeyFunc = cache.DeletionHandlingMetaNamespaceKeyFunc
)

Functions

func IsJobFailed

func IsJobFailed(status v1alpha1.MXJobStatus) bool

IsJobFailed checks whether MXJob is in Failed condition.

func IsJobFinished

func IsJobFinished(status v1alpha1.MXJobStatus) bool

IsJobFinished checks whether MXJob is in Succeed or Failed condition.

func IsJobSucceed

func IsJobSucceed(status v1alpha1.MXJobStatus) bool

IsJobSucceed checks whether MXJob is in Succeed condition.

func RecheckDeletionTimestamp

func RecheckDeletionTimestamp(getObject func() (metav1.Object, error)) func() error

RecheckDeletionTimestamp returns a CanAdopt() function to recheck deletion.

The CanAdopt() function calls getObject() to fetch the latest value, and denies adoption attempts if that object has a non-nil DeletionTimestamp.

Types

type ClientManager

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

ClientManager builds REST clients to talk to webhooks. It caches the clients to avoid duplicate creation. Originate from k8s.io/apiserver/pkg/admission/plugin/webhook/config.ClientManager

func NewClientManager

func NewClientManager() (ClientManager, error)

NewClientManager creates a ClientManager.

func (*ClientManager) HookClient

func (cm *ClientManager) HookClient(h *v1alpha1.Webhook) (*rest.RESTClient, error)

HookClient get a RESTClient from the cache, or constructs one based on the webhook configuration.

func (*ClientManager) SetAuthenticationInfoResolver

func (cm *ClientManager) SetAuthenticationInfoResolver(resolver webhook.AuthenticationInfoResolver)

SetAuthenticationInfoResolver sets the AuthenticationInfoResolver.

func (*ClientManager) SetAuthenticationInfoResolverWrapper

func (cm *ClientManager) SetAuthenticationInfoResolverWrapper(wrapper webhook.AuthenticationInfoResolverWrapper)

SetAuthenticationInfoResolverWrapper sets the AuthenticationInfoResolverWrapper.

func (*ClientManager) SetNegotiatedSerializer

func (cm *ClientManager) SetNegotiatedSerializer(n runtime.NegotiatedSerializer)

SetNegotiatedSerializer sets the NegotiatedSerializer.

func (*ClientManager) SetServiceResolver

func (cm *ClientManager) SetServiceResolver(sr webhook.ServiceResolver)

SetServiceResolver sets the ServiceResolver.

func (*ClientManager) Validate

func (cm *ClientManager) Validate() error

Validate checks if ClientManager is properly set up.

type Handler

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

Handler is a MXJob controller event processor.

func NewHandler

func NewHandler() (*Handler, error)

NewHandler creates a Handler.

func (*Handler) Sync

func (h *Handler) Sync(ctx context.Context, mxjob *v1alpha1.MXJob, deleted bool) error

Sync synchronizes mxjobs.

Jump to

Keyboard shortcuts

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