Documentation
¶
Overview ¶
Package v1alpha1 contains API Schema definitions for the actions v1alpha1 API group. +kubebuilder:object:generate=true +groupName=actions.thecluster.io
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // SchemeGroupVersion is group version used to register these objects. // This name is used by applyconfiguration generators (e.g. controller-gen). SchemeGroupVersion = schema.GroupVersion{Group: "actions.thecluster.io", Version: "v1alpha1"} // GroupVersion is an alias for SchemeGroupVersion, for backward compatibility. GroupVersion = SchemeGroupVersion // SchemeBuilder is used to add go types to the GroupVersionKind scheme. SchemeBuilder = runtime.NewSchemeBuilder(func(scheme *runtime.Scheme) error { metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil }) // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme )
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct {
metav1.TypeMeta `json:",inline"`
// metadata is a standard object metadata
// +optional
metav1.ObjectMeta `json:"metadata,omitzero"`
// spec defines the desired state of Repository
// +required
Spec RepositorySpec `json:"spec"`
// status defines the observed state of Repository
// +optional
Status RepositoryStatus `json:"status,omitzero"`
}
Repository is a GitHub Actions runner scale set for one repository. It renders an actions-runner-controller AutoscalingRunnerSet in a namespace of its own, along with the RBAC and credentials the scale set needs there.
func (*Repository) DeepCopy ¶
func (in *Repository) DeepCopy() *Repository
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Repository.
func (*Repository) DeepCopyInto ¶
func (in *Repository) DeepCopyInto(out *Repository)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Repository) DeepCopyObject ¶
func (in *Repository) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type RepositoryList ¶
type RepositoryList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitzero"`
Items []Repository `json:"items"`
}
RepositoryList contains a list of Repository
func (*RepositoryList) DeepCopy ¶
func (in *RepositoryList) DeepCopy() *RepositoryList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RepositoryList.
func (*RepositoryList) DeepCopyInto ¶
func (in *RepositoryList) DeepCopyInto(out *RepositoryList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*RepositoryList) DeepCopyObject ¶
func (in *RepositoryList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type RepositorySpec ¶
type RepositorySpec struct {
// URL of the repository the runners register to, for example
// https://github.com/UnstoppableMango/dotfiles.
// +kubebuilder:validation:Pattern=`^https://[^/]+/[^/]+/[^/]+/?$`
URL string `json:"url"`
// Namespace the scale set and its runners run in. The operator creates it
// and deletes it with the Repository. Defaults to the operator's
// namespace prefix followed by the Repository's name.
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="namespace is immutable"
// +kubebuilder:validation:MaxLength=63
// +kubebuilder:validation:Pattern=`^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`
// +optional
Namespace string `json:"namespace,omitempty"`
RepositoryTemplate `json:",inline"`
}
RepositorySpec defines the desired state of Repository. Everything but the URL is optional: an unset field takes the operator's default, and the defaults describe a scale set of dind runners with a nix store volume. +kubebuilder:validation:XValidation:rule="!has(self.minRunners) || !has(self.maxRunners) || self.minRunners <= self.maxRunners",message="minRunners must not exceed maxRunners"
func (*RepositorySpec) DeepCopy ¶
func (in *RepositorySpec) DeepCopy() *RepositorySpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RepositorySpec.
func (*RepositorySpec) DeepCopyInto ¶
func (in *RepositorySpec) DeepCopyInto(out *RepositorySpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RepositoryStatus ¶
type RepositoryStatus struct {
// Namespace the scale set runs in.
// +optional
Namespace string `json:"namespace,omitempty"`
// Phase of the AutoscalingRunnerSet: Pending until its listener starts,
// Running once it does, and Outdated when the controller wants it
// recreated.
// +optional
Phase string `json:"phase,omitempty"`
// +listType=map
// +listMapKey=type
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`
}
RepositoryStatus defines the observed state of Repository.
func (*RepositoryStatus) DeepCopy ¶
func (in *RepositoryStatus) DeepCopy() *RepositoryStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RepositoryStatus.
func (*RepositoryStatus) DeepCopyInto ¶
func (in *RepositoryStatus) DeepCopyInto(out *RepositoryStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RepositoryTemplate ¶
type RepositoryTemplate struct {
// RunnerScaleSetName is the name the scale set registers under, the label
// a workflow's runs-on selects. Defaults to the operator's
// --runner-scale-set-name.
// +kubebuilder:validation:MaxLength=45
// +optional
RunnerScaleSetName string `json:"runnerScaleSetName,omitempty"`
// RunnerGroup the scale set joins. Omitted, it joins the default group.
// +optional
RunnerGroup string `json:"runnerGroup,omitempty"`
// MinRunners is how many idle runners to keep. Defaults to none.
// +kubebuilder:validation:Minimum=0
// +optional
MinRunners *int32 `json:"minRunners,omitempty"`
// MaxRunners caps how many runners run at once. Defaults to the
// operator's --max-runners.
// +kubebuilder:validation:Minimum=0
// +optional
MaxRunners *int32 `json:"maxRunners,omitempty"`
// GitHubConfigSecret is the Secret holding the GitHub App or token the
// scale set authenticates with. The operator copies it into Namespace,
// since the scale set can only read a Secret in its own namespace.
// Defaults to the operator's --github-config-secret.
// +optional
GitHubConfigSecret *SecretReference `json:"githubConfigSecret,omitempty"`
// NixStorageSize sizes the volume mounted at /nix in the default runner
// template. Defaults to the operator's --nix-storage-size. Ignored when
// Template is set.
// +optional
NixStorageSize *resource.Quantity `json:"nixStorageSize,omitempty"`
// Template replaces the default runner pod template outright.
// +kubebuilder:pruning:PreserveUnknownFields
// +kubebuilder:validation:Schemaless
// +kubebuilder:validation:Type=object
// +optional
Template *corev1.PodTemplateSpec `json:"template,omitempty"`
// ListenerTemplate is passed to the AutoscalingRunnerSet as is.
// +kubebuilder:pruning:PreserveUnknownFields
// +kubebuilder:validation:Schemaless
// +kubebuilder:validation:Type=object
// +optional
ListenerTemplate *corev1.PodTemplateSpec `json:"listenerTemplate,omitempty"`
}
RepositoryTemplate is the part of a Repository's spec a User applies to every Repository it generates.
func (*RepositoryTemplate) DeepCopy ¶
func (in *RepositoryTemplate) DeepCopy() *RepositoryTemplate
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RepositoryTemplate.
func (*RepositoryTemplate) DeepCopyInto ¶
func (in *RepositoryTemplate) DeepCopyInto(out *RepositoryTemplate)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SecretReference ¶
type SecretReference struct {
// Name of the Secret.
// +kubebuilder:validation:MinLength=1
Name string `json:"name"`
// Namespace of the Secret.
// +kubebuilder:validation:MinLength=1
Namespace string `json:"namespace"`
}
SecretReference names a Secret in any namespace.
func (*SecretReference) DeepCopy ¶
func (in *SecretReference) DeepCopy() *SecretReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretReference.
func (*SecretReference) DeepCopyInto ¶
func (in *SecretReference) DeepCopyInto(out *SecretReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type User ¶
type User struct {
metav1.TypeMeta `json:",inline"`
// metadata is a standard object metadata
// +optional
metav1.ObjectMeta `json:"metadata,omitzero"`
// spec defines the desired state of User
// +required
Spec UserSpec `json:"spec"`
// status defines the observed state of User
// +optional
Status UserStatus `json:"status,omitzero"`
}
User is a GitHub user whose repositories get runner scale sets. It generates a Repository for each repository it selects and deletes the Repositories it generated once their repository is no longer selected.
func (*User) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new User.
func (*User) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*User) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type UserList ¶
type UserList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitzero"`
Items []User `json:"items"`
}
UserList contains a list of User
func (*UserList) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserList.
func (*UserList) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*UserList) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type UserSpec ¶
type UserSpec struct {
// Login of the GitHub user, for example UnstoppableMango.
// +kubebuilder:validation:MaxLength=39
// +kubebuilder:validation:Pattern=`^[A-Za-z0-9]([-A-Za-z0-9]*[A-Za-z0-9])?$`
Login string `json:"login"`
// Repositories are names of the user's repositories that get runners
// whether or not discovery finds them. Include, Exclude, and the archived
// and fork switches do not apply to them.
// +listType=set
// +kubebuilder:validation:items:Pattern=`^[A-Za-z0-9._-]+$`
// +optional
Repositories []string `json:"repositories,omitempty"`
// Discover adds every repository the user owns that the credentials can
// see: the repositories a GitHub App installation was granted, or those a
// token's owner owns.
// +optional
Discover bool `json:"discover,omitempty"`
// Include limits discovered repositories to those whose name matches one
// of these globs, compared without regard to case. Empty includes all.
// +listType=set
// +optional
Include []string `json:"include,omitempty"`
// Exclude drops discovered repositories whose name matches one of these
// globs, compared without regard to case. It wins over Include.
// +listType=set
// +optional
Exclude []string `json:"exclude,omitempty"`
// IncludeArchived keeps archived repositories that discovery finds.
// +optional
IncludeArchived bool `json:"includeArchived,omitempty"`
// IncludeForks keeps forks that discovery finds.
// +optional
IncludeForks bool `json:"includeForks,omitempty"`
// Interval is how often discovery runs again. Defaults to 10m.
// +optional
Interval *metav1.Duration `json:"interval,omitempty"`
// Template is applied to every Repository the User generates. Its
// GitHubConfigSecret is also what discovery authenticates with.
// +kubebuilder:validation:XValidation:rule="!has(self.minRunners) || !has(self.maxRunners) || self.minRunners <= self.maxRunners",message="minRunners must not exceed maxRunners"
// +optional
Template RepositoryTemplate `json:"template,omitzero"`
}
UserSpec defines the desired state of User: which of a GitHub user's repositories get a Repository, and what those Repositories look like.
func (*UserSpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserSpec.
func (*UserSpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type UserStatus ¶
type UserStatus struct {
// Repositories are the names of the Repositories the User generated.
// +listType=set
// +optional
Repositories []string `json:"repositories,omitempty"`
// Conflicts are names of Repositories the User wanted but did not take
// over, because something else created them first.
// +listType=set
// +optional
Conflicts []string `json:"conflicts,omitempty"`
// LastDiscoveryTime is when discovery last succeeded.
// +optional
LastDiscoveryTime *metav1.Time `json:"lastDiscoveryTime,omitempty"`
// +listType=map
// +listMapKey=type
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`
}
UserStatus defines the observed state of User.
func (*UserStatus) DeepCopy ¶
func (in *UserStatus) DeepCopy() *UserStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserStatus.
func (*UserStatus) DeepCopyInto ¶
func (in *UserStatus) DeepCopyInto(out *UserStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.