mirror of
https://github.com/actions/actions-runner-controller.git
synced 2025-12-11 03:57:01 +00:00
feat: RunnerDeployment
Adds the initial version of RunnerDeployment that is intended to manage RunnerSets(#1), like Deployment manages ReplicaSets. This is the initial version and therefore is bare bone. The only update strategy it supports is `Recreate`, which recreates the underlying RunnerSet when the runner template changes. I'd like to add `RollingUpdate` strategy once this is merged. This depends on #1 so the diff contains that of #1, too. Please see only the latest commit for review. Also see https://github.com/mumoshu/actions-runner-controller-ci/runs/471329823?check_suite_focus=true to confirm that `make tests` is passing after changes made in this commit.
This commit is contained in:
@@ -138,13 +138,15 @@ func (r *RunnerSetReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
|
||||
}
|
||||
|
||||
func (r *RunnerSetReconciler) newRunner(rs v1alpha1.RunnerSet) (v1alpha1.Runner, error) {
|
||||
objectMeta := rs.Spec.Template.ObjectMeta.DeepCopy()
|
||||
|
||||
objectMeta.GenerateName = rs.ObjectMeta.Name
|
||||
objectMeta.Namespace = rs.ObjectMeta.Namespace
|
||||
|
||||
runner := v1alpha1.Runner{
|
||||
TypeMeta: metav1.TypeMeta{},
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
GenerateName: rs.ObjectMeta.Name,
|
||||
Namespace: rs.ObjectMeta.Namespace,
|
||||
},
|
||||
Spec: rs.Spec.Template,
|
||||
TypeMeta: metav1.TypeMeta{},
|
||||
ObjectMeta: *objectMeta,
|
||||
Spec: rs.Spec.Template.Spec,
|
||||
}
|
||||
|
||||
if err := ctrl.SetControllerReference(&rs, &runner, r.Scheme); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user