internal

package
v0.0.0-...-2fcb30d Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(ctx context.Context, dstreference, srcreference string, dstauth, srcauth *types.DockerAuthConfig) error

Copy copies an image from one registry to another

func DoSync

func DoSync(cfg *SyncConfig) error

DoSync syncs the images from the source registry to the target registry

func Log

func Log() *zap.SugaredLogger

Types

type ACRWithTokenAuth

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

func NewACRWithTokenAuth

func NewACRWithTokenAuth(cfg *SyncConfig, acrName string, bearerToken string) *ACRWithTokenAuth

func (*ACRWithTokenAuth) GetTags

func (n *ACRWithTokenAuth) GetTags(ctx context.Context, image string) ([]string, error)

type AccessSecret

type AccessSecret struct {
	AccessToken string `json:"access_token"`
}

type AuthSecret

type AuthSecret struct {
	RefreshToken string `json:"refresh_token"`
}

type AuthedTransport

type AuthedTransport struct {
	Key     string
	Wrapped http.RoundTripper
}

AuthedTransport is a http.RoundTripper that adds an Authorization header

func (*AuthedTransport) RoundTrip

func (t *AuthedTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip implements http.RoundTripper and sets Authorization header

type AzureContainerRegistry

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

AzureContainerRegistry implements ACR Repository access

func NewAzureContainerRegistry

func NewAzureContainerRegistry(cfg *SyncConfig) *AzureContainerRegistry

NewAzureContainerRegistry creates a new AzureContainerRegistry access client

func (*AzureContainerRegistry) GetPullSecret

func (a *AzureContainerRegistry) GetPullSecret(ctx context.Context) (*AuthSecret, error)

func (*AzureContainerRegistry) GetTags

func (a *AzureContainerRegistry) GetTags(ctx context.Context, repository string) ([]string, error)

GetTags returns the tags in the given repository

func (*AzureContainerRegistry) RepositoryExists

func (a *AzureContainerRegistry) RepositoryExists(ctx context.Context, repository string) (bool, error)

EnsureRepositoryExists ensures that the repository exists

type AzureSecretFile

type AzureSecretFile struct {
	Username string
	Password string
}

AzureSecret is the token configured in the ACR

func (AzureSecretFile) BasicAuthEncoded

func (a AzureSecretFile) BasicAuthEncoded() string

type BearerSecret

type BearerSecret struct {
	BearerToken string
}

BearerSecret is the secret for the source OCI registry

type OCIRegistry

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

OCIRegistry implements OCI Repository access

func NewOCIRegistry

func NewOCIRegistry(cfg *SyncConfig, baseURL, bearerToken string) *OCIRegistry

NewOCIRegistry creates a new OCIRegistry access client

func (*OCIRegistry) GetTags

func (o *OCIRegistry) GetTags(ctx context.Context, image string) ([]string, error)

GetTags returns the tags in the given repository

type QuayRegistry

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

QuayRegistry implements Quay Repository access

func NewQuayRegistry

func NewQuayRegistry(cfg *SyncConfig, bearerToken string) *QuayRegistry

NewQuayRegistry creates a new QuayRegistry access client

func (*QuayRegistry) GetTags

func (q *QuayRegistry) GetTags(ctx context.Context, image string) ([]string, error)

GetTags returns the tags for the given image

type Registry

type Registry interface {
	GetTags(context.Context, string) ([]string, error)
}

Registry is the interface for accessing image repositories

type Secrets

type Secrets struct {
	Registry   string
	SecretFile string
}

type SyncConfig

type SyncConfig struct {
	Repositories            []string
	NumberOfTags            int
	Secrets                 []Secrets
	AcrTargetRegistry       string
	TenantId                string
	RequestTimeout          int
	AddLatest               bool
	ManagedIdentityClientID string
}

SyncConfig is the configuration for the image sync

type Tags

type Tags struct {
	Name string
}

type TagsResponse

type TagsResponse struct {
	Tags          []Tags
	Page          int
	HasAdditional bool `json:"has_additional"`
}

Jump to

Keyboard shortcuts

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