amp_wh_example

package module
v0.0.0-...-82df033 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

README

Admission Mutation Proxy (txn2/amp) implementation example project.

Example Webhook implementation for the Admission Mutation Proxy (amp).

https://github.com/txn2/amp

Install

git clone git@github.com:txn2/amp-wh-example.git
cd amp-wh-example

# amp webhook handler
kubectl apply -f ./k8s/000-deployment-exampe-webhook.yml

# namespace with amp.txn2.com/enabled: "true"
kubectl apply -f ./k8s/100-namespace-amp-test.yml

# pod to be mutated
kubectl apply -f ./k8s/200-pod-mutate-test.yml

Development

Release
goreleaser --skip-publish --rm-dist --skip-validate
GITHUB_TOKEN=$GITHUB_TOKEN goreleaser --rm-dist

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

type Api struct {
	*Config
}

Api

func NewApi

func NewApi(cfg *Config) (*Api, error)

NewApi

func (*Api) MutatePod

func (a *Api) MutatePod(pod corev1.Pod) ([]PatchOperation, error)

MutatePod

func (*Api) MutatePodHandler

func (a *Api) MutatePodHandler() gin.HandlerFunc

MutatePodHandler

func (*Api) OkHandler

func (a *Api) OkHandler(version string, mode string, service string) gin.HandlerFunc

OkHandler

type Config

type Config struct {
	Log *zap.Logger
}

Config configures the API

type PatchOperation

type PatchOperation struct {
	Op    string      `json:"op"`
	Path  string      `json:"path"`
	Value interface{} `json:"value,omitempty"`
}

PatchOperation see: http://jsonpatch.com/

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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