imageregistry

package
v0.0.0-...-044af5d Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ClusterImageRegistriesAnnotation value is a json string of ImageRegistries
	ClusterImageRegistriesAnnotation = "open-cluster-management.io/image-registries"
)

Variables

This section is empty.

Functions

func OverrideImageByAnnotation

func OverrideImageByAnnotation(annotations map[string]string, imageName string) (string, error)

OverrideImageByAnnotation is to override the image by image-registries annotation of managedCluster. The source registry will be replaced by the Mirror. The larger index will work if the Sources are the same.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func (*Client) Cluster

func (c *Client) Cluster(clusterAnnotations map[string]string) Interface

func (*Client) ImageOverride

func (c *Client) ImageOverride(imageName string) (string, error)

ImageOverride is to override the image by image-registries annotation of managedCluster. The source registry will be replaced by the Mirror. The larger index will work if the Sources are the same.

func (*Client) PullSecret

func (c *Client) PullSecret() (*corev1.Secret, error)

type ImageRegistries

type ImageRegistries struct {
	PullSecret string     `json:"pullSecret"`
	Registries []Registry `json:"registries"`
}

ImageRegistries is value of the image registries annotation includes the mirror and source registries. The source registry will be replaced by the Mirror. The larger index will work if the Sources are the same.

type Interface

type Interface interface {
	Cluster(clusterAnnotations map[string]string) Interface
	PullSecret() (*corev1.Secret, error)
	ImageOverride(imageName string) (string, error)
}

func NewClient

func NewClient(kubeClient kubernetes.Interface) Interface

type Registry

type Registry struct {
	// Mirror is the mirrored registry of the Source. Will be ignored if Mirror is empty.
	Mirror string `json:"mirror"`

	// Source is the source registry. All image registries will be replaced by Mirror if Source is empty.
	Source string `json:"source"`
}

Jump to

Keyboard shortcuts

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