pullsecrets

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SecretTypeBasicAuth      = "kubernetes.io/dockerconfigjson"
	SecretTypeECRCredentials = "banzaicloud.io/aws-ecr-login-config"

	SecretKeyDockerConfig = ".dockerconfigjson"

	ECRSecretRegion         = "region"
	ECRSecretAccountID      = "accountID"
	ECRSecretKeyAccessKeyID = "accessKeyID"
	ECRSecretSecretKey      = "secretKey"
)

nolint:gosec

Variables

This section is empty.

Functions

func NewBasicAuthSecret

func NewBasicAuthSecret(secretNamespace, secretName, registry, user, password string) (*corev1.Secret, error)

func NewECRLoginCredentialsSecret

func NewECRLoginCredentialsSecret(secretNamespace, secretName, accountID, region, awsAccessKeyID, awsSecretAccessKey string) *corev1.Secret

func SecretNameFromURL

func SecretNameFromURL(prefix, url string) string

Types

type Config

type Config struct {
	Registries map[string]LoginCredentialProvider
}

func NewConfig

func NewConfig() *Config

func NewConfigFromSecrets

func NewConfigFromSecrets(ctx context.Context, c client.Client, refs []types.NamespacedName) (*Config, error)

func (Config) AddECR

func (c Config) AddECR(accountID, region, accessKeyID, secretKey string)

func (*Config) AddECRFromSecret

func (c *Config) AddECRFromSecret(data map[string][]byte) error

func (*Config) AddRegistriesFromDockerConfig

func (c *Config) AddRegistriesFromDockerConfig(data []byte) error

func (*Config) AddRegistryWithUsernamePassword

func (c *Config) AddRegistryWithUsernamePassword(url, username, password string)

func (Config) ConfigString

func (c Config) ConfigString(ctx context.Context) ([]byte, *time.Time, error)

func (Config) Secret

func (c Config) Secret(ctx context.Context, secretNamespace, secretName string) (*corev1.Secret, *time.Time, error)

type DockerRegistryConfig

type DockerRegistryConfig struct {
	Auths map[string]LoginCredentials `json:"auths"`
}

DockerRegistryConfig represents a docker compliant image pull secret json file

func NewDockerRegistryConfig

func NewDockerRegistryConfig() DockerRegistryConfig

type ECRLoginCredentialsProvider

type ECRLoginCredentialsProvider struct {
	Credentials aws.Credentials
	Region      string
	AccountID   string
}

func NewECRLoginCredentialsProvider

func NewECRLoginCredentialsProvider(accountID, region, keyID, secretAccessKey string) ECRLoginCredentialsProvider

func (ECRLoginCredentialsProvider) GetURL

func (ECRLoginCredentialsProvider) LoginCredentials

type LoginCredentialProvider

type LoginCredentialProvider interface {
	LoginCredentials(context.Context) (*LoginCredentials, *time.Time, error)
	GetURL() string
}

type LoginCredentials

type LoginCredentials struct {
	Username string `json:"username"`
	Password string `json:"password"`
	Auth     string `json:"auth"` // base64 encoded username:password
}

type StaticLoginCredentialProvider

type StaticLoginCredentialProvider struct {
	Username string
	Password string
	URL      string
}

func NewStaticLoginCredentialProvider

func NewStaticLoginCredentialProvider(url, username, password string) StaticLoginCredentialProvider

func (StaticLoginCredentialProvider) GetURL

func (StaticLoginCredentialProvider) LoginCredentials

Jump to

Keyboard shortcuts

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