Documentation
¶
Overview ¶
Package registrygitlab provides the GitLab Container Registry provider.
Index ¶
- func AuthHeaderFor(tokenType string) string
- func New() registry.RegistryProvider
- type GitLabProvider
- func (g *GitLabProvider) Login(ctx registry.Context, cfg registry.ProviderConfig) error
- func (g *GitLabProvider) Logout(ctx registry.Context, cfg registry.ProviderConfig) error
- func (g *GitLabProvider) Name() string
- func (g *GitLabProvider) Prune(ctx registry.Context, cfg registry.ProviderConfig) error
- func (g *GitLabProvider) Push(ctx registry.Context, cfg registry.ProviderConfig, imageRef string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthHeaderFor ¶ added in v0.14.1
AuthHeaderFor returns the correct GitLab API auth header name for tokenType. Exported for testing. tokenType is "job" (CI_JOB_TOKEN) or "private" (PAT/oauth2).
Types ¶
type GitLabProvider ¶
type GitLabProvider struct{}
GitLabProvider implements registry.RegistryProvider for GitLab Container Registry.
func (*GitLabProvider) Login ¶
func (g *GitLabProvider) Login(ctx registry.Context, cfg registry.ProviderConfig) error
Login authenticates with the GitLab registry host. In CI context ($CI_JOB_TOKEN set), uses gitlab-ci-token as username. Otherwise uses oauth2 with the token from auth.env.
func (*GitLabProvider) Logout ¶
func (g *GitLabProvider) Logout(ctx registry.Context, cfg registry.ProviderConfig) error
func (*GitLabProvider) Name ¶
func (g *GitLabProvider) Name() string
func (*GitLabProvider) Prune ¶
func (g *GitLabProvider) Prune(ctx registry.Context, cfg registry.ProviderConfig) error
Prune deletes tags beyond retention.keep_latest via the GitLab Container Registry API. Supports self-managed instances via ci.registries[].api_base_url.
func (*GitLabProvider) Push ¶
func (g *GitLabProvider) Push(ctx registry.Context, cfg registry.ProviderConfig, imageRef string) error
Click to show internal directories.
Click to hide internal directories.