Documentation
¶
Index ¶
- Variables
- func LoadConfig(configFile io.Reader) (string, error)
- type AuthenticationInfoResolver
- type AuthenticationInfoResolverDelegator
- type AuthenticationInfoResolverWrapper
- type ClientManager
- func (cm *ClientManager) HookClient(h *v1beta1.Webhook) (*rest.RESTClient, error)
- func (cm *ClientManager) SetAuthenticationInfoResolver(resolver AuthenticationInfoResolver)
- func (cm *ClientManager) SetAuthenticationInfoResolverWrapper(wrapper AuthenticationInfoResolverWrapper)
- func (cm *ClientManager) SetServiceResolver(sr ServiceResolver)
- func (cm *ClientManager) Validate() error
- type ServiceResolver
Constants ¶
This section is empty.
Variables ¶
var (
ErrNeedServiceOrURL = errors.New("webhook configuration must have either service or URL")
)
Functions ¶
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 ¶
type AuthenticationInfoResolverDelegator struct { ClientConfigForFunc func(server string) (*rest.Config, error) ClientConfigForServiceFunc func(serviceName, serviceNamespace string) (*rest.Config, error) }
AuthenticationInfoResolverDelegator implements AuthenticationInfoResolver.
func (*AuthenticationInfoResolverDelegator) ClientConfigFor ¶
func (a *AuthenticationInfoResolverDelegator) ClientConfigFor(server string) (*rest.Config, error)
func (*AuthenticationInfoResolverDelegator) ClientConfigForService ¶
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 ¶
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. |