common

package
v0.0.0-...-d0d6462 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	client.Client
	K8sSelfClient *k8s.Client
	Recorder      record.EventRecorder
}

Client is a manager client to get the common stuff for all the controllers

func (*Client) ClusterConfig

func (r *Client) ClusterConfig(ctx context.Context, cluster *managerv1alpha1.Cluster) (*rest.Config, error)

ClusterConfig function returns cluster rest config for the managed cluster

func (*Client) ManagedClusterK8sClient

func (r *Client) ManagedClusterK8sClient(ctx context.Context, cluster *managerv1alpha1.Cluster) (*k8s.Client, error)

ManagedClusterK8sClient returns the k8s client struct for the managed cluster

func (*Client) UpdateMeta

func (r *Client) UpdateMeta(ctx context.Context, object runtime.Object)

UpdateMeta function updates the metadata (mostly finalizers in this case) This function accepts runtime.Object which can be either cluster type or namespace type

func (*Client) UpdateStatus

func (r *Client) UpdateStatus(ctx context.Context, obj runtime.Object, state managerv1alpha1.State, requeueTime ...float64) (ctrl.Result, error)

UpdateStatus function updates the status based on the process step

type StatusUpdatePredicate

type StatusUpdatePredicate struct {
	predicate.Funcs
}

func (StatusUpdatePredicate) Update

Update implements default UpdateEvent filter for validating generation change

Jump to

Keyboard shortcuts

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