Merge pull request #2207 from s-amann/feature/enable-mhc-by-default

feature: enable mhc by default
This commit is contained in:
Amber Brown 2022-06-27 10:53:44 +10:00 коммит произвёл GitHub
Родитель 6544bcd2c5 cd80fe47fa
Коммит 6be0cd14df
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 27 добавлений и 3 удалений

Просмотреть файл

@ -68,8 +68,8 @@ func DefaultOperatorFlags() OperatorFlags {
"aro.imageconfig.enabled": flagTrue,
"aro.machine.enabled": flagTrue,
"aro.machineset.enabled": flagTrue,
"aro.machinehealthcheck.enabled": flagFalse,
"aro.machinehealthcheck.managed": flagFalse,
"aro.machinehealthcheck.enabled": flagTrue,
"aro.machinehealthcheck.managed": flagTrue,
"aro.monitoring.enabled": flagTrue,
"aro.nodedrainer.enabled": flagTrue,
"aro.pullsecret.enabled": flagTrue,

Просмотреть файл

@ -7,7 +7,7 @@ package machinehealthcheck
The controller in this package aims to ensure the ARO MachineHealthCheck CR and MHC Remediation Alert
exist and are correctly configured to automatically mitigate non-ready worker nodes and create an in-cluster alert
when remediation is occuring frequently.
when remediation is occurring frequently.
There are two flags which control the operations performed by the controller:

Просмотреть файл

@ -5,8 +5,10 @@ package e2e
import (
"context"
"errors"
"fmt"
"regexp"
"strconv"
"strings"
"time"
@ -395,3 +397,25 @@ var _ = Describe("ARO Operator - MUO Deployment", func() {
Expect(err).NotTo(HaveOccurred())
})
})
var _ = Describe("ARO Operator - MHC Deployment", func() {
Specify("MHC should be enabled and managed by default", func() {
mhcIsDeployed := func() (bool, error) {
co, err := clients.AROClusters.AroV1alpha1().Clusters().Get(context.Background(), "cluster", metav1.GetOptions{})
if err != nil {
return false, err
}
mhcEnabled, _ := strconv.ParseBool(co.Spec.OperatorFlags.GetWithDefault("aro.machinehealthcheck.enabled", "false"))
mhcManaged, _ := strconv.ParseBool(co.Spec.OperatorFlags.GetWithDefault("aro.machinehealthcheck.managed", "false"))
if mhcEnabled && mhcManaged {
return true, nil
}
return false, errors.New("mhc should be enabled and managed by default")
}
err := wait.PollImmediate(30*time.Second, 10*time.Minute, mhcIsDeployed)
Expect(err).NotTo(HaveOccurred())
})
})