registry

package
v0.0.0-...-9b525ab Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 26 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"
	DefaultLocalDomain  = LocalServiceName + ".%s.svc.cluster.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 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
	corev1.Secret
}

func New

func New(server string, password string, username 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) 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) SetDefault

func (r *Registry) SetDefault(d bool)

Make registry default

func (*Registry) SetLocal

func (r *Registry) SetLocal(l bool)

Make local registry

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"`
}

type RegistryConfig

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

Jump to

Keyboard shortcuts

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