Documentation
¶
Index ¶
- Variables
- type Gitlab
- func (g *Gitlab) CommitTemplateFiles() error
- func (g *Gitlab) Connect() error
- func (g *Gitlab) Create() error
- func (g *Gitlab) EnsureCIVariables(ctx context.Context, managedVariables []string, variables []manager.EnvVar) error
- func (g *Gitlab) EnsureProjectAccessToken(ctx context.Context, name string, opts manager.EnsureProjectAccessTokenOptions) (manager.ProjectAccessToken, error)
- func (g *Gitlab) FullURL() *url.URL
- func (g *Gitlab) IsType(_ *url.URL) (bool, error)
- func (g *Gitlab) New(options manager.RepoOptions) (manager.Repo, error)
- func (g *Gitlab) Read() error
- func (g *Gitlab) Remove() error
- func (g *Gitlab) Type() string
- func (g *Gitlab) Update() (bool, error)
Constants ¶
This section is empty.
Variables ¶
var (
ListItemsPerPage = 100
)
Functions ¶
This section is empty.
Types ¶
type Gitlab ¶
type Gitlab struct {
// contains filtered or unexported fields
}
Gitlab holds the necessary information to communincate with a Gitlab server. Each Gitlab instance will handle exactly one project.
func (*Gitlab) CommitTemplateFiles ¶
CommitTemplateFiles uploads all defined template files onto the repository.
func (*Gitlab) EnsureCIVariables ¶ added in v1.10.0
func (g *Gitlab) EnsureCIVariables(ctx context.Context, managedVariables []string, variables []manager.EnvVar) error
EnsureCIVariables ensures that the given variables are set in the CI/CD pipeline. The managedVariables is used to identify the variables that are managed by the operator. Variables that are not managed by the operator will be ignored. Variables that are managed but not in variables will be deleted.
func (*Gitlab) EnsureProjectAccessToken ¶ added in v1.10.0
func (g *Gitlab) EnsureProjectAccessToken(ctx context.Context, name string, opts manager.EnsureProjectAccessTokenOptions) (manager.ProjectAccessToken, error)
EnsureProjectAccessToken ensures that the project has an access token set. If the token is expired or not set, a new token will be created. This implementation does not use the Gitlab token rotation feature. Using this feature would invalidate old tokens immediately, which would break pipelines. Also the newly created token would immediately be revoked if an old one is used.
func (*Gitlab) IsType ¶
TODO: this will be deprecated in favour of a fixed type definition in the CRD. As there's currently only the GitLab implementation this is a workaround for the brittle detection.
func (*Gitlab) Read ¶
Read reads the repository from the gitlab server and sets the object's state accordingly