image_prefix

package
v0.0.0-...-b53bbfd Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

README

Change image prefix

This is transform used to change the prefix of images. It works by adding an annotation which is a map of prefixes: e.g.

annotations:
  "image-prefix.kubeflow.org": '{"docker.io": "gcr.io/myproject"}'

The transform will then look for all images in that resource with prefix docker.io and change it to gcr.io/myproject.

In practice you will typically add the annotation using kustomize's commonAnnotations transform.

Documentation

Overview

Package image_prefix implements a kustomize function for changing image prefixes

Index

Constants

View Source
const (
	Kind       = "ImagePrefix"
	APIVersion = "kubeflow.org/v1alpha1"
)

Variables

This section is empty.

Functions

func Filter

func Filter() kio.Filter

Filter returns a new ImagePrefixFunction

Types

type ImageMapping

type ImageMapping struct {
	Src  string `yaml: src`
	Dest string `yaml: dest`
}

type ImagePrefixFunction

type ImagePrefixFunction struct {
	// Kind is the API name.  Must be ImagePrefix.
	Kind string `yaml:"kind"`

	// APIVersion is the API version.  Must be examples.kpt.dev/v1alpha1
	APIVersion string `yaml:"apiVersion"`

	// Metadata defines instance metadata.
	Metadata Metadata `yaml:"metadata"`

	// Spec defines the desired declarative configuration.
	Spec Spec `yaml:"spec"`
}

ImagePrefixFunction implements the ImagePrefix Function

func (*ImagePrefixFunction) Filter

func (f *ImagePrefixFunction) Filter(inputs []*yaml.RNode) ([]*yaml.RNode, error)

Filter looks for images with the specified prefixes and replaces them.

type Metadata

type Metadata struct {
	// Name is the name of the ImagePrefix Resources
	Name string `yaml:"name"`

	// Namespace is the namespace of the ImagePrefix Resources
	Namespace string `yaml:"namespace"`

	// Labels are labels applied to the ImagePrefix Resources
	Labels map[string]string `yaml:"labels"`

	// Annotations are annotations applied to the ImagePrefix Resources
	Annotations map[string]string `yaml:"annotations"`
}

type Spec

type Spec struct {
	ImageMappings []*ImageMapping `yaml:"imageMappings"`
}

Jump to

Keyboard shortcuts

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