...

Package promote

import "edge-infra.dev/pkg/f8n/warehouse/promote"
Overview
Index

Overview ▾

Constants

const (
    InsertAction    = "INSERT"
    PromotionTrue   = "true"
    PromotionsTopic = "promotions"
)
const (
    PromoteTag = "promote"
    Latest     = "latest"
)
const (
    WarehouseRepo = "warehouse"
)

Variables

var Attributes = map[string]string{
    "promotion": "true",
}

func Promote

func Promote(ctx context.Context, cfg *Config, pl packagelock.PackageLock, ps types.PubSubService) ([]string, error)

func Run

func Run(ctx context.Context, log logr.Logger) error

type Config

type Config struct {
    LockFile    string
    AllPackages bool

    SourceRepo Repository

    DestinationRepo Repository

    ForwarderProjectID string
    // contains filtered or unexported fields
}

func (Config) Description

func (cfg Config) Description() string

func (Config) String

func (cfg Config) String() string

func (Config) Validate

func (cfg Config) Validate() error

type Repository

repository represents a GAR repository instance

type Repository struct {
    Name      string // name of the GAR repository instance, e.g. warehouse
    ProjectID string // project-id where GAR registry exists, e.g. ret-edge-stage1-foreman
    Registry  string // the OCI compliant registry, e.g. us-east1-docker.pkg.dev
    Ref       string // full GAR repository reference, e.g. us-east1-docker.pkg.dev/ret-edge-stage1-foreman/warehouse
}

func (Repository) EnsurePackageDigestExists

func (repo Repository) EnsurePackageDigestExists(pkgName string, digest string) error

Finds the hash for the latest version of the package in the repository

func (Repository) GetLatestPackageVersion

func (repo Repository) GetLatestPackageVersion(pkgName string) (string, error)

Finds the hash for the latest version of the package in the repository

func (Repository) ListPackages

func (repo Repository) ListPackages(ctx context.Context) (pkgNames []string, err error)

Lists the packages in the repository

func (Repository) NewPackageDigest

func (repo Repository) NewPackageDigest(pkgName, version string) (name.Digest, error)

Return the full reference for a given package and its tag

func (Repository) NewPackageTag

func (repo Repository) NewPackageTag(pkgName, tag string) (name.Tag, error)

Return the full reference for a given package and its tag

func (Repository) PackageDigestRef

func (repo Repository) PackageDigestRef(pkgName, version string) string

Return the full reference for a given package and its digest

func (Repository) PackageTagRef

func (repo Repository) PackageTagRef(pkgName, version string) string

Return the full reference for a given package and its tag

func (Repository) PackageTagRefs

func (repo Repository) PackageTagRefs(pkgName string, tags []string) []string

Return the full reference for a given package and its version ("latest" or hash)

func (Repository) String

func (repo Repository) String() string