pullsecrets

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 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

View Source
const (
	SourceSecretStatus = "Ok"
)

Variables

This section is empty.

Functions

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

func (*Config) ECRProviderFromSecret added in v0.3.1

func (c *Config) ECRProviderFromSecret(data map[string][]byte) LoginCredentialProvider

func (Config) ResultingDockerConfig added in v0.3.1

func (c Config) ResultingDockerConfig(ctx context.Context) (*ResultingDockerConfig, error)

func (*Config) StaticProviderFromDockerConfig added in v0.3.1

func (c *Config) StaticProviderFromDockerConfig(data []byte) LoginCredentialProvider

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 ErroredCredentialProvider added in v0.3.1

type ErroredCredentialProvider struct {
	Error error
}

ErroredCredentialProvider can be used to store a setup error into the config object

so that at least the providers that are working correctly gets reconciled.

func NewErroredCredentialProvider added in v0.3.1

func NewErroredCredentialProvider(err error) ErroredCredentialProvider

func (ErroredCredentialProvider) LoginCredentials added in v0.3.1

type ErrorsPerSecret added in v0.3.1

type ErrorsPerSecret map[string]error

func NewErrorsPerSecret added in v0.3.1

func NewErrorsPerSecret() ErrorsPerSecret

func (ErrorsPerSecret) AddSecret added in v0.3.1

func (e ErrorsPerSecret) AddSecret(name string)

func (*ErrorsPerSecret) AsError added in v0.3.1

func (e *ErrorsPerSecret) AsError() error

func (ErrorsPerSecret) AsStatus added in v0.3.1

func (e ErrorsPerSecret) AsStatus() map[string]string

func (ErrorsPerSecret) FailedSecrets added in v0.3.1

func (e ErrorsPerSecret) FailedSecrets() []string

func (ErrorsPerSecret) SetSecretError added in v0.3.1

func (e ErrorsPerSecret) SetSecretError(name string, err error)

type LoginCredentialProvider

type LoginCredentialProvider interface {
	LoginCredentials(context.Context) ([]LoginCredentialsWithDetails, error)
}

type LoginCredentials

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

type LoginCredentialsWithDetails added in v0.3.1

type LoginCredentialsWithDetails struct {
	LoginCredentials
	Expiration *time.Time
	URL        string
}

type ResultingDockerConfig added in v0.3.1

type ResultingDockerConfig struct {
	ErrorsPerSecret
	ConfigContents []byte
	Expiration     *time.Time
}

func (ResultingDockerConfig) AsSecret added in v0.3.1

func (c ResultingDockerConfig) AsSecret(secretNamespace, secretName string) *corev1.Secret

type StaticLoginCredentialProvider

type StaticLoginCredentialProvider struct {
	Credentials []LoginCredentialsWithDetails
}

func NewStaticLoginCredentialProvider

func NewStaticLoginCredentialProvider(parsedDockerConfig DockerRegistryConfig) StaticLoginCredentialProvider

func (StaticLoginCredentialProvider) LoginCredentials

Jump to

Keyboard shortcuts

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