mirror of
https://github.com/actions/actions-runner-controller.git
synced 2025-12-10 19:50:30 +00:00
Fix manager crashloopback for ARC deployments without scaleset-related controllers (#2293)
This commit is contained in:
12
main.go
12
main.go
@@ -317,7 +317,17 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
// We use this environment avariable to turn on the ScaleSet related controllers.
|
||||
// Otherwise ARC's legacy chart is unable to deploy a working ARC controller-manager pod,
|
||||
// due to that the chart does not contain new actions.* CRDs while ARC requires those CRDs.
|
||||
//
|
||||
// We might have used a more explicitly named environment variable for this,
|
||||
// e.g. "CONTROLLER_MANAGER_ENABLE_SCALE_SET" to explicitly enable the new controllers,
|
||||
// or "CONTROLLER_MANAGER_DISABLE_SCALE_SET" to explicitly disable the new controllers.
|
||||
// However, doing so would affect either private ARC testers or current ARC users
|
||||
// who run ARC without those variabls.
|
||||
mgrPodName := os.Getenv("CONTROLLER_MANAGER_POD_NAME")
|
||||
if mgrPodName != "" {
|
||||
mgrPodNamespace := os.Getenv("CONTROLLER_MANAGER_POD_NAMESPACE")
|
||||
var mgrPod corev1.Pod
|
||||
err = mgr.GetAPIReader().Get(context.Background(), types.NamespacedName{Namespace: mgrPodNamespace, Name: mgrPodName}, &mgrPod)
|
||||
@@ -340,7 +350,6 @@ func main() {
|
||||
log.Error(err, "unable to obtain manager container image")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if err = (&actionsgithubcom.AutoscalingRunnerSetReconciler{
|
||||
Client: mgr.GetClient(),
|
||||
Log: log.WithName("AutoscalingRunnerSet"),
|
||||
@@ -382,6 +391,7 @@ func main() {
|
||||
os.Exit(1)
|
||||
}
|
||||
// +kubebuilder:scaffold:builder
|
||||
}
|
||||
|
||||
if !disableAdmissionWebhook && !autoScalingRunnerSetOnly {
|
||||
injector := &actionssummerwindnet.PodRunnerTokenInjector{
|
||||
|
||||
Reference in New Issue
Block a user