Fix manager crashloopback for ARC deployments without scaleset-related controllers (#2293)
This commit is contained in:
parent
274d0c874e
commit
a44fe04bef
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")
|
mgrPodName := os.Getenv("CONTROLLER_MANAGER_POD_NAME")
|
||||||
|
if mgrPodName != "" {
|
||||||
mgrPodNamespace := os.Getenv("CONTROLLER_MANAGER_POD_NAMESPACE")
|
mgrPodNamespace := os.Getenv("CONTROLLER_MANAGER_POD_NAMESPACE")
|
||||||
var mgrPod corev1.Pod
|
var mgrPod corev1.Pod
|
||||||
err = mgr.GetAPIReader().Get(context.Background(), types.NamespacedName{Namespace: mgrPodNamespace, Name: mgrPodName}, &mgrPod)
|
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")
|
log.Error(err, "unable to obtain manager container image")
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = (&actionsgithubcom.AutoscalingRunnerSetReconciler{
|
if err = (&actionsgithubcom.AutoscalingRunnerSetReconciler{
|
||||||
Client: mgr.GetClient(),
|
Client: mgr.GetClient(),
|
||||||
Log: log.WithName("AutoscalingRunnerSet"),
|
Log: log.WithName("AutoscalingRunnerSet"),
|
||||||
|
|
@ -382,6 +391,7 @@ func main() {
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
// +kubebuilder:scaffold:builder
|
// +kubebuilder:scaffold:builder
|
||||||
|
}
|
||||||
|
|
||||||
if !disableAdmissionWebhook && !autoScalingRunnerSetOnly {
|
if !disableAdmissionWebhook && !autoScalingRunnerSetOnly {
|
||||||
injector := &actionssummerwindnet.PodRunnerTokenInjector{
|
injector := &actionssummerwindnet.PodRunnerTokenInjector{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue