...

Package provider

import "github.com/chaos-mesh/chaos-mesh/cmd/chaos-controller-manager/provider"
Overview
Index

Overview ▾

Package provider provides several required components for bootstrapping chaos-controller-manager.

Index ▾

Variables
func NewAuthCli(cfg *rest.Config) (*authorizationv1.AuthorizationV1Client, error)
func NewClient(mgr ctrl.Manager, scheme *runtime.Scheme) (client.Client, error)
func NewClientSet(config *rest.Config) (*kubernetes.Clientset, error)
func NewConfig() *rest.Config
func NewControlPlaneCacheReader(logger logr.Logger, cfg *rest.Config) (controlPlaneCacheReader, error)
func NewManager(options *ctrl.Options, cfg *rest.Config) (ctrl.Manager, error)
func NewNoCacheReader(mgr ctrl.Manager) noCacheReader
func NewOption(logger logr.Logger, scheme *runtime.Scheme) *ctrl.Options
func NewScheme() *runtime.Scheme
type UpdatedClient
    func (c *UpdatedClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error
    func (c *UpdatedClient) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error
    func (c *UpdatedClient) DeleteAllOf(ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption) error
    func (c *UpdatedClient) Get(ctx context.Context, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error
    func (c *UpdatedClient) GroupVersionKindFor(obj runtime.Object) (schema.GroupVersionKind, error)
    func (c *UpdatedClient) IsObjectNamespaced(obj runtime.Object) (bool, error)
    func (c *UpdatedClient) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error
    func (c *UpdatedClient) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption) error
    func (c *UpdatedClient) RESTMapper() meta.RESTMapper
    func (c *UpdatedClient) Scheme() *runtime.Scheme
    func (c *UpdatedClient) Status() client.StatusWriter
    func (c *UpdatedClient) SubResource(subResource string) client.SubResourceClient
    func (c *UpdatedClient) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error
type UpdatedStatusWriter
    func (c *UpdatedStatusWriter) Create(ctx context.Context, obj client.Object, subResource client.Object, opts ...client.SubResourceCreateOption) error
    func (c *UpdatedStatusWriter) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.SubResourcePatchOption) error
    func (c *UpdatedStatusWriter) Update(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error

Package files

controller.go doc.go updated_client.go

Variables

Module would provide objects to fx for dependency injection.

var Module = fx.Provide(
    NewOption,
    NewClient,
    NewClientSet,
    NewManager,
    NewAuthCli,
    NewScheme,
    NewConfig,
    NewNoCacheReader,
    NewControlPlaneCacheReader,
)

func NewAuthCli

func NewAuthCli(cfg *rest.Config) (*authorizationv1.AuthorizationV1Client, error)

NewAuthCli would build the authorizationv1.AuthorizationV1Client with given parameters.

func NewClient

func NewClient(mgr ctrl.Manager, scheme *runtime.Scheme) (client.Client, error)

NewClient would build the controller-runtime client.Client with given parameters.

func NewClientSet

func NewClientSet(config *rest.Config) (*kubernetes.Clientset, error)

func NewConfig

func NewConfig() *rest.Config

NewConfig would fetch the rest.Config from environment. When it failed to fetch config, it would exit the whole application.

func NewControlPlaneCacheReader

func NewControlPlaneCacheReader(logger logr.Logger, cfg *rest.Config) (controlPlaneCacheReader, error)

NewControlPlaneCacheReader builds a client.Reader with cache for certain usage for control plane

func NewManager

func NewManager(options *ctrl.Options, cfg *rest.Config) (ctrl.Manager, error)

NewManager would build the controller-runtime manager with the given parameters.

func NewNoCacheReader

func NewNoCacheReader(mgr ctrl.Manager) noCacheReader

NewNoCacheReader builds a client.Reader with no cache. TODO: we could return with fx.Annotate instead of struct noCacheReader and magic name "no-cache"

func NewOption

func NewOption(logger logr.Logger, scheme *runtime.Scheme) *ctrl.Options

NewOption returns the manager.Options for build the controller-runtime Manager

func NewScheme

func NewScheme() *runtime.Scheme

NewScheme returns the runtime.Scheme used by controller-runtime

type UpdatedClient

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

func (*UpdatedClient) Create

func (c *UpdatedClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error

func (*UpdatedClient) Delete

func (c *UpdatedClient) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error

func (*UpdatedClient) DeleteAllOf

func (c *UpdatedClient) DeleteAllOf(ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption) error

func (*UpdatedClient) Get

func (c *UpdatedClient) Get(ctx context.Context, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error

func (*UpdatedClient) GroupVersionKindFor

func (c *UpdatedClient) GroupVersionKindFor(obj runtime.Object) (schema.GroupVersionKind, error)

func (*UpdatedClient) IsObjectNamespaced

func (c *UpdatedClient) IsObjectNamespaced(obj runtime.Object) (bool, error)

func (*UpdatedClient) List

func (c *UpdatedClient) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error

func (*UpdatedClient) Patch

func (c *UpdatedClient) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption) error

func (*UpdatedClient) RESTMapper

func (c *UpdatedClient) RESTMapper() meta.RESTMapper

func (*UpdatedClient) Scheme

func (c *UpdatedClient) Scheme() *runtime.Scheme

func (*UpdatedClient) Status

func (c *UpdatedClient) Status() client.StatusWriter

func (*UpdatedClient) SubResource

func (c *UpdatedClient) SubResource(subResource string) client.SubResourceClient

func (*UpdatedClient) Update

func (c *UpdatedClient) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error

type UpdatedStatusWriter

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

func (*UpdatedStatusWriter) Create

func (c *UpdatedStatusWriter) Create(ctx context.Context, obj client.Object, subResource client.Object, opts ...client.SubResourceCreateOption) error

func (*UpdatedStatusWriter) Patch

func (c *UpdatedStatusWriter) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.SubResourcePatchOption) error

func (*UpdatedStatusWriter) Update

func (c *UpdatedStatusWriter) Update(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error