Merge pull request #19727 from prezha/fix-TestMultiControlPlane
fix cluster status check in TestMultiControlPlanepull/19736/head
commit
2129659800
|
@ -68,7 +68,7 @@ const (
|
|||
// 2xx signifies that the API Server is able to service requests
|
||||
|
||||
OK = 200
|
||||
OKHAppy = 201
|
||||
HAppy = 201
|
||||
Warning = 203
|
||||
Degraded = 204
|
||||
|
||||
|
@ -99,7 +99,7 @@ var (
|
|||
103: "Deleting",
|
||||
|
||||
200: "OK",
|
||||
201: "OKHAppy",
|
||||
201: "HAppy",
|
||||
203: "Warning",
|
||||
204: "Degraded",
|
||||
|
||||
|
@ -343,7 +343,7 @@ func GetState(sts []*Status, profile string, cc *config.ClusterConfig) State {
|
|||
case healthyCPs == 2:
|
||||
cs.StatusCode = Degraded
|
||||
default:
|
||||
cs.StatusCode = OKHAppy
|
||||
cs.StatusCode = HAppy
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -300,8 +300,10 @@ func validateHAStatusHAppy(ctx context.Context, t *testing.T, profile string) {
|
|||
|
||||
if profileObject == nil {
|
||||
t.Errorf("expected the json of 'profile list' to include %q but got *%q*. args: %q", profile, rr.Stdout.String(), rr.Command())
|
||||
} else if expected, numNodes := 4, len(profileObject.Config.Nodes); numNodes != expected {
|
||||
t.Errorf("expected profile %q in json of 'profile list' to include %d nodes but have %d nodes. got *%q*. args: %q", profile, expected, numNodes, rr.Stdout.String(), rr.Command())
|
||||
} else {
|
||||
if expected, numNodes := 4, len(profileObject.Config.Nodes); numNodes != expected {
|
||||
t.Errorf("expected profile %q in json of 'profile list' to include %d nodes but have %d nodes. got *%q*. args: %q", profile, expected, numNodes, rr.Stdout.String(), rr.Command())
|
||||
}
|
||||
|
||||
if expected, status := "HAppy", profileObject.Status; status != expected {
|
||||
t.Errorf("expected profile %q in json of 'profile list' to have %q status but have %q status. got *%q*. args: %q", profile, expected, status, rr.Stdout.String(), rr.Command())
|
||||
|
|
Loading…
Reference in New Issue