config

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2018 License: Apache-2.0, Apache-2.0 Imports: 24 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 builds rest.Config based on the server.
	ClientConfigFor(server string) (*rest.Config, error)
	// ClientConfigForService builds rest.Config based on the serviceName and
	// serviceNamespace.
	ClientConfigForService(serviceName, serviceNamespace string) (*rest.Config, error)
}

AuthenticationInfoResolver builds rest.Config base on the server or service name and service namespace.

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 AuthenticationInfoResolverDelegator added in v1.9.3

type AuthenticationInfoResolverDelegator struct {
	ClientConfigForFunc        func(server string) (*rest.Config, error)
	ClientConfigForServiceFunc func(serviceName, serviceNamespace string) (*rest.Config, error)
}

AuthenticationInfoResolverDelegator implements AuthenticationInfoResolver.

func (*AuthenticationInfoResolverDelegator) ClientConfigFor added in v1.9.3

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

func (*AuthenticationInfoResolverDelegator) ClientConfigForService added in v1.9.3

func (a *AuthenticationInfoResolverDelegator) ClientConfigForService(serviceName, serviceNamespace string) (*rest.Config, error)

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) 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