registrypush

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const TransferTokenHeader = "X-Registry-Push-Transfer-Token" // #nosec G101 -- HTTP header name, not credential material.

TransferTokenHeader is the HTTP header carrying one-time registry push tar tokens.

Variables

This section is empty.

Functions

func CopyReaderToTempFile

func CopyReaderToTempFile(r io.Reader) (string, error)

CopyReaderToTempFile writes r to a temporary docker archive file and returns its path.

func EnsureHelperNamespace

func EnsureHelperNamespace(ctx context.Context, client kubernetes.Interface, namespace string) error

EnsureHelperNamespace verifies the helper namespace exists.

func ParsePortOrDefault

func ParsePortOrDefault(value string, def int) int

ParsePortOrDefault parses a service port string or returns def.

func PushDockerArchive

func PushDockerArchive(ctx context.Context, client kubernetes.Interface, restConfig *rest.Config, tarPath, target string, cfg Config) (retErr error)

PushDockerArchive pushes a docker save tar to target using a short-lived skopeo helper pod inside the cluster.

func RewritePushTarget

func RewritePushTarget(target string, hosts Hosts) string

RewritePushTarget replaces the registry host in target when it matches a bundled internal registry hostname. Targets already using cluster DNS or external registries are returned unchanged.

Types

type Config

type Config struct {
	HelperNamespace string
	SkopeoImage     string
	HelperTimeout   time.Duration
	Hosts           Hosts
	// TarFetchURL, when set, skips exec-based tar copy and runs a one-shot helper
	// pod that downloads the archive from this URL before invoking skopeo.
	TarFetchURL string
	// TarFetchToken is sent as X-Registry-Push-Transfer-Token when fetching TarFetchURL.
	TarFetchToken string
}

Config controls in-cluster registry push helper behavior.

type Hosts

type Hosts struct {
	InternalHostnames []string
	ServiceName       string
	ServiceNamespace  string
	ServicePort       int
}

Hosts identifies bundled registry hostnames that should be rewritten to an in-cluster service DNS name for skopeo pushes from inside the cluster.

Jump to

Keyboard shortcuts

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