Documentation
¶
Index ¶
- Constants
- func CopyReaderToTempFile(r io.Reader) (string, error)
- func EnsureHelperNamespace(ctx context.Context, client kubernetes.Interface, namespace string) error
- func ParsePortOrDefault(value string, def int) int
- func PushDockerArchive(ctx context.Context, client kubernetes.Interface, restConfig *rest.Config, ...) (retErr error)
- func RewritePushTarget(target string, hosts Hosts) string
- type Config
- type Hosts
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 ¶
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 ¶
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 ¶
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.
Click to show internal directories.
Click to hide internal directories.