actions

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 35 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// RepositoryFinalizer holds a Repository until its AutoscalingRunnerSet
	// is gone, so the actions-runner-controller can deregister the scale set
	// and clean up its runners before the namespace goes.
	RepositoryFinalizer = "repository.actions.thecluster.io/finalizer"

	// TypeReady is the condition a Repository reports.
	TypeReady = "Ready"
)
View Source
const (
	// UserLabel names the User that generated a Repository.
	UserLabel = "actions.thecluster.io/user"
)

Variables

This section is empty.

Functions

func DefaultNamespace

func DefaultNamespace(prefix, name string) string

DefaultNamespace is the namespace a Repository named name gets when it sets none: the prefix and the name, with the dots and underscores a namespace cannot hold replaced by dashes. It matches the arc-runner-scale-set chart in the-cluster, so a migrated scale set keeps its namespace.

A result longer than a namespace can be is cut short and given a hash of the full name, so two long names that share a beginning stay apart.

func RepositoryName

func RepositoryName(repo string) string

RepositoryName is the name of the Repository a User generates for the repository called repo: lowercased, with dots and underscores replaced by dashes. It matches the scale set names in the-cluster's arc-runners, so a generated Repository lands in the namespace the chart used.

Types

type Defaults

type Defaults struct {
	// ControllerVersion is the actions-runner-controller version. The
	// controller deletes any AutoscalingRunnerSet whose version label differs
	// from its own in major or minor.
	ControllerVersion string

	// ControllerServiceAccount is the controller's ServiceAccount, which each
	// scale set's manager Role is bound to.
	ControllerServiceAccount types.NamespacedName

	// GitHubConfigSecret is the Secret copied into a Repository's namespace
	// when it names none.
	GitHubConfigSecret types.NamespacedName

	NamespacePrefix    string
	RunnerScaleSetName string
	MaxRunners         int32

	RunnerImage    string
	DindImage      string
	StorageClass   string
	NixStorageSize resource.Quantity
	WorkSize       resource.Quantity

	// RunnerNixConfig is set as NIX_CONFIG on the runner container, for
	// example to point nix at an in-cluster binary cache. Empty sets nothing.
	RunnerNixConfig string
}

Defaults is what a Repository gets for every field it leaves unset, plus the facts about the cluster's actions-runner-controller install that no Repository should have to restate. The manager fills it from flags, so image pins and cluster specifics stay with whoever deploys the operator.

func (Defaults) Validate

func (d Defaults) Validate() error

Validate reports the settings a Repository cannot be reconciled without.

type RepositoryReconciler

type RepositoryReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Defaults Defaults
}

RepositoryReconciler reconciles a Repository object

func (*RepositoryReconciler) Reconcile

func (r *RepositoryReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile renders a Repository as the objects the gha-runner-scale-set chart would: a namespace, a copy of the GitHub credentials, a ServiceAccount with no permissions for the runners, a Role and RoleBinding for the controller, and the AutoscalingRunnerSet itself.

func (*RepositoryReconciler) SetupWithManager

func (r *RepositoryReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type UserReconciler

type UserReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Defaults Defaults

	// GitHubURL is where repositories live, for the URL of a Repository the
	// User lists by name. GitHubAPIURL is what discovery calls.
	GitHubURL    string
	GitHubAPIURL string
}

UserReconciler reconciles a User object

func (*UserReconciler) Reconcile

func (r *UserReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile generates a Repository for each repository the User selects, and deletes the Repositories it generated for repositories it no longer selects. A Repository someone else created is left alone, even when the User selects its repository. Deleting the User deletes its Repositories through their owner references.

func (*UserReconciler) SetupWithManager

func (r *UserReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager. Status updates are filtered out, since each reconcile writes the User's own and would otherwise start another discovery before the interval is up.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL