registry

package
v0.0.0-...-fc6a387 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RegistryServerLabel = "overlock-registry-server-url"
	DefaultRemoteDomain = "xpkg.upbound.io"
	LocalServiceName    = "registry"
	LocalRegistryName   = "registry.local"

	AuthConfigLabel = "overlock-registry-auth-config"
)

Functions

func CopyRegistries

func CopyRegistries(ctx context.Context, logger *zap.SugaredLogger, sourceConfig *rest.Config, destinationConfig *rest.Config) error

Copy registries from source to destination contexts

func IsLocalRegistry

func IsLocalRegistry(ctx context.Context, client *kubernetes.Clientset) (bool, error)

func PredictRegistries

func PredictRegistries(ctx context.Context, client *kubernetes.Clientset) complete.Predictor

func PushLocalRegistry

func PushLocalRegistry(ctx context.Context, imageName string, image regv1.Image, config *rest.Config, logger *zap.SugaredLogger) error

Types

type Registry

type Registry struct {
	Config  RegistryConfig
	Default bool
	Local   bool
	Context string
	Server  string
	Name    string
	corev1.Secret
}

func New

func New(server string, username string, password string, email string) Registry

Creates new Registry by required parameters

func NewLocal

func NewLocal() Registry

Creates new local Registry

func Registries

func Registries(ctx context.Context, client *kubernetes.Clientset) ([]*Registry, error)

Return regestires from requested context

func (*Registry) Create

func (r *Registry) Create(ctx context.Context, config *rest.Config, logger *zap.SugaredLogger) error

Creates registry in requested context and assign it to engine

func (*Registry) CreateLocal

func (r *Registry) CreateLocal(ctx context.Context, client *kubernetes.Clientset, logger *zap.SugaredLogger) error

Create in cluster registry

func (*Registry) Delete

func (r *Registry) Delete(ctx context.Context, config *rest.Config, logger *zap.SugaredLogger) error

Delete registry

func (*Registry) DeleteLocal

func (r *Registry) DeleteLocal(ctx context.Context, client *kubernetes.Clientset, logger *zap.SugaredLogger) error

Delete in cluster registry

func (*Registry) Domain

func (r *Registry) Domain() string

Domain of primary registry

func (*Registry) Exists

func (r *Registry) Exists(ctx context.Context, client *kubernetes.Clientset) bool

Check if registry in provided context exists

func (*Registry) FromSecret

func (r *Registry) FromSecret(sec corev1.Secret) *Registry

func (*Registry) LocalDomain

func (r *Registry) LocalDomain() string

Local domain composed with parameters

func (*Registry) SecretSpec

func (r *Registry) SecretSpec() corev1.Secret

Creates specs of Secret base on Registry data

func (*Registry) SetDefault

func (r *Registry) SetDefault(d bool)

Make registry default

func (*Registry) SetLocal

func (r *Registry) SetLocal(l bool)

Make local registry

func (*Registry) SetRegistyDefault

func (r *Registry) SetRegistyDefault(ctx context.Context, config *rest.Config) error

func (*Registry) SetRegistyPullSecret

func (r *Registry) SetRegistyPullSecret(ctx context.Context, config *rest.Config) error

func (*Registry) ToSecret

func (r *Registry) ToSecret() *corev1.Secret

func (*Registry) Validate

func (r *Registry) Validate(ctx context.Context, client *kubernetes.Clientset, logger *zap.SugaredLogger) error

Validate data in Registry object

func (*Registry) WithContext

func (r *Registry) WithContext(c string)

Kubernetes context where registry will be created

type RegistryAuth

type RegistryAuth struct {
	Username string `json:"username" validate:"required"`
	Password string `json:"password" validate:"required"`
	Email    string `json:"email" validate:"required,email"`
	Server   string `json:"server" validate:"required,http_url"`
	Auth     string `json:"auth"`
}

type RegistryConfig

type RegistryConfig struct {
	Auths map[string]RegistryAuth `json:"auths"`
}

type RegistryReconciler

type RegistryReconciler struct {
	client.Client
	context.CancelFunc
}

Jump to

Keyboard shortcuts

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