registry

package
v0.12.6-hotfix Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2024 License: Apache-2.0 Imports: 18 Imported by: 5

Documentation

Index

Constants

View Source
const (
	REGISTRY_TYPE_ECR                     = "ecr"
	REGISTRYTYPE_GCR                      = "gcr"
	REGISTRYTYPE_ARTIFACT_REGISTRY        = "artifact-registry"
	JSON_KEY_USERNAME              string = "_json_key"
)
View Source
const (
	INSECURE_CONNECTION = "insecure"
	SECURE_WITH_CERT    = "secure-with-cert"
)
View Source
const (
	REGISTRY_CREDENTIAL_BASE_PATH = "/home/devtron/registry-credentials"
)

Variables

This section is empty.

Functions

func CertFromFilePair

func CertFromFilePair(certFile, keyFile string) (*tls.Certificate, error)

func CertPoolFromFile

func CertPoolFromFile(filename string) (*x509.CertPool, error)

func CreateCertificateFile

func CreateCertificateFile(registryName, caString string) (certificatePath string, err error)

func DeleteCertificateFolder

func DeleteCertificateFolder(filePath string) error

func GetHttpClient

func GetHttpClient(config *Configuration) (*http.Client, error)

func GetLoggedInClient

func GetLoggedInClient(client *registry.Client, config *Configuration) (*registry.Client, error)

func GetTlsConfig

func GetTlsConfig(config *Configuration) (*tls.Config, error)

func NewClientTLS

func NewClientTLS(certFile, keyFile, caFile string, insecureSkipTLSverify bool) (*tls.Config, error)

TODO: add support for certFile, keyFile on UI?

Types

type Configuration

type Configuration struct {
	RegistryId                string
	RegistryUrl               string
	Username                  string
	Password                  string
	AwsAccessKey              string
	AwsSecretKey              string
	AwsRegion                 string
	RegistryConnectionType    string //secure, insecure, secure-with-cert
	RegistryCertificateString string
	RegistryCAFilePath        string
	RegistryType              string
	IsPublicRegistry          bool
	RemoteConnectionConfig    *bean.RemoteConnectionConfigBean
}

type DefaultSettingsGetter

type DefaultSettingsGetter interface {
	SettingsGetter
}

type DefaultSettingsGetterImpl

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

func NewDefaultSettingsGetter

func NewDefaultSettingsGetter(logger *zap.SugaredLogger) *DefaultSettingsGetterImpl

func (*DefaultSettingsGetterImpl) GetRegistrySettings

func (s *DefaultSettingsGetterImpl) GetRegistrySettings(config *Configuration) (*Settings, error)

type RegistryConnectionType

type RegistryConnectionType string
const (
	REGISTRY_CONNECTION_TYPE_DIRECT RegistryConnectionType = "DIRECT"
	REGISTRY_CONNECTION_TYPE_PROXY  RegistryConnectionType = "PROXY"
	REGISTRY_CONNECTION_TYPE_SSH    RegistryConnectionType = "SSH"
)

type Settings

type Settings struct {
	RegistryClient         *registry.Client
	RegistryHostURL        string
	RegistryConnectionType RegistryConnectionType
	HttpClient             *http.Client
	Header                 http.Header
}

type SettingsFactory

type SettingsFactory interface {
	GetSettings(config *Configuration) (SettingsGetter, error)
}

type SettingsFactoryImpl

type SettingsFactoryImpl struct {
	DefaultSettings DefaultSettingsGetter
}

func NewSettingsFactoryImpl

func NewSettingsFactoryImpl(
	DefaultSettings DefaultSettingsGetter,
) *SettingsFactoryImpl

func (SettingsFactoryImpl) GetSettings

func (impl SettingsFactoryImpl) GetSettings(config *Configuration) (SettingsGetter, error)

type SettingsGetter

type SettingsGetter interface {
	GetRegistrySettings(config *Configuration) (*Settings, error)
}

Jump to

Keyboard shortcuts

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