registry

package
v1.103.2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: Apache-2.0 Imports: 35 Imported by: 2

Documentation

Index

Constants

View Source
const DockerHubRegistryName = "index.docker.io"
View Source
const DockerHubSecretName = "kotsadm-dockerhub"

Variables

View Source
var ErrDockerHubCredentialsExist = errors.New("dockerhub credentials exists")

Functions

func CheckAccess

func CheckAccess(endpoint, username, password string) error

func EnsureDockerHubSecret

func EnsureDockerHubSecret(username string, password string, namespace string, clientset *kubernetes.Clientset) error

func GetCredentialsFromConfigJSON

func GetCredentialsFromConfigJSON(configJson []byte) (map[string]Credentials, error)

func GetDockerHubPullSecret

func GetDockerHubPullSecret(clientset kubernetes.Interface, namespace string, appNamespace string, namePrefix string) (*corev1.Secret, error)

func GetECRBasicAuthToken

func GetECRBasicAuthToken(ecrEndpoint, username, password string) (string, error)

func IsECREndpoint

func IsECREndpoint(endpoint string) bool

func LoadAuthForRegistry

func LoadAuthForRegistry(endpoint string) (string, string, error)

func MakeProxiedImageURL

func MakeProxiedImageURL(proxyHost string, appSlug string, image string) string

func PullSecretForDockerHub

func PullSecretForDockerHub(username string, password string, kuberneteNamespace string) (*corev1.Secret, error)

func SecretNameFromPrefix

func SecretNameFromPrefix(namePrefix string) string

Types

type Credentials

type Credentials struct {
	Username string
	Password string
}

func GetCredentialsForRegistryFromConfigJSON

func GetCredentialsForRegistryFromConfigJSON(configJson []byte, registry string) (Credentials, error)

func GetDockerHubCredentials

func GetDockerHubCredentials(clientset kubernetes.Interface, namespace string) (Credentials, error)

type DockerCfgJSON

type DockerCfgJSON struct {
	Auths map[string]DockercfgAuth `json:"auths"`
}

type DockercfgAuth

type DockercfgAuth struct {
	Auth string `json:"auth,omitempty"`
}

type ImagePullSecrets

type ImagePullSecrets struct {
	AdminConsoleSecret *corev1.Secret
	AppSecret          *corev1.Secret
	DockerHubSecret    *corev1.Secret
}

func PullSecretForRegistries

func PullSecretForRegistries(registries []string, username, password string, appNamespace string, namePrefix string) (ImagePullSecrets, error)

type Login

type Login struct {
	Username string
	Password string
}

func GetECRLogin

func GetECRLogin(ecrEndpoint, username, password string) (*Login, error)

type RegistryProxyInfo

type RegistryProxyInfo struct {
	Registry string
	Proxy    string
	Upstream string
}

func GetRegistryProxyInfo added in v1.91.2

func GetRegistryProxyInfo(license *kotsv1beta1.License, installation *kotsv1beta1.Installation, app *kotsv1beta1.Application) *RegistryProxyInfo

func (*RegistryProxyInfo) ToSlice

func (r *RegistryProxyInfo) ToSlice() []string

type TempRegistry added in v1.82.0

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

func (*TempRegistry) GetImageLayers added in v1.82.0

func (r *TempRegistry) GetImageLayers(image string) ([]types.Layer, error)

func (*TempRegistry) OverridePort added in v1.82.0

func (r *TempRegistry) OverridePort(port string)

This is only used for integration tests

func (*TempRegistry) SrcRef added in v1.82.0

func (*TempRegistry) Start added in v1.82.0

func (r *TempRegistry) Start(rootDir string) (finalError error)

Start will spin up a docker registry service in the background on a random port. Will use the given "rootDir" as storage. Caller is responsible for stopping the registry.

func (*TempRegistry) Stop added in v1.82.0

func (r *TempRegistry) Stop()

func (*TempRegistry) WaitForReady added in v1.82.0

func (r *TempRegistry) WaitForReady(timeout time.Duration) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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