Documentation
¶
Overview ¶
Package imageregistry is the install's image registry: where a build is pushed when the runtime pulls rather than imports (issue #72, PR 5, docs/design/notes-image-registry-issue-72.md).
The registry is an adapter (R-252, issue #153; adapter/api/imageregistry.go) and this package is how core uses it. Like source connections, a stored registry adapter is built from its row each time it is used, never cached: a password rotated on one replica is what every replica pushes with next, with no restart and nothing to watch. One declared in the startup configuration — the config file, or PANDO_REGISTRY_* — is built once at startup and is read-only (R-271).
Index ¶
- type ConfigStore
- type CredentialStore
- type Declared
- type Provider
- type Registry
- func (r *Registry) Always() bool
- func (r *Registry) Auth(ctx context.Context) (*api.RegistryAuth, error)
- func (r *Registry) Configured() bool
- func (r *Registry) DeleteApp(ctx context.Context, appID string, workloads []string) (int, error)
- func (r *Registry) Host() string
- func (r *Registry) ID() string
- func (r *Registry) Owns(ref string) bool
- func (r *Registry) Target(ctx context.Context, appID, workload, deploymentID string) (*api.PushTarget, error)
- type Service
- func (s *Service) Adapter(ctx context.Context, id string) (api.ImageRegistryAdapter, error)
- func (s *Service) Current(ctx context.Context) (*Registry, error)
- func (s *Service) CurrentRegistry(ctx context.Context) (planner.InstallRegistry, error)
- func (s *Service) Validate(ctx context.Context, id, kind string, config json.RawMessage, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigStore ¶
type ConfigStore interface {
List(ctx context.Context) ([]state.AdapterConfig, error)
}
ConfigStore lists stored adapters (state.Adapters).
type CredentialStore ¶
type CredentialStore interface {
Resolve(ctx context.Context, adapterID string) (map[string]secret.Value, error)
}
CredentialStore opens an adapter's sealed credentials (state.AdapterCredentials).
type Declared ¶
type Declared struct {
ID string
Adapter api.ImageRegistryAdapter
IsDefault bool
}
Declared is a registry adapter the startup configuration declares, already configured.
type Provider ¶
Provider answers the registry in effect now. *Service is one; Static is one that never changes.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is the install's registry adapter, as core uses it. A nil *Registry is "none configured", and every method answers accordingly.
func Of ¶
func Of(id string, a api.ImageRegistryAdapter) *Registry
Of is the Registry for a configured adapter.
func (*Registry) Always ¶
Always reports whether builds go through the registry even for a runtime that can import them.
func (*Registry) Configured ¶
Configured reports whether the install has a registry.
type Service ¶
type Service struct {
Configs ConfigStore
Credentials CredentialStore
// New returns an unconfigured adapter of a kind, or nil.
New func(kind string) api.ImageRegistryAdapter
// Declared are the registries the startup configuration declares. A row
// in adapter_configs with the same ID is overridden by it.
Declared []Declared
}
Service builds the install's image registry adapter.
func (*Service) Adapter ¶
Adapter builds one registry adapter by ID, declared or stored, for the adapters screen's health and capabilities.
func (*Service) Current ¶
Current is the registry in effect now: nil when none is configured. One that cannot be built is an error that says why, never "none": a registry the operator configured and Pando silently ignored would send builds nowhere.
func (*Service) CurrentRegistry ¶
CurrentRegistry is Current as the planner asks it (planner.InstallRegistries). The planner cannot name this package's type: state imports the planner.
func (*Service) Validate ¶
func (s *Service) Validate(ctx context.Context, id, kind string, config json.RawMessage, given map[string]secret.Value) error
Validate configures a registry as it would be saved — config and the credentials given, beside the ones already stored for id that are not replaced — and returns the adapter's refusal, if it has one, so a registry Pando cannot use is refused when it is saved rather than by every deploy after. A credential sent empty removes the stored one, as saving does.