Documentation ¶
Index ¶
Constants ¶
View Source
const BareRegistry = "docker.io"
Variables ¶
This section is empty.
Functions ¶
func RegistryFromImageRef ¶
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) InjectDecoder ¶
func (p *PodContainerProxier) InjectDecoder(d *admission.Decoder) error
InjectDecoder injects the decoder.
Click to show internal directories.
Click to hide internal directories.