Documentation
¶
Index ¶
- func FindApplicationByID(apps []*gitlab.Application, id int64) *gitlab.Application
- func GenerateAddLicenseOptions(license string) *gitlab.AddLicenseOptions
- func GenerateAppearanceObservation(observed *gitlab.Appearance) v1alpha1.AppearanceObservation
- func GenerateApplicationObservation(a *gitlab.Application) v1alpha1.ApplicationObservation
- func GenerateApplicationSettingsObservation(g *gitlab.Settings) v1alpha1.ApplicationSettingsObservation
- func GenerateCreateApplicationOptions(p *v1alpha1.ApplicationParameters) *gitlab.CreateApplicationOptions
- func GenerateCreateServiceAccountAccessTokenOptions(p *v1alpha1.ServiceAccountAccessTokenParameters) *gitlab.CreatePersonalAccessTokenOptions
- func GenerateCreateVariableOptions(p *v1alpha1.VariableParameters) *gitlab.CreateInstanceVariableOptions
- func GenerateLicenseObservation(observed *gitlab.License) v1alpha1.LicenseObservation
- func GenerateRotateServiceAccountAccessTokenOptions(p *v1alpha1.ServiceAccountAccessTokenParameters) *gitlab.RotatePersonalAccessTokenOptions
- func GenerateServiceAccountAccessTokenObservation(at *gitlab.PersonalAccessToken) v1alpha1.ServiceAccountAccessTokenObservation
- func GenerateServiceAccountCreateOptions(p *v1alpha1.ServiceAccountParameters) *gitlab.CreateServiceAccountUserOptions
- func GenerateServiceAccountObservation(u *gitlab.User) v1alpha1.ServiceAccountObservation
- func GenerateUpdateAppearanceOptions(params *v1alpha1.AppearanceParameters) *gitlab.ChangeAppearanceOptions
- func GenerateUpdateApplicationSettingsOptions(p *v1alpha1.ApplicationSettingsParameters) *gitlab.UpdateSettingsOptions
- func GenerateUpdateServiceAccountOptions(p *v1alpha1.ServiceAccountParameters) *gitlab.ModifyUserOptions
- func GenerateUpdateVariableOptions(p *v1alpha1.VariableParameters) *gitlab.UpdateInstanceVariableOptions
- func GenerateVariableObservation(variable *gitlab.InstanceVariable) v1alpha1.VariableObservation
- func IsAppearanceUpToDate(spec *v1alpha1.AppearanceParameters, observed *gitlab.Appearance) bool
- func IsApplicationRenewalDue(p *v1alpha1.ApplicationParameters, nextRenewalAt *metav1.Time) bool
- func IsApplicationSettingsUpToDate(p *v1alpha1.ApplicationSettingsParameters, g *gitlab.Settings) bool
- func IsApplicationUpToDate(p *v1alpha1.ApplicationParameters, a *gitlab.Application) bool
- func IsLicenseUpToDate(spec *v1alpha1.LicenseParameters, observed *gitlab.License) bool
- func IsServiceAccountUpToDate(p *v1alpha1.ServiceAccountParameters, u *gitlab.User) bool
- func IsVariableUpToDate(p *v1alpha1.VariableParameters, g *gitlab.InstanceVariable) bool
- func LateInitializeVariable(in *v1alpha1.VariableParameters, variable *gitlab.InstanceVariable)
- func NextRenewalAt(periodDays int64) *metav1.Time
- func NextRenewalTime(periodDays int64) time.Time
- func ShouldRotateServiceAccountAccessToken(p *v1alpha1.ServiceAccountAccessTokenParameters, a *gitlab.PersonalAccessToken) bool
- type AppearanceClient
- type ApplicationClient
- type ApplicationSettingsClient
- type LicenseClient
- type ServiceAccountAccessTokenClient
- type ServiceAccountClient
- type VariableClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindApplicationByID ¶ added in v0.21.1
func FindApplicationByID(apps []*gitlab.Application, id int64) *gitlab.Application
FindApplicationByID returns application with given numeric ID from list, or nil if not found.
func GenerateAddLicenseOptions ¶ added in v0.17.0
func GenerateAddLicenseOptions(license string) *gitlab.AddLicenseOptions
GenerateAddLicenseOptions from a license string
func GenerateAppearanceObservation ¶ added in v0.17.0
func GenerateAppearanceObservation(observed *gitlab.Appearance) v1alpha1.AppearanceObservation
GenerateAppearanceObservation generates an observation from a Gitlab Appearance
func GenerateApplicationObservation ¶ added in v0.21.1
func GenerateApplicationObservation(a *gitlab.Application) v1alpha1.ApplicationObservation
GenerateApplicationObservation creates ApplicationObservation from gitlab.Application.
func GenerateApplicationSettingsObservation ¶
func GenerateApplicationSettingsObservation(g *gitlab.Settings) v1alpha1.ApplicationSettingsObservation
GenerateApplicationSettingsObservation generates GitLab Settings observation from the actual state This function is generated by ApplicationSettingsObservation and gitlab.Settings reflection
func GenerateCreateApplicationOptions ¶ added in v0.21.1
func GenerateCreateApplicationOptions(p *v1alpha1.ApplicationParameters) *gitlab.CreateApplicationOptions
GenerateCreateApplicationOptions produces CreateApplicationOptions from ApplicationParameters.
func GenerateCreateServiceAccountAccessTokenOptions ¶ added in v0.21.0
func GenerateCreateServiceAccountAccessTokenOptions(p *v1alpha1.ServiceAccountAccessTokenParameters) *gitlab.CreatePersonalAccessTokenOptions
GenerateCreateServiceAccountAccessTokenOptions generates creation options for the admin user-token endpoint.
func GenerateCreateVariableOptions ¶ added in v0.17.0
func GenerateCreateVariableOptions(p *v1alpha1.VariableParameters) *gitlab.CreateInstanceVariableOptions
GenerateCreateVariableOptions creates gitlab CreateInstanceVariableOptions from VariableParameters
func GenerateLicenseObservation ¶ added in v0.17.0
func GenerateLicenseObservation(observed *gitlab.License) v1alpha1.LicenseObservation
GenerateLicenseObservation creates LicenseObservation from Gitlab License
func GenerateRotateServiceAccountAccessTokenOptions ¶ added in v0.21.0
func GenerateRotateServiceAccountAccessTokenOptions(p *v1alpha1.ServiceAccountAccessTokenParameters) *gitlab.RotatePersonalAccessTokenOptions
GenerateRotateServiceAccountAccessTokenOptions generates rotation options. The same option type is used for both the owner (by-id) and self rotate endpoints.
func GenerateServiceAccountAccessTokenObservation ¶ added in v0.21.0
func GenerateServiceAccountAccessTokenObservation(at *gitlab.PersonalAccessToken) v1alpha1.ServiceAccountAccessTokenObservation
GenerateServiceAccountAccessTokenObservation generates an observation from a gitlab.PersonalAccessToken.
func GenerateServiceAccountCreateOptions ¶ added in v0.17.0
func GenerateServiceAccountCreateOptions(p *v1alpha1.ServiceAccountParameters) *gitlab.CreateServiceAccountUserOptions
GenerateServiceAccountCreateOptions is used to produce CreateServiceAccountUserOptions from ServiceAccountParameters
func GenerateServiceAccountObservation ¶ added in v0.17.0
func GenerateServiceAccountObservation(u *gitlab.User) v1alpha1.ServiceAccountObservation
GenerateServiceAccountObservation is used to produce ServiceAccountObservation from Gitlab User
func GenerateUpdateAppearanceOptions ¶ added in v0.17.0
func GenerateUpdateAppearanceOptions(params *v1alpha1.AppearanceParameters) *gitlab.ChangeAppearanceOptions
GenerateUpdateAppearanceOptions generates Gitlab ChangeAppearanceOptions from AppearanceParameters
func GenerateUpdateApplicationSettingsOptions ¶
func GenerateUpdateApplicationSettingsOptions(p *v1alpha1.ApplicationSettingsParameters) *gitlab.UpdateSettingsOptions
GenerateUpdateApplicationSettingsOptions generates GitLab Settings update options from the desired state This function is generated by ApplicationSettingsParameters and gitlab.UpdateSettingsOptions reflection
func GenerateUpdateServiceAccountOptions ¶ added in v0.17.0
func GenerateUpdateServiceAccountOptions(p *v1alpha1.ServiceAccountParameters) *gitlab.ModifyUserOptions
GenerateUpdateServiceAccountOptions is used to produce ModifyUserOptions from ServiceAccountParameters
func GenerateUpdateVariableOptions ¶ added in v0.17.0
func GenerateUpdateVariableOptions(p *v1alpha1.VariableParameters) *gitlab.UpdateInstanceVariableOptions
GenerateUpdateVariableOptions creates gitlab UpdateInstanceVariableOptions from VariableParameters
func GenerateVariableObservation ¶ added in v0.17.0
func GenerateVariableObservation(variable *gitlab.InstanceVariable) v1alpha1.VariableObservation
GenerateVariableObservation creates VariableObservation from gitlab InstanceVariable
func IsAppearanceUpToDate ¶ added in v0.17.0
func IsAppearanceUpToDate(spec *v1alpha1.AppearanceParameters, observed *gitlab.Appearance) bool
IsAppearanceUpToDate checks whether the Appearance parameters are up to date
func IsApplicationRenewalDue ¶ added in v0.21.1
func IsApplicationRenewalDue(p *v1alpha1.ApplicationParameters, nextRenewalAt *metav1.Time) bool
IsApplicationRenewalDue returns true when RenewalPeriodDays is configured and the renewal time persisted in status (nextRenewalAt) has been reached. A nil nextRenewalAt means the schedule has not been initialised yet, so renewal is not due: the schedule is seeded during Observe rather than treating an unset schedule as "due now".
func IsApplicationSettingsUpToDate ¶
func IsApplicationSettingsUpToDate(p *v1alpha1.ApplicationSettingsParameters, g *gitlab.Settings) bool
IsApplicationSettingsUpToDate checks whether the observed state matches the desired state This function is generated by ApplicationSettingsParameters and gitlab.Settings reflection
func IsApplicationUpToDate ¶ added in v0.21.1
func IsApplicationUpToDate(p *v1alpha1.ApplicationParameters, a *gitlab.Application) bool
IsApplicationUpToDate checks whether the ApplicationParameters are in sync with a gitlab.Application. Since GitLab has no update endpoint for applications, this compares observable fields only.
func IsLicenseUpToDate ¶ added in v0.17.0
func IsLicenseUpToDate(spec *v1alpha1.LicenseParameters, observed *gitlab.License) bool
IsLicenseUpToDate checks whether the License is up to date Since the GitLab API does not provide a way to get the current license details, We assume that the license is the one provided. This only checks if the license is expired or not.
func IsServiceAccountUpToDate ¶ added in v0.17.0
func IsServiceAccountUpToDate(p *v1alpha1.ServiceAccountParameters, u *gitlab.User) bool
IsServiceAccountUpToDate checks whether the ServiceAccountParameters is in sync with Gitlab User returns true if the parameters are nil or all fields are in sync
func IsVariableUpToDate ¶ added in v0.17.0
func IsVariableUpToDate(p *v1alpha1.VariableParameters, g *gitlab.InstanceVariable) bool
IsVariableUpToDate checks whether the VariableParameters is in sync with the external representation.
func LateInitializeVariable ¶ added in v0.17.0
func LateInitializeVariable(in *v1alpha1.VariableParameters, variable *gitlab.InstanceVariable)
LateInitializeVariable fills the empty fields in the variable spec with the values seen in gitlab.Variable.
func NextRenewalAt ¶ added in v0.21.1
NextRenewalAt returns the next scheduled renewal time as a *metav1.Time, periodDays days from now.
func NextRenewalTime ¶ added in v0.21.1
NextRenewalTime returns the UTC time that is periodDays days from now.
func ShouldRotateServiceAccountAccessToken ¶ added in v0.21.0
func ShouldRotateServiceAccountAccessToken(p *v1alpha1.ServiceAccountAccessTokenParameters, a *gitlab.PersonalAccessToken) bool
ShouldRotateServiceAccountAccessToken returns true when the token must be rotated.
Types ¶
type AppearanceClient ¶ added in v0.17.0
type AppearanceClient interface {
GetAppearance(options ...gitlab.RequestOptionFunc) (*gitlab.Appearance, *gitlab.Response, error)
ChangeAppearance(opt *gitlab.ChangeAppearanceOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Appearance, *gitlab.Response, error)
}
ApplicationSettingsClient defines Gitlab Application Settings service operations
func NewAppearanceClient ¶ added in v0.17.0
func NewAppearanceClient(cfg common.Config) AppearanceClient
NewAppearanceClient returns a new Gitlab Appearance service
type ApplicationClient ¶ added in v0.21.1
type ApplicationClient interface {
CreateApplication(opt *gitlab.CreateApplicationOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Application, *gitlab.Response, error)
ListApplications(opt *gitlab.ListApplicationsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Application, *gitlab.Response, error)
DeleteApplication(application int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error)
RenewApplicationSecret(application int64, options ...gitlab.RequestOptionFunc) (*gitlab.Application, *gitlab.Response, error)
}
ApplicationClient defines GitLab Applications service operations used by controller.
func NewApplicationClient ¶ added in v0.21.1
func NewApplicationClient(cfg common.Config) ApplicationClient
NewApplicationClient returns new GitLab Applications client.
type ApplicationSettingsClient ¶
type ApplicationSettingsClient interface {
GetSettings(options ...gitlab.RequestOptionFunc) (*gitlab.Settings, *gitlab.Response, error)
UpdateSettings(opt *gitlab.UpdateSettingsOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Settings, *gitlab.Response, error)
}
ApplicationSettingsClient defines Gitlab Application Settings service operations
func NewApplicationSettingsClient ¶
func NewApplicationSettingsClient(cfg common.Config) ApplicationSettingsClient
NewApplicationSettingsClient returns a new Gitlab Application Settings service
type LicenseClient ¶ added in v0.17.0
type LicenseClient interface {
GetLicense(options ...gitlab.RequestOptionFunc) (*gitlab.License, *gitlab.Response, error)
AddLicense(opt *gitlab.AddLicenseOptions, options ...gitlab.RequestOptionFunc) (*gitlab.License, *gitlab.Response, error)
DeleteLicense(licenseID int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error)
}
LicenseClient defines Gitlab License service operations
func NewLicenseClient ¶ added in v0.17.0
func NewLicenseClient(cfg common.Config) LicenseClient
NewLicenseClient returns a new Gitlab License service
type ServiceAccountAccessTokenClient ¶ added in v0.21.0
type ServiceAccountAccessTokenClient interface {
// Owner-authenticated endpoints (the ProviderConfig is an instance admin).
GetUser(user int64, opt *gitlab.GetUserOptions, options ...gitlab.RequestOptionFunc) (*gitlab.User, *gitlab.Response, error)
CreatePersonalAccessToken(user int64, opt *gitlab.CreatePersonalAccessTokenOptions, options ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error)
GetSinglePersonalAccessTokenByID(token int64, options ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error)
RotatePersonalAccessTokenByID(token int64, opt *gitlab.RotatePersonalAccessTokenOptions, options ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error)
RevokePersonalAccessTokenByID(token int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error)
// Self-authenticated endpoints (the ProviderConfig authenticates with the
// very token this resource manages). Used in self-managed mode.
GetServiceAccountSelf(options ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error)
RotateServiceAccountSelf(opt *gitlab.RotatePersonalAccessTokenOptions, options ...gitlab.RequestOptionFunc) (*gitlab.PersonalAccessToken, *gitlab.Response, error)
RevokeServiceAccountSelf(options ...gitlab.RequestOptionFunc) (*gitlab.Response, error)
}
ServiceAccountAccessTokenClient defines GitLab instance service account personal access token operations.
Instance service accounts have no dedicated token endpoints; their tokens are managed through the personal access tokens API. Owner mode therefore relies on instance-admin endpoints (create a token for an arbitrary user, and address tokens by ID), while self-managed mode uses the generic self endpoints.
func NewServiceAccountAccessTokenClient ¶ added in v0.21.0
func NewServiceAccountAccessTokenClient(cfg common.Config) ServiceAccountAccessTokenClient
NewServiceAccountAccessTokenClient returns a new GitLab instance service account access token service.
type ServiceAccountClient ¶ added in v0.17.0
type ServiceAccountClient interface {
GetUser(user int64, opt *gitlab.GetUserOptions, options ...gitlab.RequestOptionFunc) (*gitlab.User, *gitlab.Response, error)
CreateServiceAccountUser(opts *gitlab.CreateServiceAccountUserOptions, options ...gitlab.RequestOptionFunc) (*gitlab.User, *gitlab.Response, error)
ModifyUser(user int64, opt *gitlab.ModifyUserOptions, options ...gitlab.RequestOptionFunc) (*gitlab.User, *gitlab.Response, error)
DeleteUser(user int64, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error)
}
ServiceAccountClient defines Gitlab Service Account service operations
func NewServiceAccountClient ¶ added in v0.17.0
func NewServiceAccountClient(cfg common.Config) ServiceAccountClient
NewServiceAccountClient returns a new Gitlab Service Account service
type VariableClient ¶ added in v0.17.0
type VariableClient interface {
GetVariable(key string, options ...gitlab.RequestOptionFunc) (*gitlab.InstanceVariable, *gitlab.Response, error)
CreateVariable(opt *gitlab.CreateInstanceVariableOptions, options ...gitlab.RequestOptionFunc) (*gitlab.InstanceVariable, *gitlab.Response, error)
UpdateVariable(key string, opt *gitlab.UpdateInstanceVariableOptions, options ...gitlab.RequestOptionFunc) (*gitlab.InstanceVariable, *gitlab.Response, error)
RemoveVariable(key string, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error)
}
VariableClient defines Gitlab Variable service operations
func NewVariableClient ¶ added in v0.17.0
func NewVariableClient(cfg common.Config) VariableClient
NewVariableClient returns a new Gitlab Variable service