Unverified Commit f3d7327b authored by Phillip Kuznetsov's avatar Phillip Kuznetsov Committed by Copybara
Browse files

Pixie operator monitor: Replace all updating phases with unhealthy.

Summary:
Our operator monitoring code would set the updating phase under certain conditions which might actually be failures. When the crd lists as updating,
the vizier_controller chooses not to run an update which can get the operator stuck. We basically should not tell the controller that we're updating in the
monitoring code because they should be separate.

In a future diff we will add a new state that tracks the reconciler status - that state will contain the updating phase (ready, updating, failed)
which will then be used by the reconciler to make decisions about whether to rerun updates or not. For now we just change this to simplify an otherwise
annoying loop.

Test Plan: Updated tests

Reviewers: vihang, michelle

Reviewed By: vihang, michelle

Differential Revision: https://phab.corp.pixielabs.ai/D9771

GitOrigin-RevId: 248d68e7d7abc7cbb917dc2f0f39e9a33e144a33
parent f1795fba
Showing with 6 additions and 27 deletions
+6 -27
......@@ -546,27 +546,6 @@ func translateReasonToPhase(reason status.VizierReason) pixiev1alpha1.VizierPhas
if reason == "" {
return pixiev1alpha1.VizierPhaseHealthy
}
if reason == status.CloudConnectorPodPending {
return pixiev1alpha1.VizierPhaseUpdating
}
if reason == status.MetadataPVCPendingBinding {
return pixiev1alpha1.VizierPhaseUpdating
}
if reason == status.NATSPodPending {
return pixiev1alpha1.VizierPhaseUpdating
}
if reason == status.CloudConnectorPodPending {
return pixiev1alpha1.VizierPhaseUpdating
}
if reason == status.ControlPlanePodsPending {
return pixiev1alpha1.VizierPhaseUpdating
}
if reason == status.MetadataPVCPendingBinding {
return pixiev1alpha1.VizierPhaseUpdating
}
if reason == status.ControlPlanePodsPending {
return pixiev1alpha1.VizierPhaseUpdating
}
if reason == status.CloudConnectorMissing {
return pixiev1alpha1.VizierPhaseDisconnected
}
......
......@@ -144,7 +144,7 @@ func TestMonitor_getCloudConnState(t *testing.T) {
name: "updating",
cloudConnStatusz: "",
cloudConnPhase: v1.PodPending,
expectedVizierPhase: v1alpha1.VizierPhaseUpdating,
expectedVizierPhase: v1alpha1.VizierPhaseUnhealthy,
expectedReason: status.CloudConnectorPodPending,
},
{
......@@ -236,7 +236,7 @@ func TestMonitor_getCloudConnState_SeveralCloudConns(t *testing.T) {
state := getCloudConnState(httpClient, pods)
assert.Equal(t, status.CloudConnectorPodPending, state.Reason)
assert.Equal(t, v1alpha1.VizierPhaseUpdating, translateReasonToPhase(state.Reason))
assert.Equal(t, v1alpha1.VizierPhaseUnhealthy, translateReasonToPhase(state.Reason))
}
func TestMonitor_operatorBasedNATsPod(t *testing.T) {
......@@ -273,7 +273,7 @@ func TestMonitor_operatorBasedNATsPod(t *testing.T) {
natsIP: "127.0.0.2",
natsPhase: v1.PodPending,
expectedReason: "NATSPodPending",
expectedVizierPhase: v1alpha1.VizierPhaseUpdating,
expectedVizierPhase: v1alpha1.VizierPhaseUnhealthy,
natsPodNameLabel: natsLabel,
natsPodName: natsPodName,
},
......@@ -373,7 +373,7 @@ func TestMonitor_getControlPlanePodState(t *testing.T) {
},
{
name: "pending metadata",
expectedVizierPhase: v1alpha1.VizierPhaseUpdating,
expectedVizierPhase: v1alpha1.VizierPhaseUnhealthy,
podPhases: map[string]phasePlane{
"vizier-metadata": {
phase: v1.PodPending,
......@@ -426,7 +426,7 @@ func TestMonitor_getControlPlanePodState(t *testing.T) {
},
{
name: "updating if no-plane-pod is pending",
expectedVizierPhase: v1alpha1.VizierPhaseUpdating,
expectedVizierPhase: v1alpha1.VizierPhaseUnhealthy,
podPhases: map[string]phasePlane{
"vizier-metadata": {
phase: v1.PodRunning,
......
......@@ -53,7 +53,7 @@ func TestMonitor_getPVCState(t *testing.T) {
pvcPhase: v1.ClaimPending,
pvcStorageClassName: "standard",
clusterStorageClassNames: []string{"standard"},
expectedVizierPhase: v1alpha1.VizierPhaseUpdating,
expectedVizierPhase: v1alpha1.VizierPhaseUnhealthy,
expectedReason: status.MetadataPVCPendingBinding,
},
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment