common

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2018 License: Apache-2.0 Imports: 21 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package common defines the types and functions that are shared by multiple commands in the cmd package.

Index

Constants

View Source
const (
	// LeaseDuration is the default duration for the leader election lease.
	LeaseDuration = 90 * time.Second
	// RenewDeadline is the default duration for the leader renewal.
	RenewDeadline = 60 * time.Second
	// RetryPeriod is the default duration for the leader electrion retrial.
	RetryPeriod = 30 * time.Second
)

Variables

This section is empty.

Functions

func CreateResourceLock

func CreateResourceLock(cb *ClientBuilder, componentNamespace, componentName string) resourcelock.Interface

CreateResourceLock returns an interface for the resource lock.

Types

type ClientBuilder

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

ClientBuilder can create a variety of kubernetes client interface with its embeded rest.Config.

func NewClientBuilder

func NewClientBuilder(kubeconfig string) (*ClientBuilder, error)

NewClientBuilder returns a *ClientBuilder with the given kubeconfig.

func (*ClientBuilder) APIExtClientOrDie

func (cb *ClientBuilder) APIExtClientOrDie(name string) apiext.Interface

APIExtClientOrDie returns the kubernetes client interface for extended kubernetes objects.

func (*ClientBuilder) APIRegistrationClientOrDie

func (cb *ClientBuilder) APIRegistrationClientOrDie(name string) apiregistrationclientset.Interface

APIRegistrationClientOrDie returns the kubernetes client interface for machine config.

func (*ClientBuilder) ClusterAPIClientOrDie

func (cb *ClientBuilder) ClusterAPIClientOrDie(name string) clusterapiclientset.Interface

ClusterAPIClientOrDie returns the kubernetes client interface for machine config.

func (*ClientBuilder) ClusterversionClientOrDie

func (cb *ClientBuilder) ClusterversionClientOrDie(name string) cvoclientset.Interface

ClusterversionClientOrDie returns the kubernetes client interface for cluster version objects. TODO(yifan): Just return the client for the Operator Status objects.

func (*ClientBuilder) KubeClientOrDie

func (cb *ClientBuilder) KubeClientOrDie(name string) kubernetes.Interface

KubeClientOrDie returns the kubernetes client interface for general kubernetes objects.

type ControllerContext

type ControllerContext struct {
	ClientBuilder *ClientBuilder

	CAPINamespacedInformerFactory clusterapiinformers.SharedInformerFactory
	KubeInformerFactory           informers.SharedInformerFactory
	KubeNamespacedInformerFactory informers.SharedInformerFactory
	APIExtInformerFactory         apiextinformers.SharedInformerFactory

	AvailableResources map[schema.GroupVersionResource]bool

	Stop <-chan struct{}

	InformersStarted chan struct{}

	KubeInformersStarted chan struct{}

	ResyncPeriod func() time.Duration
}

ControllerContext stores all the informers for a variety of kubernetes objects.

func CreateControllerContext

func CreateControllerContext(cb *ClientBuilder, stop <-chan struct{}, targetNamespace string) *ControllerContext

CreateControllerContext creates the ControllerContext with the ClientBuilder.

Jump to

Keyboard shortcuts

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