webhook

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const BareRegistry = "docker.io"

Variables

This section is empty.

Functions

func RegistryFromImageRef

func RegistryFromImageRef(imageReference string) (registry string, err error)

RegistryFromImageRef returns the registry (and port, if set) from the image reference, otherwise returns the default bare registry, "docker.io".

func ReplaceRegistryInImageRef

func ReplaceRegistryInImageRef(imageReference, replacementRegistry string) (imageRef string, err error)

ReplaceRegistryInImageRef returns the image reference with the registry replaced.

Types

type ContainerTransformer

type ContainerTransformer interface {
	// RewriteImage takes a docker image reference and returns the same image reference rewritten for a harbor
	// proxy cache project endpoint, if one is available, else returns the original image reference.
	RewriteImage(imageRef, platformArch, os string) (string, error)
}

ContainerTransformer rewrites docker image references for harbor proxy cache projects.

func NewMultiTransformer

func NewMultiTransformer(rules []config.ProxyRule) (ContainerTransformer, error)

type PodContainerProxier

type PodContainerProxier struct {
	Client      client.Client
	Decoder     *admission.Decoder
	Transformer ContainerTransformer
	Verbose     bool

	// kube config settings
	KubeClientBurst     int
	KubeClientQPS       float32
	KubeClientlazyRemap bool
}

PodContainerProxier mutates init containers and containers to redirect them to the harbor proxy cache if one exists.

func (*PodContainerProxier) Handle

Handle mutates init containers and containers.

func (*PodContainerProxier) InjectDecoder

func (p *PodContainerProxier) InjectDecoder(d *admission.Decoder) error

InjectDecoder injects the decoder.

Jump to

Keyboard shortcuts

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