Documentation
¶
Overview ¶
Package reimage provides tools for processing/updating the images listed in k8s manifests
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ImageSetters ¶
type ImageSetters []Setter
ImageSetters is list of one of more Setters
func (ImageSetters) Set ¶
func (ss ImageSetters) Set(img string)
Set all the image setters in the list to the provided image
type ImagesFinder ¶
type ImagesFinder interface {
FindImages(obj *unstructured.Unstructured) (map[string]ImageSetters, error)
}
ImagesFinder specifies any mechanism for finding images within any k8s Unstructured data. Each entry in the map is an image name that was found. Calling the Set method on the map values will replace the discovered image name with a replacement.
func CompileJSONImageFinders ¶
func CompileJSONImageFinders(jmCfgs []JSONImageFinderConfig) (ImagesFinder, error)
CompileJSONImageFinders builds an ImagesFinder than can find image configuration strings from arbitrary unstructured K8S JSON objects, using JSONP queries
type JSONImageFinderConfig ¶
type JSONImageFinderConfig struct { Kind string `json:"kind" yaml:"kind"` // regexp to match k8s kind APIVersion string `json:"apiVersion" yaml:"apiVersion"` // regexp to match k8s apiVersion ImageJSONP []string `json:"imageJSONP" yaml:"imageJSONP"` // jsonP queries to find individual image fields }
JSONImageFinderConfig describes the settings for finding arbitrary image fields in K8S types
type MultiRemapper ¶
type MultiRemapper []Remapper
MultiRemapper applies each remapper, passing results from one to the next.
type RemapUpdater ¶
type RemapUpdater struct { Ignore *regexp.Regexp UnstructuredImagesFinder ImagesFinder Remapper Remapper }
RemapUpdater applies the Remapper to all images found in object passed to Update. For Objects of unknown types the UnstructuredImagesFinder is used. TODO(tcm): rename this thinger.
type RepoRemapper ¶
type RepoRemapper struct { RemotePath string // used for the .RemotePath value in the template RemoteTmpl *template.Template // template to build the final image string NoClobber bool // If true, we'll refuse to overwrite remote images }
RepoRemapper is a Remapper implementation that copies images to a remote registry/repository path. The new path is built using RemoteTmpl, and the copy is performed using crane.Copy.
type RepoTemplateInput ¶
type RepoTemplateInput struct { RemotePath string // The request remote repository and registry prefix Digest string // The digest of the image DigestAlgo string // The hash algorithm of the image digest DigestHex string // The hex string of the digest hash Tag string // The image tag (TODO(tcm): not used at the moment) Registry string // The image registry Repository string // The image repository }
RepoTemplateInput is the input provied to the RemoteTmpl of the RepoRemapper
type Setter ¶
type Setter func(img string)
A Setter is used for setting the string description of an image
type TagRemapper ¶
type TagRemapper struct {
CheckOnly bool // CheckOnly will ensure the remote image exists, but will leave it unchanged
}
TagRemapper looks up the remote image and translates it to the current digest form