webhook

package
v0.0.0-...-1a30d6a Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2019 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCABundle

func AddCABundle(p WebHookParameters) error

AddCABundle is used to add/update CABundle in MutatingWebhookConfiguration

Types

type Config

type Config struct {
	Containers      []corev1.Container            `yaml:"containers"`
	Volumes         []corev1.Volume               `yaml:"volumes"`
	ImagePullSecret []corev1.LocalObjectReference `yaml:"imagePullSecrets"`
}

Config has container, volume and image information

type WebHookParameters

type WebHookParameters struct {
	Port                int
	KubeConfig          string
	CertFile            string
	KeyFile             string
	CAFile              string
	WebhookConfigName   string
	WebhookName         string
	SidecarConfigFile   string
	HealthCheckInterval time.Duration
	HealthCheckFile     string
}

WebHookParameters contains Server parameters

type WebHookServer

type WebHookServer struct {
	SidecarConfig *Config
	Server        *http.Server
	Watch         *fsnotify.Watcher
	Lock          sync.RWMutex
}

WebHookServer which has config contents

func NewWebhook

func NewWebhook(p WebHookParameters) (*WebHookServer, error)

NewWebhook will load the configuration and create a server

func (*WebHookServer) Run

func (wh *WebHookServer) Run(stop <-chan struct{}, p WebHookParameters)

Run will run the server

Jump to

Keyboard shortcuts

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