config

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2017 License: Apache-2.0, Apache-2.0 Imports: 22 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")
)

Functions

func LoadConfig

func LoadConfig(configFile io.Reader) (string, error)

LoadConfig extract the KubeConfigFile from configFile

Types

type AuthenticationInfoResolver

type AuthenticationInfoResolver interface {
	ClientConfigFor(server string) (*rest.Config, error)
}

AuthenticationInfoResolver builds rest.Config base on the server name.

func NewDefaultAuthenticationInfoResolver

func NewDefaultAuthenticationInfoResolver(kubeconfigFile string) (AuthenticationInfoResolver, error)

NewDefaultAuthenticationInfoResolver generates an AuthenticationInfoResolver that builds rest.Config based on the kubeconfig file. kubeconfigFile is the path to the kubeconfig.

type AuthenticationInfoResolverFunc

type AuthenticationInfoResolverFunc func(server string) (*rest.Config, error)

AuthenticationInfoResolverFunc implements AuthenticationInfoResolver.

func (AuthenticationInfoResolverFunc) ClientConfigFor

func (a AuthenticationInfoResolverFunc) ClientConfigFor(server string) (*rest.Config, error)

ClientConfigFor implements AuthenticationInfoResolver.

type AuthenticationInfoResolverWrapper

type AuthenticationInfoResolverWrapper func(AuthenticationInfoResolver) AuthenticationInfoResolver

AuthenticationInfoResolverWrapper can be used to inject Dial function to the rest.Config generated by the resolver.

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.

func NewClientManager

func NewClientManager() (ClientManager, error)

NewClientManager creates a ClientManager.

func (*ClientManager) HookClient

func (cm *ClientManager) HookClient(h *v1beta1.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 AuthenticationInfoResolver)

SetAuthenticationInfoResolver sets the AuthenticationInfoResolver.

func (*ClientManager) SetAuthenticationInfoResolverWrapper

func (cm *ClientManager) SetAuthenticationInfoResolverWrapper(wrapper 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 ServiceResolver)

SetServiceResolver sets the ServiceResolver.

func (*ClientManager) Validate

func (cm *ClientManager) Validate() error

Validate checks if ClientManager is properly set up.

type ServiceResolver

type ServiceResolver interface {
	ResolveEndpoint(namespace, name string) (*url.URL, error)
}

ServiceResolver knows how to convert a service reference into an actual location.

func NewDefaultServiceResolver

func NewDefaultServiceResolver() ServiceResolver

Directories

Path Synopsis
apis
webhookadmission/install
Package install installs the experimental API group, making it available as an option to all of the API encoding/decoding machinery.
Package install installs the experimental API group, making it available as an option to all of the API encoding/decoding machinery.
webhookadmission/v1alpha1
Package v1alpha1 is the v1alpha1 version of the API.
Package v1alpha1 is the v1alpha1 version of the API.

Jump to

Keyboard shortcuts

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