Documentation
¶
Overview ¶
Package registrykit is what the image registry adapters share: reading a registry address, laying built images out in it, and deleting a deleted app's (R-224). Every registry Pando pushes to speaks the OCI distribution API; what differs between providers is how Pando signs in and whether a repository has to exist before a push, and each kind supplies those.
Index ¶
- func AlwaysField() api.Field
- func URLField(placeholder, help string) api.Field
- func Warnings(raw json.RawMessage) []string
- type AuthFunc
- type Layout
- type Registry
- func (r *Registry) DeleteApp(ctx context.Context, appID string, workloads []string) (int, error)
- func (r *Registry) Health(ctx context.Context) ([]string, error)
- func (r *Registry) HealthCheck(ctx context.Context) error
- func (r *Registry) Host() string
- func (r *Registry) ImageRegistryCapabilities() api.ImageRegistryCapabilities
- func (r *Registry) Owns(ref string) bool
- func (r *Registry) PullAuth(ctx context.Context) (*api.RegistryAuth, error)
- func (r *Registry) Repository(appID, workload, deploymentID string) (repository, tag string)
- func (r *Registry) Target(ctx context.Context, appID, workload, deploymentID string) (api.PushTarget, error)
- type Settings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Warnings ¶ added in v0.10.0
func Warnings(raw json.RawMessage) []string
Warnings says what in an OCI registry's settings is accepted but will not do what the operator likely expects. Shown when the settings are saved; nothing here refuses them, Open does that.
Types ¶
type Layout ¶
type Layout string
Layout is how built images are arranged in the registry.
const ( // LayoutPerApp is <prefix>/apps/<app>[/<workload>], tagged with the // deployment: one repository per workload, and per app, so a deleted app's // images are a few listings to delete. The default where the registry // creates repositories on push. LayoutPerApp Layout = "per_app" // LayoutSingle puts every image in <prefix>, tagged // <app>-<workload>-<deployment>, for a registry where a repository must // exist before a push (ECR). LayoutSingle Layout = "single" )
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is a configured registry. Each kind embeds one and adds Kind, Configure and Info.
func Open ¶
Open reads the shared settings. createsOnPush is the provider's answer to whether a push creates its repository; where it does not, the layout is single and a per_app one is refused here rather than at the first push.
func (*Registry) DeleteApp ¶
DeleteApp deletes every manifest of a deleted app's builds through the registry API (R-224).
func (*Registry) Health ¶ added in v0.10.0
Health is HealthCheck with what works but will not do what the operator expects: a credential that may push and pull but not delete, so a deleted app's images stay in the registry (R-224). Notes never fail the check; pushing and pulling, which deploys need, still work.
func (*Registry) HealthCheck ¶
HealthCheck signs in to the registry's API, so a registry Pando cannot reach or whose credential it refuses is reported on the adapters screen rather than by the first deploy that needs it. A missing delete permission is not a failure here; Health reports it as a note.
func (*Registry) ImageRegistryCapabilities ¶
func (r *Registry) ImageRegistryCapabilities() api.ImageRegistryCapabilities
Capabilities is the shared half of the kind's capabilities.
func (*Registry) Owns ¶
Owns reports whether an image reference is in this registry, under Pando's prefix: a built image Pando pushed.
func (*Registry) PullAuth ¶
PullAuth is the credential for one push or pull, minted fresh by the kind where its provider issues short-lived passwords. Nil for anonymous.
func (*Registry) Repository ¶
Repository is where an app's workload's builds go, and the tag a deployment is pushed under. An empty workload is the app-wide image.
type Settings ¶
type Settings struct {
// URL is the registry and an optional path prefix:
// https://registry.internal:5000, or
// 123456789012.dkr.ecr.us-east-1.amazonaws.com/pando.
URL string `json:"url"`
// Layout is per_app or single. Empty is the kind's default.
Layout string `json:"layout"`
// Insecure permits plain HTTP. Off unless the operator sets it (O-35).
Insecure bool `json:"insecure"`
// Always sends builds through the registry even when the runtime can
// take them directly. Off by default: single-host Docker imports (O-34).
Always bool `json:"always"`
// PackagesAPI is the GitHub REST API a deleted app's images are deleted
// through, for a registry that is GitHub Container Registry. Set for
// ghcr.io when empty; a test sets it to treat its own registry as GHCR.
PackagesAPI string `json:"-"`
// DeleteRemedy is what a provider's credential needs to delete images,
// said when the health check finds it cannot. Empty gives the advice for
// a registry Pando runs or one with delete permissions to grant.
DeleteRemedy string `json:"-"`
}
Settings are the settings every kind shares, as stored in adapter_configs.config.