Documentation ¶
Index ¶
- Constants
- Variables
- func AddFlags(set *pflag.FlagSet)
- func AddTimeoutControllerClientFlags(set *pflag.FlagSet)
- func DefaultNewControllerClient(cache cache.Cache, config *rest.Config, options client.Options, ...) (c client.Client, err error)
- func WrapDefaultTimeoutClient(c client.Client) client.Client
- type DelegatingHandlerClient
- type TimeoutClient
- func (in *TimeoutClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error
- func (in *TimeoutClient) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error
- func (in *TimeoutClient) DeleteAllOf(ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption) error
- func (in *TimeoutClient) Get(ctx context.Context, key client.ObjectKey, obj client.Object, ...) error
- func (in *TimeoutClient) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error
- func (in *TimeoutClient) Patch(ctx context.Context, obj client.Object, patch client.Patch, ...) error
- func (in *TimeoutClient) Status() client.StatusWriter
- func (in *TimeoutClient) SubResource(subResource string) client.SubResourceClient
- func (in *TimeoutClient) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error
- type TimeoutOptions
- func (in *TimeoutOptions) WithLongRunningTimeout(ctx context.Context) (context.Context, context.CancelFunc)
- func (in *TimeoutOptions) WithMutatingTimeout(ctx context.Context) (context.Context, context.CancelFunc)
- func (in *TimeoutOptions) WithTimeout(ctx context.Context) (context.Context, context.CancelFunc)
- type TimeoutStatusWriter
- type TimeoutSubResourceClient
- func (in *TimeoutSubResourceClient) Create(ctx context.Context, obj client.Object, subResource client.Object, ...) error
- func (in *TimeoutSubResourceClient) Get(ctx context.Context, obj client.Object, subResource client.Object, ...) error
- func (in *TimeoutSubResourceClient) Patch(ctx context.Context, obj client.Object, patch client.Patch, ...) error
- func (in *TimeoutSubResourceClient) Update(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
Constants ¶
const ( // ControllerClientRequestLatencyKey metrics key for recording time cost // of controller client requests ControllerClientRequestLatencyKey = "controller_client_request_time_seconds" )
Variables ¶
var (
// CachedGVKs identifies the GVKs of resources to be cached during dispatching
CachedGVKs = ""
)
var DefaultTimeoutClientOptions = &TimeoutOptions{ RequestTimeout: 10 * time.Second, LongRunningRequestTimeout: 30 * time.Second, MutatingRequestTimeout: 15 * time.Second, }
DefaultTimeoutClientOptions options for default timeout
Functions ¶
func AddTimeoutControllerClientFlags ¶
AddTimeoutControllerClientFlags add flags for default timeout controller client
Types ¶
type DelegatingHandlerClient ¶
type DelegatingHandlerClient struct { client.Client Getter func(ctx context.Context, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error Lister func(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error }
DelegatingHandlerClient override the original client's function
func (DelegatingHandlerClient) Get ¶
func (c DelegatingHandlerClient) Get(ctx context.Context, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error
Get resource by overridden getter
func (DelegatingHandlerClient) List ¶
func (c DelegatingHandlerClient) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error
List resource by overridden lister
type TimeoutClient ¶
type TimeoutClient struct { client.Client TimeoutOptions }
TimeoutClient add timeout limit for requests
func (*TimeoutClient) Create ¶
func (in *TimeoutClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error
Create .
func (*TimeoutClient) Delete ¶
func (in *TimeoutClient) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error
Delete .
func (*TimeoutClient) DeleteAllOf ¶
func (in *TimeoutClient) DeleteAllOf(ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption) error
DeleteAllOf .
func (*TimeoutClient) Get ¶
func (in *TimeoutClient) Get(ctx context.Context, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error
Get .
func (*TimeoutClient) List ¶
func (in *TimeoutClient) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error
List .
func (*TimeoutClient) Patch ¶
func (in *TimeoutClient) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption) error
Patch .
func (*TimeoutClient) SubResource ¶ added in v1.9.0
func (in *TimeoutClient) SubResource(subResource string) client.SubResourceClient
SubResource .
func (*TimeoutClient) Update ¶
func (in *TimeoutClient) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error
Update .
type TimeoutOptions ¶
type TimeoutOptions struct { RequestTimeout time.Duration LongRunningRequestTimeout time.Duration MutatingRequestTimeout time.Duration }
TimeoutOptions timeout options for controller client
func (*TimeoutOptions) WithLongRunningTimeout ¶
func (in *TimeoutOptions) WithLongRunningTimeout(ctx context.Context) (context.Context, context.CancelFunc)
WithLongRunningTimeout return timout context if LongRunningRequestTimeout is greater than 0
func (*TimeoutOptions) WithMutatingTimeout ¶
func (in *TimeoutOptions) WithMutatingTimeout(ctx context.Context) (context.Context, context.CancelFunc)
WithMutatingTimeout return timout context if WithMutatingTimeout is greater than 0
func (*TimeoutOptions) WithTimeout ¶
func (in *TimeoutOptions) WithTimeout(ctx context.Context) (context.Context, context.CancelFunc)
WithTimeout return timeout context if RequestTimeout is greater than 0
type TimeoutStatusWriter ¶
type TimeoutStatusWriter struct { client.StatusWriter TimeoutOptions }
TimeoutStatusWriter add timeout limit for requests
func (*TimeoutStatusWriter) Patch ¶
func (in *TimeoutStatusWriter) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.SubResourcePatchOption) error
Patch .
func (*TimeoutStatusWriter) Update ¶
func (in *TimeoutStatusWriter) Update(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
Update .
type TimeoutSubResourceClient ¶ added in v1.9.0
type TimeoutSubResourceClient struct { client.SubResourceClient TimeoutOptions }
TimeoutSubResourceClient add timeout limit for requests
func (*TimeoutSubResourceClient) Create ¶ added in v1.9.0
func (in *TimeoutSubResourceClient) Create(ctx context.Context, obj client.Object, subResource client.Object, opts ...client.SubResourceCreateOption) error
Create .
func (*TimeoutSubResourceClient) Get ¶ added in v1.9.0
func (in *TimeoutSubResourceClient) Get(ctx context.Context, obj client.Object, subResource client.Object, opts ...client.SubResourceGetOption) error
Get .
func (*TimeoutSubResourceClient) Patch ¶ added in v1.9.0
func (in *TimeoutSubResourceClient) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.SubResourcePatchOption) error
Patch .
func (*TimeoutSubResourceClient) Update ¶ added in v1.9.0
func (in *TimeoutSubResourceClient) Update(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
Update .