From 42a4fd3df4d35bece254de7e0783b34cc47fba00 Mon Sep 17 00:00:00 2001 From: Matt Moore Date: Fri, 2 Nov 2018 23:46:19 +0000 Subject: [PATCH] Pull in https://github.com/knative/pkg/pull/161 --- Gopkg.lock | 4 +- Gopkg.toml | 4 +- .../serving/v1alpha1/revision_types_test.go | 5 +- .../clusteringress/clusteringress_test.go | 30 +- .../configuration/configuration_test.go | 120 ++- .../v1alpha1/revision/revision_test.go | 3 + .../v1alpha1/revision/table_test.go | 900 ++++++++++-------- pkg/reconciler/v1alpha1/route/table_test.go | 498 ++++++---- .../v1alpha1/route/traffic/errors_test.go | 5 + .../v1alpha1/service/service_test.go | 129 +-- .../pkg/apis/duck/v1alpha1/condition_set.go | 86 +- .../apis/duck/v1alpha1/conditions_types.go | 21 +- 12 files changed, 1065 insertions(+), 740 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index dabecf0e29ae..6d2442619585 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -396,7 +396,7 @@ revision = "f0d7bb60956f88d4743f5fea66b5607b96d262c9" [[projects]] - digest = "1:b42dafab6bf401d145cdac6e05ce7da87b1925ee2fc79cafc0e9485cb2bb4497" + digest = "1:6f34001da50b1b84998bafa8178d72e28726cd4f9358aefad1220f95655ae61f" name = "github.com/knative/pkg" packages = [ "apis", @@ -440,7 +440,7 @@ "webhook", ] pruneopts = "NUT" - revision = "088e3f7faf9d7ed0122937f66289cc050d0a78b0" + revision = "4b704fa7948ad9ae8ec90d1cd5b4a34516b252ea" [[projects]] branch = "master" diff --git a/Gopkg.toml b/Gopkg.toml index c570aedfc9f9..fbc6192d6671 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -23,8 +23,8 @@ required = [ [[override]] name = "github.com/knative/pkg" - # HEAD as of 2018-11-06 - revision = "088e3f7faf9d7ed0122937f66289cc050d0a78b0" + # HEAD as of 2018-11-08 + revision = "4b704fa7948ad9ae8ec90d1cd5b4a34516b252ea" [[override]] name = "go.uber.org/zap" diff --git a/pkg/apis/serving/v1alpha1/revision_types_test.go b/pkg/apis/serving/v1alpha1/revision_types_test.go index 8c88cc36e9c2..4945b9a90813 100644 --- a/pkg/apis/serving/v1alpha1/revision_types_test.go +++ b/pkg/apis/serving/v1alpha1/revision_types_test.go @@ -278,8 +278,9 @@ func TestGetSetCondition(t *testing.T) { } rc := &duckv1alpha1.Condition{ - Type: RevisionConditionBuildSucceeded, - Status: corev1.ConditionTrue, + Type: RevisionConditionBuildSucceeded, + Status: corev1.ConditionTrue, + Severity: duckv1alpha1.ConditionSeverityError, } rs.PropagateBuildStatus(duckv1alpha1.KResourceStatus{ diff --git a/pkg/reconciler/v1alpha1/clusteringress/clusteringress_test.go b/pkg/reconciler/v1alpha1/clusteringress/clusteringress_test.go index 8d7d468d4598..352f72dc30b8 100644 --- a/pkg/reconciler/v1alpha1/clusteringress/clusteringress_test.go +++ b/pkg/reconciler/v1alpha1/clusteringress/clusteringress_test.go @@ -94,14 +94,17 @@ func TestReconcile(t *testing.T) { }, }, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.ClusterIngressConditionLoadBalancerReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.ClusterIngressConditionLoadBalancerReady, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.ClusterIngressConditionNetworkConfigured, - Status: corev1.ConditionTrue, + Type: v1alpha1.ClusterIngressConditionNetworkConfigured, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.ClusterIngressConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.ClusterIngressConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, }, ), @@ -137,14 +140,17 @@ func TestReconcile(t *testing.T) { }, }, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.ClusterIngressConditionLoadBalancerReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.ClusterIngressConditionLoadBalancerReady, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.ClusterIngressConditionNetworkConfigured, - Status: corev1.ConditionTrue, + Type: v1alpha1.ClusterIngressConditionNetworkConfigured, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.ClusterIngressConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.ClusterIngressConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, }, ), diff --git a/pkg/reconciler/v1alpha1/configuration/configuration_test.go b/pkg/reconciler/v1alpha1/configuration/configuration_test.go index e11c3f50d088..5f0efd16eb99 100644 --- a/pkg/reconciler/v1alpha1/configuration/configuration_test.go +++ b/pkg/reconciler/v1alpha1/configuration/configuration_test.go @@ -79,8 +79,9 @@ func TestReconcile(t *testing.T) { LatestCreatedRevisionName: "no-revisions-yet-01234", ObservedGeneration: 1234, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.ConfigurationConditionReady, - Status: corev1.ConditionUnknown, + Type: v1alpha1.ConfigurationConditionReady, + Status: corev1.ConditionUnknown, + Severity: "Error", }}, }), }}, @@ -99,10 +100,11 @@ func TestReconcile(t *testing.T) { Object: setConcurrencyModel(cfgWithStatus("validation-failure", "foo", 1234, v1alpha1.ConfigurationStatus{ Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.ConfigurationConditionReady, - Status: corev1.ConditionFalse, - Reason: "RevisionFailed", - Message: `Revision creation failed with message: "invalid value \"Bogus\": spec.concurrencyModel".`, + Type: v1alpha1.ConfigurationConditionReady, + Status: corev1.ConditionFalse, + Reason: "RevisionFailed", + Message: `Revision creation failed with message: "invalid value \"Bogus\": spec.concurrencyModel".`, + Severity: "Error", }}, }), "Bogus"), }}, @@ -127,8 +129,9 @@ func TestReconcile(t *testing.T) { LatestCreatedRevisionName: "need-rev-and-build-99998", ObservedGeneration: 99998, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.ConfigurationConditionReady, - Status: corev1.ConditionUnknown, + Type: v1alpha1.ConfigurationConditionReady, + Status: corev1.ConditionUnknown, + Severity: "Error", }}, }, ), @@ -153,8 +156,9 @@ func TestReconcile(t *testing.T) { LatestCreatedRevisionName: "need-rev-and-build-99998", ObservedGeneration: 99998, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.ConfigurationConditionReady, - Status: corev1.ConditionUnknown, + Type: v1alpha1.ConfigurationConditionReady, + Status: corev1.ConditionUnknown, + Severity: "Error", }}, }, ), @@ -172,8 +176,9 @@ func TestReconcile(t *testing.T) { LatestCreatedRevisionName: "matching-revision-not-done-05432", ObservedGeneration: 5432, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.ConfigurationConditionReady, - Status: corev1.ConditionUnknown, + Type: v1alpha1.ConfigurationConditionReady, + Status: corev1.ConditionUnknown, + Severity: "Error", }}, }, ), @@ -192,8 +197,9 @@ func TestReconcile(t *testing.T) { LatestReadyRevisionName: "matching-revision-done-05555", ObservedGeneration: 5555, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.ConfigurationConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.ConfigurationConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, }, ), @@ -208,8 +214,9 @@ func TestReconcile(t *testing.T) { LatestReadyRevisionName: "matching-revision-done-idempotent-05566", ObservedGeneration: 5566, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.ConfigurationConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.ConfigurationConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, }, ), @@ -228,10 +235,11 @@ func TestReconcile(t *testing.T) { LatestCreatedRevisionName: "matching-revision-failed-05555", ObservedGeneration: 5555, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.ConfigurationConditionReady, - Status: corev1.ConditionFalse, - Reason: "RevisionFailed", - Message: `Revision "matching-revision-failed-05555" failed with message: "It's the end of the world as we know it".`, + Type: v1alpha1.ConfigurationConditionReady, + Status: corev1.ConditionFalse, + Reason: "RevisionFailed", + Message: `Revision "matching-revision-failed-05555" failed with message: "It's the end of the world as we know it".`, + Severity: "Error", }}, }, ), @@ -244,8 +252,9 @@ func TestReconcile(t *testing.T) { makeRevStatus(resources.MakeRevision(cfg("bad-condition", "foo", 5555), nil), v1alpha1.RevisionStatus{ Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RevisionConditionReady, - Status: "Bad", + Type: v1alpha1.RevisionConditionReady, + Status: "Bad", + Severity: "Error", }}, }, ), @@ -257,8 +266,9 @@ func TestReconcile(t *testing.T) { LatestCreatedRevisionName: "bad-condition-05555", ObservedGeneration: 5555, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.ConfigurationConditionReady, - Status: corev1.ConditionUnknown, + Type: v1alpha1.ConfigurationConditionReady, + Status: corev1.ConditionUnknown, + Severity: "Error", }}, }, ), @@ -282,10 +292,11 @@ func TestReconcile(t *testing.T) { Object: cfgWithBuildAndStatus("create-build-failure", "foo", 99998, &buildSpec, v1alpha1.ConfigurationStatus{ Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.ConfigurationConditionReady, - Status: corev1.ConditionFalse, - Reason: "RevisionFailed", - Message: `Revision creation failed with message: "inducing failure for create builds".`, + Type: v1alpha1.ConfigurationConditionReady, + Status: corev1.ConditionFalse, + Reason: "RevisionFailed", + Message: `Revision creation failed with message: "inducing failure for create builds".`, + Severity: "Error", }}, }, ), @@ -308,10 +319,11 @@ func TestReconcile(t *testing.T) { Object: cfgWithStatus("create-revision-failure", "foo", 99998, v1alpha1.ConfigurationStatus{ Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.ConfigurationConditionReady, - Status: corev1.ConditionFalse, - Reason: "RevisionFailed", - Message: `Revision creation failed with message: "inducing failure for create revisions".`, + Type: v1alpha1.ConfigurationConditionReady, + Status: corev1.ConditionFalse, + Reason: "RevisionFailed", + Message: `Revision creation failed with message: "inducing failure for create revisions".`, + Severity: "Error", }}, }, ), @@ -336,8 +348,9 @@ func TestReconcile(t *testing.T) { LatestCreatedRevisionName: "update-config-failure-01234", ObservedGeneration: 1234, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.ConfigurationConditionReady, - Status: corev1.ConditionUnknown, + Type: v1alpha1.ConfigurationConditionReady, + Status: corev1.ConditionUnknown, + Severity: "Error", }}, }, ), @@ -351,10 +364,11 @@ func TestReconcile(t *testing.T) { LatestCreatedRevisionName: "revision-recovers-01337", LatestReadyRevisionName: "revision-recovers-01337", Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.ConfigurationConditionReady, - Status: corev1.ConditionFalse, - Reason: "RevisionFailed", - Message: `Revision "revision-recovers-01337" failed with message: "Weebles wobble, but they don't fall down".`, + Type: v1alpha1.ConfigurationConditionReady, + Status: corev1.ConditionFalse, + Reason: "RevisionFailed", + Message: `Revision "revision-recovers-01337" failed with message: "Weebles wobble, but they don't fall down".`, + Severity: "Error", }}, }, ), @@ -367,8 +381,9 @@ func TestReconcile(t *testing.T) { LatestReadyRevisionName: "revision-recovers-01337", ObservedGeneration: 1337, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.ConfigurationConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.ConfigurationConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, }, ), @@ -404,8 +419,9 @@ func TestGCReconcile(t *testing.T) { LatestReadyRevisionName: "old-revision-05556", ObservedGeneration: 5556, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.ConfigurationConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.ConfigurationConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, }, ), @@ -424,8 +440,9 @@ func TestGCReconcile(t *testing.T) { LatestReadyRevisionName: "old-revision-05556", ObservedGeneration: 5556, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.ConfigurationConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.ConfigurationConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, }, ), @@ -445,8 +462,9 @@ func TestGCReconcile(t *testing.T) { LatestReadyRevisionName: "old-revision-05556", ObservedGeneration: 5556, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.ConfigurationConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.ConfigurationConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, }, ), @@ -469,8 +487,9 @@ func TestGCReconcile(t *testing.T) { LatestReadyRevisionName: "old-revision-05556", ObservedGeneration: 5556, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.ConfigurationConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.ConfigurationConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, }, ), @@ -564,8 +583,9 @@ func makeRevReady(t *testing.T, rev *v1alpha1.Revision) *v1alpha1.Revision { rev.Status.MarkActive() rev.Status.PropagateBuildStatus(duckv1alpha1.KResourceStatus{ Conditions: []duckv1alpha1.Condition{{ - Type: duckv1alpha1.ConditionSucceeded, - Status: corev1.ConditionTrue, + Type: duckv1alpha1.ConditionSucceeded, + Status: corev1.ConditionTrue, + Severity: "Error", }}, }) if !rev.Status.IsReady() { diff --git a/pkg/reconciler/v1alpha1/revision/revision_test.go b/pkg/reconciler/v1alpha1/revision/revision_test.go index 3caa6c40b55a..16cd5887ec6f 100644 --- a/pkg/reconciler/v1alpha1/revision/revision_test.go +++ b/pkg/reconciler/v1alpha1/revision/revision_test.go @@ -387,6 +387,7 @@ func TestResolutionFailed(t *testing.T) { Reason: "ContainerMissing", Message: errorMessage, LastTransitionTime: got.LastTransitionTime, + Severity: "Error", } if diff := cmp.Diff(want, got); diff != "" { t.Errorf("Unexpected revision conditions diff (-want +got): %v", diff) @@ -463,6 +464,7 @@ func TestMarkRevReadyUponEndpointBecomesReady(t *testing.T) { Status: corev1.ConditionUnknown, Reason: "Deploying", LastTransitionTime: got.LastTransitionTime, + Severity: "Error", } if diff := cmp.Diff(want, got); diff != "" { t.Errorf("Unexpected revision conditions diff (-want +got): %v", diff) @@ -489,6 +491,7 @@ func TestMarkRevReadyUponEndpointBecomesReady(t *testing.T) { Type: ct, Status: corev1.ConditionTrue, LastTransitionTime: got.LastTransitionTime, + Severity: "Error", } if diff := cmp.Diff(want, got); diff != "" { t.Errorf("Unexpected revision conditions diff (-want +got): %v", diff) diff --git a/pkg/reconciler/v1alpha1/revision/table_test.go b/pkg/reconciler/v1alpha1/revision/table_test.go index fc38b88c9b87..6484f0ad8300 100644 --- a/pkg/reconciler/v1alpha1/revision/table_test.go +++ b/pkg/reconciler/v1alpha1/revision/table_test.go @@ -48,44 +48,54 @@ import ( var ( conditionsOnFailure = duckv1alpha1.Conditions{{ - Type: "Active", - Status: "Unknown", + Type: "Active", + Status: "Unknown", + Severity: "Error", }, { - Type: "BuildSucceeded", - Status: "True", + Type: "BuildSucceeded", + Status: "True", + Severity: "Error", }, { - Type: "ContainerHealthy", - Status: "Unknown", - Reason: "Deploying", + Type: "ContainerHealthy", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", }, { - Type: "Ready", - Status: "Unknown", - Reason: "Deploying", + Type: "Ready", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", }, { - Type: "ResourcesAvailable", - Status: "Unknown", - Reason: "Deploying", + Type: "ResourcesAvailable", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", }} allUnknownConditions = duckv1alpha1.Conditions{{ - Type: "Active", - Status: "Unknown", - Reason: "Deploying", + Type: "Active", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", }, { - Type: "BuildSucceeded", - Status: "True", + Type: "BuildSucceeded", + Status: "True", + Severity: "Error", }, { - Type: "ContainerHealthy", - Status: "Unknown", - Reason: "Deploying", + Type: "ContainerHealthy", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", }, { - Type: "Ready", - Status: "Unknown", - Reason: "Deploying", + Type: "Ready", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", }, { - Type: "ResourcesAvailable", - Status: "Unknown", - Reason: "Deploying", + Type: "ResourcesAvailable", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", }} ) @@ -351,26 +361,31 @@ func TestReconcile(t *testing.T) { ServiceName: svc("foo", "endpoint-created-not-ready", "busybox").Name, LogURL: "http://logger.io/test-uid", Conditions: duckv1alpha1.Conditions{{ - Type: "Active", - Status: "Unknown", - Reason: "Deploying", + Type: "Active", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", }, { - Type: "BuildSucceeded", - Status: "True", + Type: "BuildSucceeded", + Status: "True", + Severity: "Error", }, { - Type: "ResourcesAvailable", - Status: "Unknown", - Reason: "Deploying", + Type: "ResourcesAvailable", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", }, { - Type: "ContainerHealthy", - Status: "Unknown", - Reason: "Deploying", + Type: "ContainerHealthy", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", }, { Type: "Ready", Status: "Unknown", Reason: "Deploying", // We set the LTT so that we don't give up on the Endpoints yet. LastTransitionTime: apis.VolatileTime{metav1.NewTime(time.Now())}, + Severity: "Error", }}, }), kpa("foo", "endpoint-created-not-ready", "busybox"), @@ -394,24 +409,29 @@ func TestReconcile(t *testing.T) { ServiceName: svc("foo", "endpoint-created-timeout", "busybox").Name, LogURL: "http://logger.io/test-uid", Conditions: duckv1alpha1.Conditions{{ - Type: "Active", - Status: "Unknown", - Reason: "Deploying", - }, { - Type: "BuildSucceeded", - Status: "True", - }, { - Type: "ResourcesAvailable", - Status: "Unknown", - Reason: "Deploying", - }, { - Type: "ContainerHealthy", - Status: "Unknown", - Reason: "Deploying", - }, { - Type: "Ready", - Status: "Unknown", - Reason: "Deploying", + Type: "Active", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", + }, { + Type: "BuildSucceeded", + Status: "True", + Severity: "Error", + }, { + Type: "ResourcesAvailable", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", + }, { + Type: "ContainerHealthy", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", + }, { + Type: "Ready", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", // The LTT defaults and is long enough ago that we expire waiting // on the Endpoints to become ready. }}, @@ -429,26 +449,31 @@ func TestReconcile(t *testing.T) { ServiceName: svc("foo", "endpoint-created-timeout", "busybox").Name, LogURL: "http://logger.io/test-uid", Conditions: duckv1alpha1.Conditions{{ - Type: "Active", - Status: "Unknown", - Reason: "Deploying", - }, { - Type: "BuildSucceeded", - Status: "True", - }, { - Type: "ContainerHealthy", - Status: "Unknown", - Reason: "Deploying", - }, { - Type: "Ready", - Status: "False", - Reason: "ServiceTimeout", - Message: "Timed out waiting for a service endpoint to become ready", - }, { - Type: "ResourcesAvailable", - Status: "False", - Reason: "ServiceTimeout", - Message: "Timed out waiting for a service endpoint to become ready", + Type: "Active", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", + }, { + Type: "BuildSucceeded", + Status: "True", + Severity: "Error", + }, { + Type: "ContainerHealthy", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", + }, { + Type: "Ready", + Status: "False", + Reason: "ServiceTimeout", + Message: "Timed out waiting for a service endpoint to become ready", + Severity: "Error", + }, { + Type: "ResourcesAvailable", + Status: "False", + Reason: "ServiceTimeout", + Message: "Timed out waiting for a service endpoint to become ready", + Severity: "Error", }}, }), }}, @@ -467,35 +492,42 @@ func TestReconcile(t *testing.T) { ServiceName: svc("foo", "endpoint-ready", "busybox").Name, LogURL: "http://logger.io/test-uid", Conditions: duckv1alpha1.Conditions{{ - Type: "Active", - Status: "Unknown", - Reason: "Deploying", - }, { - Type: "BuildSucceeded", - Status: "True", - }, { - Type: "ResourcesAvailable", - Status: "Unknown", - Reason: "Deploying", - }, { - Type: "ContainerHealthy", - Status: "Unknown", - Reason: "Deploying", - }, { - Type: "Ready", - Status: "Unknown", - Reason: "Deploying", + Type: "Active", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", + }, { + Type: "BuildSucceeded", + Status: "True", + Severity: "Error", + }, { + Type: "ResourcesAvailable", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", + }, { + Type: "ContainerHealthy", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", + }, { + Type: "Ready", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", }}, }), addKPAStatus( kpa("foo", "endpoint-ready", "busybox"), kpav1alpha1.PodAutoscalerStatus{ Conditions: duckv1alpha1.Conditions{{ - Type: "Active", - Status: "True", + Type: "Active", + Status: "True", + Severity: "Error", }, { - Type: "Ready", - Status: "True", + Type: "Ready", + Status: "True", + Severity: "Error", }}, }), deploy("foo", "endpoint-ready", "busybox"), @@ -510,20 +542,25 @@ func TestReconcile(t *testing.T) { ServiceName: svc("foo", "endpoint-ready", "busybox").Name, LogURL: "http://logger.io/test-uid", Conditions: duckv1alpha1.Conditions{{ - Type: "Active", - Status: "True", + Type: "Active", + Status: "True", + Severity: "Error", }, { - Type: "BuildSucceeded", - Status: "True", + Type: "BuildSucceeded", + Status: "True", + Severity: "Error", }, { - Type: "ContainerHealthy", - Status: "True", + Type: "ContainerHealthy", + Status: "True", + Severity: "Error", }, { - Type: "Ready", - Status: "True", + Type: "Ready", + Status: "True", + Severity: "Error", }, { - Type: "ResourcesAvailable", - Status: "True", + Type: "ResourcesAvailable", + Status: "True", + Severity: "Error", }}, }), }}, @@ -539,36 +576,43 @@ func TestReconcile(t *testing.T) { ServiceName: svc("foo", "kpa-not-ready", "busybox").Name, LogURL: "http://logger.io/test-uid", Conditions: duckv1alpha1.Conditions{{ - Type: "Active", - Status: "Unknown", - Reason: "Deploying", - }, { - Type: "BuildSucceeded", - Status: "True", - }, { - Type: "ResourcesAvailable", - Status: "True", - }, { - Type: "ContainerHealthy", - Status: "True", - }, { - Type: "Ready", - Status: "True", + Type: "Active", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", + }, { + Type: "BuildSucceeded", + Status: "True", + Severity: "Error", + }, { + Type: "ResourcesAvailable", + Status: "True", + Severity: "Error", + }, { + Type: "ContainerHealthy", + Status: "True", + Severity: "Error", + }, { + Type: "Ready", + Status: "True", + Severity: "Error", }}, }), addKPAStatus( kpa("foo", "kpa-not-ready", "busybox"), kpav1alpha1.PodAutoscalerStatus{ Conditions: duckv1alpha1.Conditions{{ - Type: "Active", - Status: "Unknown", - Reason: "Something", - Message: "This is something longer", - }, { - Type: "Ready", - Status: "Unknown", - Reason: "Something", - Message: "This is something longer", + Type: "Active", + Status: "Unknown", + Reason: "Something", + Message: "This is something longer", + Severity: "Error", + }, { + Type: "Ready", + Status: "Unknown", + Reason: "Something", + Message: "This is something longer", + Severity: "Error", }}, }), deploy("foo", "kpa-not-ready", "busybox"), @@ -583,24 +627,29 @@ func TestReconcile(t *testing.T) { ServiceName: svc("foo", "kpa-not-ready", "busybox").Name, LogURL: "http://logger.io/test-uid", Conditions: duckv1alpha1.Conditions{{ - Type: "Active", - Status: "Unknown", - Reason: "Something", - Message: "This is something longer", - }, { - Type: "BuildSucceeded", - Status: "True", - }, { - Type: "ContainerHealthy", - Status: "True", - }, { - Type: "Ready", - Status: "Unknown", - Reason: "Something", - Message: "This is something longer", - }, { - Type: "ResourcesAvailable", - Status: "True", + Type: "Active", + Status: "Unknown", + Reason: "Something", + Message: "This is something longer", + Severity: "Error", + }, { + Type: "BuildSucceeded", + Status: "True", + Severity: "Error", + }, { + Type: "ContainerHealthy", + Status: "True", + Severity: "Error", + }, { + Type: "Ready", + Status: "Unknown", + Reason: "Something", + Message: "This is something longer", + Severity: "Error", + }, { + Type: "ResourcesAvailable", + Status: "True", + Severity: "Error", }}, }), }}, @@ -615,36 +664,43 @@ func TestReconcile(t *testing.T) { ServiceName: svc("foo", "kpa-inactive", "busybox").Name, LogURL: "http://logger.io/test-uid", Conditions: duckv1alpha1.Conditions{{ - Type: "Active", - Status: "Unknown", - Reason: "Deploying", - }, { - Type: "BuildSucceeded", - Status: "True", - }, { - Type: "ResourcesAvailable", - Status: "True", - }, { - Type: "ContainerHealthy", - Status: "True", - }, { - Type: "Ready", - Status: "True", + Type: "Active", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", + }, { + Type: "BuildSucceeded", + Status: "True", + Severity: "Error", + }, { + Type: "ResourcesAvailable", + Status: "True", + Severity: "Error", + }, { + Type: "ContainerHealthy", + Status: "True", + Severity: "Error", + }, { + Type: "Ready", + Status: "True", + Severity: "Error", }}, }), addKPAStatus( kpa("foo", "kpa-inactive", "busybox"), kpav1alpha1.PodAutoscalerStatus{ Conditions: duckv1alpha1.Conditions{{ - Type: "Active", - Status: "False", - Reason: "NoTraffic", - Message: "This thing is inactive.", - }, { - Type: "Ready", - Status: "False", - Reason: "NoTraffic", - Message: "This thing is inactive.", + Type: "Active", + Status: "False", + Reason: "NoTraffic", + Message: "This thing is inactive.", + Severity: "Error", + }, { + Type: "Ready", + Status: "False", + Reason: "NoTraffic", + Message: "This thing is inactive.", + Severity: "Error", }}, }), deploy("foo", "kpa-inactive", "busybox"), @@ -658,26 +714,31 @@ func TestReconcile(t *testing.T) { ServiceName: svc("foo", "kpa-inactive", "busybox").Name, LogURL: "http://logger.io/test-uid", Conditions: duckv1alpha1.Conditions{{ - Type: "Active", - Status: "False", - Reason: "NoTraffic", - Message: "This thing is inactive.", - }, { - Type: "BuildSucceeded", - Status: "True", - }, { - Type: "ContainerHealthy", - Status: "Unknown", - Reason: "Deploying", - }, { - Type: "Ready", - Status: "False", - Reason: "NoTraffic", - Message: "This thing is inactive.", - }, { - Type: "ResourcesAvailable", - Status: "Unknown", - Reason: "Deploying", + Type: "Active", + Status: "False", + Reason: "NoTraffic", + Message: "This thing is inactive.", + Severity: "Error", + }, { + Type: "BuildSucceeded", + Status: "True", + Severity: "Error", + }, { + Type: "ContainerHealthy", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", + }, { + Type: "Ready", + Status: "False", + Reason: "NoTraffic", + Message: "This thing is inactive.", + Severity: "Error", + }, { + Type: "ResourcesAvailable", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", }}, }), }}, @@ -696,22 +757,26 @@ func TestReconcile(t *testing.T) { ServiceName: svc("foo", "fix-mutated-service", "busybox").Name, LogURL: "http://logger.io/test-uid", Conditions: duckv1alpha1.Conditions{{ - Type: "ResourcesAvailable", - Status: "Unknown", - Reason: "Deploying", + Type: "ResourcesAvailable", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", }, { - Type: "BuildSucceeded", - Status: "True", + Type: "BuildSucceeded", + Status: "True", + Severity: "Error", }, { - Type: "ContainerHealthy", - Status: "Unknown", - Reason: "Deploying", + Type: "ContainerHealthy", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", }, { Type: "Ready", Status: "Unknown", Reason: "Deploying", // We set the LTT so that we don't give up on the Endpoints yet. LastTransitionTime: apis.VolatileTime{metav1.NewTime(time.Now())}, + Severity: "Error", }}, }), kpa("foo", "fix-mutated-service", "busybox"), @@ -728,24 +793,29 @@ func TestReconcile(t *testing.T) { ServiceName: svc("foo", "fix-mutated-service", "busybox").Name, LogURL: "http://logger.io/test-uid", Conditions: duckv1alpha1.Conditions{{ - Type: "Active", - Status: "Unknown", - Reason: "Deploying", - }, { - Type: "BuildSucceeded", - Status: "True", - }, { - Type: "ContainerHealthy", - Status: "Unknown", - Reason: "Updating", - }, { - Type: "Ready", - Status: "Unknown", - Reason: "Deploying", - }, { - Type: "ResourcesAvailable", - Status: "Unknown", - Reason: "Updating", + Type: "Active", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", + }, { + Type: "BuildSucceeded", + Status: "True", + Severity: "Error", + }, { + Type: "ContainerHealthy", + Status: "Unknown", + Reason: "Updating", + Severity: "Error", + }, { + Type: "Ready", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", + }, { + Type: "ResourcesAvailable", + Status: "Unknown", + Reason: "Updating", + Severity: "Error", }}, }), }, { @@ -766,25 +836,30 @@ func TestReconcile(t *testing.T) { ServiceName: svc("foo", "update-user-svc-failure", "busybox").Name, LogURL: "http://logger.io/test-uid", Conditions: duckv1alpha1.Conditions{{ - Type: "Active", - Status: "Unknown", + Type: "Active", + Status: "Unknown", + Severity: "Error", }, { - Type: "BuildSucceeded", - Status: "True", + Type: "BuildSucceeded", + Status: "True", + Severity: "Error", }, { - Type: "ResourcesAvailable", - Status: "Unknown", - Reason: "Deploying", + Type: "ResourcesAvailable", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", }, { - Type: "ContainerHealthy", - Status: "Unknown", - Reason: "Deploying", + Type: "ContainerHealthy", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", }, { Type: "Ready", Status: "Unknown", Reason: "Deploying", // We set the LTT so that we don't give up on the Endpoints yet. LastTransitionTime: apis.VolatileTime{metav1.NewTime(time.Now())}, + Severity: "Error", }}, }), kpa("foo", "update-user-svc-failure", "busybox"), @@ -811,19 +886,22 @@ func TestReconcile(t *testing.T) { ServiceName: svc("foo", "deploy-timeout", "busybox").Name, LogURL: "http://logger.io/test-uid", Conditions: duckv1alpha1.Conditions{{ - Type: "ResourcesAvailable", - Status: "Unknown", - Reason: "Deploying", + Type: "ResourcesAvailable", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", }, { - Type: "ContainerHealthy", - Status: "Unknown", - Reason: "Deploying", + Type: "ContainerHealthy", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", }, { Type: "Ready", Status: "Unknown", Reason: "Deploying", // We set the LTT so that we don't give up on the Endpoints yet. LastTransitionTime: apis.VolatileTime{metav1.NewTime(time.Now())}, + Severity: "Error", }}, }), kpa("foo", "deploy-timeout", "busybox"), @@ -839,26 +917,31 @@ func TestReconcile(t *testing.T) { ServiceName: svc("foo", "deploy-timeout", "busybox").Name, LogURL: "http://logger.io/test-uid", Conditions: duckv1alpha1.Conditions{{ - Type: "Active", - Status: "Unknown", - Reason: "Deploying", - }, { - Type: "BuildSucceeded", - Status: "True", - }, { - Type: "ContainerHealthy", - Status: "Unknown", - Reason: "Deploying", - }, { - Type: "Ready", - Status: "False", - Reason: "ProgressDeadlineExceeded", - Message: "Unable to create pods for more than 120 seconds.", - }, { - Type: "ResourcesAvailable", - Status: "False", - Reason: "ProgressDeadlineExceeded", - Message: "Unable to create pods for more than 120 seconds.", + Type: "Active", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", + }, { + Type: "BuildSucceeded", + Status: "True", + Severity: "Error", + }, { + Type: "ContainerHealthy", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", + }, { + Type: "Ready", + Status: "False", + Reason: "ProgressDeadlineExceeded", + Message: "Unable to create pods for more than 120 seconds.", + Severity: "Error", + }, { + Type: "ResourcesAvailable", + Status: "False", + Reason: "ProgressDeadlineExceeded", + Message: "Unable to create pods for more than 120 seconds.", + Severity: "Error", }}, }), }}, @@ -880,20 +963,25 @@ func TestReconcile(t *testing.T) { v1alpha1.RevisionStatus{ LogURL: "http://logger.io/test-uid", Conditions: duckv1alpha1.Conditions{{ - Type: "Active", - Status: "Unknown", + Type: "Active", + Status: "Unknown", + Severity: "Error", }, { - Type: "BuildSucceeded", - Status: "Unknown", + Type: "BuildSucceeded", + Status: "Unknown", + Severity: "Error", }, { - Type: "ContainerHealthy", - Status: "Unknown", + Type: "ContainerHealthy", + Status: "Unknown", + Severity: "Error", }, { - Type: "Ready", - Status: "Unknown", + Type: "Ready", + Status: "Unknown", + Severity: "Error", }, { - Type: "ResourcesAvailable", - Status: "Unknown", + Type: "ResourcesAvailable", + Status: "Unknown", + Severity: "Error", }}, }), }}, @@ -919,22 +1007,27 @@ func TestReconcile(t *testing.T) { v1alpha1.RevisionStatus{ LogURL: "http://logger.io/test-uid", Conditions: duckv1alpha1.Conditions{{ - Type: "Active", - Status: "Unknown", - }, { - Type: "BuildSucceeded", - Status: "Unknown", - Reason: "Building", - }, { - Type: "ContainerHealthy", - Status: "Unknown", - }, { - Type: "Ready", - Status: "Unknown", - Reason: "Building", - }, { - Type: "ResourcesAvailable", - Status: "Unknown", + Type: "Active", + Status: "Unknown", + Severity: "Error", + }, { + Type: "BuildSucceeded", + Status: "Unknown", + Reason: "Building", + Severity: "Error", + }, { + Type: "ContainerHealthy", + Status: "Unknown", + Severity: "Error", + }, { + Type: "Ready", + Status: "Unknown", + Reason: "Building", + Severity: "Error", + }, { + Type: "ResourcesAvailable", + Status: "Unknown", + Severity: "Error", }}, }), }}, @@ -952,17 +1045,21 @@ func TestReconcile(t *testing.T) { v1alpha1.RevisionStatus{ LogURL: "http://logger.io/test-uid", Conditions: duckv1alpha1.Conditions{{ - Type: "BuildSucceeded", - Status: "Unknown", + Type: "BuildSucceeded", + Status: "Unknown", + Severity: "Error", }, { - Type: "ContainerHealthy", - Status: "Unknown", + Type: "ContainerHealthy", + Status: "Unknown", + Severity: "Error", }, { - Type: "Ready", - Status: "Unknown", + Type: "Ready", + Status: "Unknown", + Severity: "Error", }, { - Type: "ResourcesAvailable", - Status: "Unknown", + Type: "ResourcesAvailable", + Status: "Unknown", + Severity: "Error", }}, }), build("foo", "the-build", duckv1alpha1.Condition{ @@ -984,24 +1081,29 @@ func TestReconcile(t *testing.T) { ServiceName: svc("foo", "done-build", "busybox").Name, LogURL: "http://logger.io/test-uid", Conditions: duckv1alpha1.Conditions{{ - Type: "Active", - Status: "Unknown", - Reason: "Deploying", - }, { - Type: "BuildSucceeded", - Status: "True", - }, { - Type: "ContainerHealthy", - Status: "Unknown", - Reason: "Deploying", - }, { - Type: "Ready", - Status: "Unknown", - Reason: "Deploying", - }, { - Type: "ResourcesAvailable", - Status: "Unknown", - Reason: "Deploying", + Type: "Active", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", + }, { + Type: "BuildSucceeded", + Status: "True", + Severity: "Error", + }, { + Type: "ContainerHealthy", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", + }, { + Type: "Ready", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", + }, { + Type: "ResourcesAvailable", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", }}, }), }}, @@ -1019,24 +1121,29 @@ func TestReconcile(t *testing.T) { ServiceName: svc("foo", "stable-reconcile-with-build", "busybox").Name, LogURL: "http://logger.io/test-uid", Conditions: duckv1alpha1.Conditions{{ - Type: "Active", - Status: "Unknown", - Reason: "Deploying", - }, { - Type: "BuildSucceeded", - Status: "True", - }, { - Type: "ContainerHealthy", - Status: "Unknown", - Reason: "Deploying", - }, { - Type: "Ready", - Status: "Unknown", - Reason: "Deploying", - }, { - Type: "ResourcesAvailable", - Status: "Unknown", - Reason: "Deploying", + Type: "Active", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", + }, { + Type: "BuildSucceeded", + Status: "True", + Severity: "Error", + }, { + Type: "ContainerHealthy", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", + }, { + Type: "Ready", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", + }, { + Type: "ResourcesAvailable", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", }}, }), kpa("foo", "stable-reconcile-with-build", "busybox"), @@ -1062,17 +1169,21 @@ func TestReconcile(t *testing.T) { v1alpha1.RevisionStatus{ LogURL: "http://logger.io/test-uid", Conditions: duckv1alpha1.Conditions{{ - Type: "BuildSucceeded", - Status: "Unknown", + Type: "BuildSucceeded", + Status: "Unknown", + Severity: "Error", }, { - Type: "ContainerHealthy", - Status: "Unknown", + Type: "ContainerHealthy", + Status: "Unknown", + Severity: "Error", }, { - Type: "Ready", - Status: "Unknown", + Type: "Ready", + Status: "Unknown", + Severity: "Error", }, { - Type: "ResourcesAvailable", - Status: "Unknown", + Type: "ResourcesAvailable", + Status: "Unknown", + Severity: "Error", }}, }), build("foo", "the-build", duckv1alpha1.Condition{ @@ -1088,24 +1199,29 @@ func TestReconcile(t *testing.T) { v1alpha1.RevisionStatus{ LogURL: "http://logger.io/test-uid", Conditions: duckv1alpha1.Conditions{{ - Type: "Active", - Status: "Unknown", - }, { - Type: "BuildSucceeded", - Status: "False", - Reason: "SomeReason", - Message: "This is why the build failed.", - }, { - Type: "ContainerHealthy", - Status: "Unknown", - }, { - Type: "Ready", - Status: "False", - Reason: "SomeReason", - Message: "This is why the build failed.", - }, { - Type: "ResourcesAvailable", - Status: "Unknown", + Type: "Active", + Status: "Unknown", + Severity: "Error", + }, { + Type: "BuildSucceeded", + Status: "False", + Reason: "SomeReason", + Message: "This is why the build failed.", + Severity: "Error", + }, { + Type: "ContainerHealthy", + Status: "Unknown", + Severity: "Error", + }, { + Type: "Ready", + Status: "False", + Reason: "SomeReason", + Message: "This is why the build failed.", + Severity: "Error", + }, { + Type: "ResourcesAvailable", + Status: "Unknown", + Severity: "Error", }}, }), }}, @@ -1122,24 +1238,29 @@ func TestReconcile(t *testing.T) { v1alpha1.RevisionStatus{ LogURL: "http://logger.io/test-uid", Conditions: duckv1alpha1.Conditions{{ - Type: "Active", - Status: "Unknown", - }, { - Type: "ResourcesAvailable", - Status: "Unknown", - }, { - Type: "ContainerHealthy", - Status: "Unknown", - }, { - Type: "BuildSucceeded", - Status: "False", - Reason: "SomeReason", - Message: "This is why the build failed.", - }, { - Type: "Ready", - Status: "False", - Reason: "SomeReason", - Message: "This is why the build failed.", + Type: "Active", + Status: "Unknown", + Severity: "Error", + }, { + Type: "ResourcesAvailable", + Status: "Unknown", + Severity: "Error", + }, { + Type: "ContainerHealthy", + Status: "Unknown", + Severity: "Error", + }, { + Type: "BuildSucceeded", + Status: "False", + Reason: "SomeReason", + Message: "This is why the build failed.", + Severity: "Error", + }, { + Type: "Ready", + Status: "False", + Reason: "SomeReason", + Message: "This is why the build failed.", + Severity: "Error", }}, }), build("foo", "the-build", duckv1alpha1.Condition{ @@ -1252,23 +1373,28 @@ func TestReconcileWithVarLogEnabled(t *testing.T) { ServiceName: svc("foo", "create-configmap-failure", "busybox").Name, LogURL: "http://logger.io/test-uid", Conditions: duckv1alpha1.Conditions{{ - Type: "Active", - Status: "Unknown", - }, { - Type: "BuildSucceeded", - Status: "True", - }, { - Type: "ContainerHealthy", - Status: "Unknown", - Reason: "Deploying", - }, { - Type: "Ready", - Status: "Unknown", - Reason: "Deploying", - }, { - Type: "ResourcesAvailable", - Status: "Unknown", - Reason: "Deploying", + Type: "Active", + Status: "Unknown", + Severity: "Error", + }, { + Type: "BuildSucceeded", + Status: "True", + Severity: "Error", + }, { + Type: "ContainerHealthy", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", + }, { + Type: "Ready", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", + }, { + Type: "ResourcesAvailable", + Status: "Unknown", + Reason: "Deploying", + Severity: "Error", }}, }), }}, diff --git a/pkg/reconciler/v1alpha1/route/table_test.go b/pkg/reconciler/v1alpha1/route/table_test.go index d8fa3bf21dcb..d28af3e2a4e3 100644 --- a/pkg/reconciler/v1alpha1/route/table_test.go +++ b/pkg/reconciler/v1alpha1/route/table_test.go @@ -65,18 +65,21 @@ func TestReconcile(t *testing.T) { WantUpdates: []clientgotesting.UpdateActionImpl{{ Object: simpleRunLatest("default", "first-reconcile", "not-ready", &v1alpha1.RouteStatus{ Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionAllTrafficAssigned, - Status: corev1.ConditionUnknown, - Reason: "RevisionMissing", - Message: `Configuration "not-ready" is waiting for a Revision to become ready.`, + Type: v1alpha1.RouteConditionAllTrafficAssigned, + Status: corev1.ConditionUnknown, + Reason: "RevisionMissing", + Message: `Configuration "not-ready" is waiting for a Revision to become ready.`, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionIngressReady, - Status: corev1.ConditionUnknown, + Type: v1alpha1.RouteConditionIngressReady, + Status: corev1.ConditionUnknown, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionUnknown, - Reason: "RevisionMissing", - Message: `Configuration "not-ready" is waiting for a Revision to become ready.`, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionUnknown, + Reason: "RevisionMissing", + Message: `Configuration "not-ready" is waiting for a Revision to become ready.`, + Severity: "Error", }}, }), }}, @@ -94,18 +97,21 @@ func TestReconcile(t *testing.T) { WantUpdates: []clientgotesting.UpdateActionImpl{{ Object: simpleRunLatest("default", "first-reconcile", "permanently-failed", &v1alpha1.RouteStatus{ Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionAllTrafficAssigned, - Status: corev1.ConditionFalse, - Reason: "RevisionMissing", - Message: `Configuration "permanently-failed" does not have any ready Revision.`, + Type: v1alpha1.RouteConditionAllTrafficAssigned, + Status: corev1.ConditionFalse, + Reason: "RevisionMissing", + Message: `Configuration "permanently-failed" does not have any ready Revision.`, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionIngressReady, - Status: corev1.ConditionUnknown, + Type: v1alpha1.RouteConditionIngressReady, + Status: corev1.ConditionUnknown, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionFalse, - Reason: "RevisionMissing", - Message: `Configuration "permanently-failed" does not have any ready Revision.`, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionFalse, + Reason: "RevisionMissing", + Message: `Configuration "permanently-failed" does not have any ready Revision.`, + Severity: "Error", }}, }), }}, @@ -127,18 +133,21 @@ func TestReconcile(t *testing.T) { WantUpdates: []clientgotesting.UpdateActionImpl{{ Object: simpleRunLatest("default", "first-reconcile", "not-ready", &v1alpha1.RouteStatus{ Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionAllTrafficAssigned, - Status: corev1.ConditionUnknown, - Reason: "RevisionMissing", - Message: `Configuration "not-ready" is waiting for a Revision to become ready.`, + Type: v1alpha1.RouteConditionAllTrafficAssigned, + Status: corev1.ConditionUnknown, + Reason: "RevisionMissing", + Message: `Configuration "not-ready" is waiting for a Revision to become ready.`, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionIngressReady, - Status: corev1.ConditionUnknown, + Type: v1alpha1.RouteConditionIngressReady, + Status: corev1.ConditionUnknown, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionUnknown, - Reason: "RevisionMissing", - Message: `Configuration "not-ready" is waiting for a Revision to become ready.`, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionUnknown, + Reason: "RevisionMissing", + Message: `Configuration "not-ready" is waiting for a Revision to become ready.`, + Severity: "Error", }}, }), }}, @@ -176,14 +185,17 @@ func TestReconcile(t *testing.T) { DomainInternal: "becomes-ready.default.svc.cluster.local", Address: &duckv1alpha1.Addressable{Hostname: "becomes-ready.default.svc.cluster.local"}, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionAllTrafficAssigned, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionAllTrafficAssigned, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionIngressReady, - Status: corev1.ConditionUnknown, + Type: v1alpha1.RouteConditionIngressReady, + Status: corev1.ConditionUnknown, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionUnknown, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionUnknown, + Severity: "Error", }}, Traffic: []v1alpha1.TrafficTarget{{ RevisionName: "config-00001", @@ -228,14 +240,17 @@ func TestReconcile(t *testing.T) { DomainInternal: "becomes-ready.default.svc.cluster.local", Address: &duckv1alpha1.Addressable{Hostname: "becomes-ready.default.svc.cluster.local"}, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionAllTrafficAssigned, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionAllTrafficAssigned, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionIngressReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionIngressReady, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, Traffic: []v1alpha1.TrafficTarget{{ RevisionName: "config-00001", @@ -283,14 +298,17 @@ func TestReconcile(t *testing.T) { DomainInternal: "create-svc-failure.default.svc.cluster.local", Address: &duckv1alpha1.Addressable{Hostname: "create-svc-failure.default.svc.cluster.local"}, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionAllTrafficAssigned, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionAllTrafficAssigned, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionIngressReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionIngressReady, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, Traffic: []v1alpha1.TrafficTarget{{ RevisionName: "config-00001", @@ -338,14 +356,17 @@ func TestReconcile(t *testing.T) { DomainInternal: "ingress-create-failure.default.svc.cluster.local", Address: &duckv1alpha1.Addressable{Hostname: "ingress-create-failure.default.svc.cluster.local"}, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionAllTrafficAssigned, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionAllTrafficAssigned, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionIngressReady, - Status: corev1.ConditionUnknown, + Type: v1alpha1.RouteConditionIngressReady, + Status: corev1.ConditionUnknown, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionUnknown, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionUnknown, + Severity: "Error", }}, Traffic: []v1alpha1.TrafficTarget{{ RevisionName: "config-00001", @@ -363,14 +384,17 @@ func TestReconcile(t *testing.T) { DomainInternal: "steady-state.default.svc.cluster.local", Address: &duckv1alpha1.Addressable{Hostname: "steady-state.default.svc.cluster.local"}, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionAllTrafficAssigned, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionAllTrafficAssigned, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionIngressReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionIngressReady, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, Traffic: []v1alpha1.TrafficTarget{{ RevisionName: "config-00001", @@ -416,14 +440,17 @@ func TestReconcile(t *testing.T) { DomainInternal: "different-domain.default.svc.cluster.local", Address: &duckv1alpha1.Addressable{Hostname: "different-domain.default.svc.cluster.local"}, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionAllTrafficAssigned, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionAllTrafficAssigned, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionIngressReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionIngressReady, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, Traffic: []v1alpha1.TrafficTarget{{ RevisionName: "config-00001", @@ -467,14 +494,17 @@ func TestReconcile(t *testing.T) { DomainInternal: "new-latest-created.default.svc.cluster.local", Address: &duckv1alpha1.Addressable{Hostname: "new-latest-created.default.svc.cluster.local"}, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionAllTrafficAssigned, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionAllTrafficAssigned, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionIngressReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionIngressReady, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, Traffic: []v1alpha1.TrafficTarget{{ RevisionName: "config-00001", @@ -522,14 +552,17 @@ func TestReconcile(t *testing.T) { DomainInternal: "new-latest-ready.default.svc.cluster.local", Address: &duckv1alpha1.Addressable{Hostname: "new-latest-ready.default.svc.cluster.local"}, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionAllTrafficAssigned, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionAllTrafficAssigned, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionIngressReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionIngressReady, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, Traffic: []v1alpha1.TrafficTarget{{ ConfigurationName: "config", @@ -591,14 +624,17 @@ func TestReconcile(t *testing.T) { DomainInternal: "new-latest-ready.default.svc.cluster.local", Address: &duckv1alpha1.Addressable{Hostname: "new-latest-ready.default.svc.cluster.local"}, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionAllTrafficAssigned, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionAllTrafficAssigned, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionIngressReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionIngressReady, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, Traffic: []v1alpha1.TrafficTarget{{ RevisionName: "config-00002", @@ -621,14 +657,17 @@ func TestReconcile(t *testing.T) { DomainInternal: "update-ci-failure.default.svc.cluster.local", Address: &duckv1alpha1.Addressable{Hostname: "update-ci-failure.default.svc.cluster.local"}, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionAllTrafficAssigned, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionAllTrafficAssigned, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionIngressReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionIngressReady, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, Traffic: []v1alpha1.TrafficTarget{{ RevisionName: "config-00001", @@ -688,14 +727,17 @@ func TestReconcile(t *testing.T) { DomainInternal: "update-ci-failure.default.svc.cluster.local", Address: &duckv1alpha1.Addressable{Hostname: "update-ci-failure.default.svc.cluster.local"}, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionAllTrafficAssigned, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionAllTrafficAssigned, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionIngressReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionIngressReady, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, Traffic: []v1alpha1.TrafficTarget{{ RevisionName: "config-00002", @@ -713,14 +755,17 @@ func TestReconcile(t *testing.T) { DomainInternal: "svc-mutation.default.svc.cluster.local", Address: &duckv1alpha1.Addressable{Hostname: "svc-mutation.default.svc.cluster.local"}, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionAllTrafficAssigned, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionAllTrafficAssigned, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionIngressReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionIngressReady, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, Traffic: []v1alpha1.TrafficTarget{{ RevisionName: "config-00001", @@ -770,14 +815,17 @@ func TestReconcile(t *testing.T) { DomainInternal: "svc-mutation.default.svc.cluster.local", Address: &duckv1alpha1.Addressable{Hostname: "svc-mutation.default.svc.cluster.local"}, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionAllTrafficAssigned, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionAllTrafficAssigned, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionIngressReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionIngressReady, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, Traffic: []v1alpha1.TrafficTarget{{ RevisionName: "config-00001", @@ -825,14 +873,17 @@ func TestReconcile(t *testing.T) { DomainInternal: "cluster-ip.default.svc.cluster.local", Address: &duckv1alpha1.Addressable{Hostname: "cluster-ip.default.svc.cluster.local"}, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionAllTrafficAssigned, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionAllTrafficAssigned, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionIngressReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionIngressReady, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, Traffic: []v1alpha1.TrafficTarget{{ RevisionName: "config-00001", @@ -878,14 +929,17 @@ func TestReconcile(t *testing.T) { DomainInternal: "external-name.default.svc.cluster.local", Address: &duckv1alpha1.Addressable{Hostname: "external-name.default.svc.cluster.local"}, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionAllTrafficAssigned, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionAllTrafficAssigned, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionIngressReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionIngressReady, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, Traffic: []v1alpha1.TrafficTarget{{ RevisionName: "config-00001", @@ -930,14 +984,17 @@ func TestReconcile(t *testing.T) { DomainInternal: "ingress-mutation.default.svc.cluster.local", Address: &duckv1alpha1.Addressable{Hostname: "ingress-mutation.default.svc.cluster.local"}, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionAllTrafficAssigned, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionAllTrafficAssigned, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionIngressReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionIngressReady, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, Traffic: []v1alpha1.TrafficTarget{{ RevisionName: "config-00001", @@ -998,14 +1055,17 @@ func TestReconcile(t *testing.T) { DomainInternal: "change-configs.default.svc.cluster.local", Address: &duckv1alpha1.Addressable{Hostname: "change-configs.default.svc.cluster.local"}, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionAllTrafficAssigned, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionAllTrafficAssigned, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionIngressReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionIngressReady, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, Traffic: []v1alpha1.TrafficTarget{{ ConfigurationName: "oldconfig", @@ -1069,14 +1129,17 @@ func TestReconcile(t *testing.T) { DomainInternal: "change-configs.default.svc.cluster.local", Address: &duckv1alpha1.Addressable{Hostname: "change-configs.default.svc.cluster.local"}, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionAllTrafficAssigned, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionAllTrafficAssigned, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionIngressReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionIngressReady, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, Traffic: []v1alpha1.TrafficTarget{{ RevisionName: "newconfig-00001", @@ -1093,18 +1156,21 @@ func TestReconcile(t *testing.T) { WantUpdates: []clientgotesting.UpdateActionImpl{{ Object: simpleRunLatest("default", "config-missing", "not-found", &v1alpha1.RouteStatus{ Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionAllTrafficAssigned, - Status: corev1.ConditionFalse, - Reason: "ConfigurationMissing", - Message: `Configuration "not-found" referenced in traffic not found.`, + Type: v1alpha1.RouteConditionAllTrafficAssigned, + Status: corev1.ConditionFalse, + Reason: "ConfigurationMissing", + Message: `Configuration "not-found" referenced in traffic not found.`, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionIngressReady, - Status: corev1.ConditionUnknown, + Type: v1alpha1.RouteConditionIngressReady, + Status: corev1.ConditionUnknown, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionFalse, - Reason: "ConfigurationMissing", - Message: `Configuration "not-found" referenced in traffic not found.`, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionFalse, + Reason: "ConfigurationMissing", + Message: `Configuration "not-found" referenced in traffic not found.`, + Severity: "Error", }}, }), }}, @@ -1118,18 +1184,21 @@ func TestReconcile(t *testing.T) { WantUpdates: []clientgotesting.UpdateActionImpl{{ Object: simplePinned("default", "missing-revision-direct", "not-found", &v1alpha1.RouteStatus{ Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionAllTrafficAssigned, - Status: corev1.ConditionFalse, - Reason: "RevisionMissing", - Message: `Revision "not-found" referenced in traffic not found.`, + Type: v1alpha1.RouteConditionAllTrafficAssigned, + Status: corev1.ConditionFalse, + Reason: "RevisionMissing", + Message: `Revision "not-found" referenced in traffic not found.`, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionIngressReady, - Status: corev1.ConditionUnknown, + Type: v1alpha1.RouteConditionIngressReady, + Status: corev1.ConditionUnknown, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionFalse, - Reason: "RevisionMissing", - Message: `Revision "not-found" referenced in traffic not found.`, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionFalse, + Reason: "RevisionMissing", + Message: `Revision "not-found" referenced in traffic not found.`, + Severity: "Error", }}, }), }}, @@ -1143,18 +1212,21 @@ func TestReconcile(t *testing.T) { WantUpdates: []clientgotesting.UpdateActionImpl{{ Object: simpleRunLatest("default", "missing-revision-indirect", "config", &v1alpha1.RouteStatus{ Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionAllTrafficAssigned, - Status: corev1.ConditionFalse, - Reason: "RevisionMissing", - Message: `Revision "config-00001" referenced in traffic not found.`, + Type: v1alpha1.RouteConditionAllTrafficAssigned, + Status: corev1.ConditionFalse, + Reason: "RevisionMissing", + Message: `Revision "config-00001" referenced in traffic not found.`, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionIngressReady, - Status: corev1.ConditionUnknown, + Type: v1alpha1.RouteConditionIngressReady, + Status: corev1.ConditionUnknown, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionFalse, - Reason: "RevisionMissing", - Message: `Revision "config-00001" referenced in traffic not found.`, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionFalse, + Reason: "RevisionMissing", + Message: `Revision "config-00001" referenced in traffic not found.`, + Severity: "Error", }}, }), }}, @@ -1199,14 +1271,17 @@ func TestReconcile(t *testing.T) { DomainInternal: "pinned-becomes-ready.default.svc.cluster.local", Address: &duckv1alpha1.Addressable{Hostname: "pinned-becomes-ready.default.svc.cluster.local"}, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionAllTrafficAssigned, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionAllTrafficAssigned, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionIngressReady, - Status: corev1.ConditionUnknown, + Type: v1alpha1.RouteConditionIngressReady, + Status: corev1.ConditionUnknown, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionUnknown, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionUnknown, + Severity: "Error", }}, Traffic: []v1alpha1.TrafficTarget{{ // TODO(#1495): This is established thru labels instead of OwnerReferences. @@ -1283,14 +1358,17 @@ func TestReconcile(t *testing.T) { DomainInternal: "named-traffic-split.default.svc.cluster.local", Address: &duckv1alpha1.Addressable{Hostname: "named-traffic-split.default.svc.cluster.local"}, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionAllTrafficAssigned, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionAllTrafficAssigned, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionIngressReady, - Status: corev1.ConditionUnknown, + Type: v1alpha1.RouteConditionIngressReady, + Status: corev1.ConditionUnknown, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionUnknown, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionUnknown, + Severity: "Error", }}, Traffic: []v1alpha1.TrafficTarget{{ RevisionName: "blue-00001", @@ -1379,14 +1457,17 @@ func TestReconcile(t *testing.T) { DomainInternal: "same-revision-targets.default.svc.cluster.local", Address: &duckv1alpha1.Addressable{Hostname: "same-revision-targets.default.svc.cluster.local"}, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionAllTrafficAssigned, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionAllTrafficAssigned, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionIngressReady, - Status: corev1.ConditionUnknown, + Type: v1alpha1.RouteConditionIngressReady, + Status: corev1.ConditionUnknown, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionUnknown, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionUnknown, + Severity: "Error", }}, Traffic: []v1alpha1.TrafficTarget{{ Name: "gray", @@ -1418,14 +1499,17 @@ func TestReconcile(t *testing.T) { DomainInternal: "switch-configs.default.svc.cluster.local", Address: &duckv1alpha1.Addressable{Hostname: "switch-configs.default.svc.cluster.local"}, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionAllTrafficAssigned, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionAllTrafficAssigned, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionIngressReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionIngressReady, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, Traffic: []v1alpha1.TrafficTarget{{ ConfigurationName: "blue", @@ -1486,14 +1570,17 @@ func TestReconcile(t *testing.T) { DomainInternal: "switch-configs.default.svc.cluster.local", Address: &duckv1alpha1.Addressable{Hostname: "switch-configs.default.svc.cluster.local"}, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionAllTrafficAssigned, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionAllTrafficAssigned, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionIngressReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionIngressReady, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, Traffic: []v1alpha1.TrafficTarget{{ RevisionName: "green-00001", @@ -1511,14 +1598,17 @@ func TestReconcile(t *testing.T) { DomainInternal: "stale-lastpinned.default.svc.cluster.local", Address: &duckv1alpha1.Addressable{Hostname: "stale-lastpinned.default.svc.cluster.local"}, Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionAllTrafficAssigned, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionAllTrafficAssigned, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionIngressReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionIngressReady, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, Traffic: []v1alpha1.TrafficTarget{{ RevisionName: "config-00001", diff --git a/pkg/reconciler/v1alpha1/route/traffic/errors_test.go b/pkg/reconciler/v1alpha1/route/traffic/errors_test.go index 6e67be395448..062e9e917134 100644 --- a/pkg/reconciler/v1alpha1/route/traffic/errors_test.go +++ b/pkg/reconciler/v1alpha1/route/traffic/errors_test.go @@ -48,6 +48,7 @@ func TestMarkBadTrafficTarget_Missing(t *testing.T) { Reason: "RevisionMissing", Message: `Revision "missing-rev" referenced in traffic not found.`, LastTransitionTime: got.LastTransitionTime, + Severity: "Error", } if diff := cmp.Diff(want, got); diff != "" { t.Errorf("Unexpected condition diff (-want +got): %v", diff) @@ -79,6 +80,7 @@ func TestMarkBadTrafficTarget_NotYetReady(t *testing.T) { Reason: "RevisionMissing", Message: `Configuration "unready-config" is waiting for a Revision to become ready.`, LastTransitionTime: got.LastTransitionTime, + Severity: "Error", } if diff := cmp.Diff(want, got); diff != "" { t.Errorf("Unexpected condition diff (-want +got): %v", diff) @@ -110,6 +112,7 @@ func TestMarkBadTrafficTarget_ConfigFailedToBeReady(t *testing.T) { Reason: "RevisionMissing", Message: `Configuration "failed-config" does not have any ready Revision.`, LastTransitionTime: got.LastTransitionTime, + Severity: "Error", } if diff := cmp.Diff(want, got); diff != "" { t.Errorf("Unexpected condition diff (-want +got): %v", diff) @@ -133,6 +136,7 @@ func TestMarkBadTrafficTarget_RevisionFailedToBeReady(t *testing.T) { Reason: "RevisionMissing", Message: `Revision "failed-revision" failed to become ready.`, LastTransitionTime: got.LastTransitionTime, + Severity: "Error", } if diff := cmp.Diff(want, got); diff != "" { t.Errorf("Unexpected condition diff (-want +got): %v", diff) @@ -164,6 +168,7 @@ func TestMarkBadTrafficTarget_RevisionNotYetReady(t *testing.T) { Reason: "RevisionMissing", Message: `Revision "unready-revision" is not yet ready.`, LastTransitionTime: got.LastTransitionTime, + Severity: "Error", } if diff := cmp.Diff(want, got); diff != "" { t.Errorf("Unexpected condition diff (-want +got): %v", diff) diff --git a/pkg/reconciler/v1alpha1/service/service_test.go b/pkg/reconciler/v1alpha1/service/service_test.go index b0acbf9aa48e..c333f0191640 100644 --- a/pkg/reconciler/v1alpha1/service/service_test.go +++ b/pkg/reconciler/v1alpha1/service/service_test.go @@ -50,31 +50,37 @@ var ( } manualConditions = duckv1alpha1.Conditions{{ - Type: v1alpha1.ServiceConditionConfigurationsReady, - Status: corev1.ConditionUnknown, - Reason: "Manual", - Message: "Service is set to Manual, and is not managing underlying resources.", + Type: v1alpha1.ServiceConditionConfigurationsReady, + Status: corev1.ConditionUnknown, + Reason: "Manual", + Message: "Service is set to Manual, and is not managing underlying resources.", + Severity: "Error", }, { - Type: v1alpha1.ServiceConditionReady, - Status: corev1.ConditionUnknown, - Reason: "Manual", - Message: "Service is set to Manual, and is not managing underlying resources.", + Type: v1alpha1.ServiceConditionReady, + Status: corev1.ConditionUnknown, + Reason: "Manual", + Message: "Service is set to Manual, and is not managing underlying resources.", + Severity: "Error", }, { - Type: v1alpha1.ServiceConditionRoutesReady, - Status: corev1.ConditionUnknown, - Reason: "Manual", - Message: "Service is set to Manual, and is not managing underlying resources.", + Type: v1alpha1.ServiceConditionRoutesReady, + Status: corev1.ConditionUnknown, + Reason: "Manual", + Message: "Service is set to Manual, and is not managing underlying resources.", + Severity: "Error", }} initialConditions = duckv1alpha1.Conditions{{ - Type: v1alpha1.ServiceConditionConfigurationsReady, - Status: corev1.ConditionUnknown, + Type: v1alpha1.ServiceConditionConfigurationsReady, + Status: corev1.ConditionUnknown, + Severity: "Error", }, { - Type: v1alpha1.ServiceConditionReady, - Status: corev1.ConditionUnknown, + Type: v1alpha1.ServiceConditionReady, + Status: corev1.ConditionUnknown, + Severity: "Error", }, { - Type: v1alpha1.ServiceConditionRoutesReady, - Status: corev1.ConditionUnknown, + Type: v1alpha1.ServiceConditionRoutesReady, + Status: corev1.ConditionUnknown, + Severity: "Error", }} ) @@ -275,29 +281,34 @@ func TestReconcile(t *testing.T) { routeWithStatus(mustMakeRoute(t, svcRL("all-ready", "foo", initialConditions...)), v1alpha1.RouteStatus{ Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, }), cfgWithStatus(mustMakeConfig(t, svcRL("all-ready", "foo", initialConditions...)), v1alpha1.ConfigurationStatus{ Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.ConfigurationConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.ConfigurationConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, }), }, Key: "foo/all-ready", WantUpdates: []clientgotesting.UpdateActionImpl{{ Object: svcRL("all-ready", "foo", duckv1alpha1.Conditions{{ - Type: v1alpha1.ServiceConditionConfigurationsReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.ServiceConditionConfigurationsReady, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.ServiceConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.ServiceConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.ServiceConditionRoutesReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.ServiceConditionRoutesReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}...), }}, }, { @@ -308,32 +319,37 @@ func TestReconcile(t *testing.T) { routeWithStatus(mustMakeRoute(t, svcRL("config-fails", "foo", initialConditions...)), v1alpha1.RouteStatus{ Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, }), cfgWithStatus(mustMakeConfig(t, svcRL("config-fails", "foo", initialConditions...)), v1alpha1.ConfigurationStatus{ Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.ConfigurationConditionReady, - Status: corev1.ConditionFalse, - Reason: "Propagate me, please", + Type: v1alpha1.ConfigurationConditionReady, + Status: corev1.ConditionFalse, + Reason: "Propagate me, please", + Severity: "Error", }}, }), }, Key: "foo/config-fails", WantUpdates: []clientgotesting.UpdateActionImpl{{ Object: svcRL("config-fails", "foo", duckv1alpha1.Conditions{{ - Type: v1alpha1.ServiceConditionConfigurationsReady, - Status: corev1.ConditionFalse, - Reason: "Propagate me, please", + Type: v1alpha1.ServiceConditionConfigurationsReady, + Status: corev1.ConditionFalse, + Reason: "Propagate me, please", + Severity: "Error", }, { - Type: v1alpha1.ServiceConditionReady, - Status: corev1.ConditionFalse, - Reason: "Propagate me, please", + Type: v1alpha1.ServiceConditionReady, + Status: corev1.ConditionFalse, + Reason: "Propagate me, please", + Severity: "Error", }, { - Type: v1alpha1.ServiceConditionRoutesReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.ServiceConditionRoutesReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}...), }}, }, { @@ -344,32 +360,37 @@ func TestReconcile(t *testing.T) { routeWithStatus(mustMakeRoute(t, svcRL("route-fails", "foo", initialConditions...)), v1alpha1.RouteStatus{ Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.RouteConditionReady, - Status: corev1.ConditionFalse, - Reason: "Propagate me, please", + Type: v1alpha1.RouteConditionReady, + Status: corev1.ConditionFalse, + Reason: "Propagate me, please", + Severity: "Error", }}, }), cfgWithStatus(mustMakeConfig(t, svcRL("route-fails", "foo", initialConditions...)), v1alpha1.ConfigurationStatus{ Conditions: duckv1alpha1.Conditions{{ - Type: v1alpha1.ConfigurationConditionReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.ConfigurationConditionReady, + Status: corev1.ConditionTrue, + Severity: "Error", }}, }), }, Key: "foo/route-fails", WantUpdates: []clientgotesting.UpdateActionImpl{{ Object: svcRL("route-fails", "foo", duckv1alpha1.Conditions{{ - Type: v1alpha1.ServiceConditionConfigurationsReady, - Status: corev1.ConditionTrue, + Type: v1alpha1.ServiceConditionConfigurationsReady, + Status: corev1.ConditionTrue, + Severity: "Error", }, { - Type: v1alpha1.ServiceConditionReady, - Status: corev1.ConditionFalse, - Reason: "Propagate me, please", + Type: v1alpha1.ServiceConditionReady, + Status: corev1.ConditionFalse, + Reason: "Propagate me, please", + Severity: "Error", }, { - Type: v1alpha1.ServiceConditionRoutesReady, - Status: corev1.ConditionFalse, - Reason: "Propagate me, please", + Type: v1alpha1.ServiceConditionRoutesReady, + Status: corev1.ConditionFalse, + Reason: "Propagate me, please", + Severity: "Error", }}...), }}, }} diff --git a/vendor/github.com/knative/pkg/apis/duck/v1alpha1/condition_set.go b/vendor/github.com/knative/pkg/apis/duck/v1alpha1/condition_set.go index 30b76a5f6671..e330970bd0b9 100644 --- a/vendor/github.com/knative/pkg/apis/duck/v1alpha1/condition_set.go +++ b/vendor/github.com/knative/pkg/apis/duck/v1alpha1/condition_set.go @@ -62,7 +62,7 @@ type ConditionManager interface { SetCondition(new Condition) // MarkTrue sets the status of t to true, and then marks the happy condition to - // true if all other dependents are also true. + // true if all dependents are true. MarkTrue(t ConditionType) // MarkUnknown sets the status of t to Unknown and also sets the happy condition @@ -82,12 +82,14 @@ type ConditionManager interface { // NewLivingConditionSet returns a ConditionSet to hold the conditions for the // living resource. ConditionReady is used as the happy condition. +// The set of condition types provided are those of the terminal subconditions. func NewLivingConditionSet(d ...ConditionType) ConditionSet { return newConditionSet(ConditionReady, d...) } // NewBatchConditionSet returns a ConditionSet to hold the conditions for the // batch resource. ConditionSucceeded is used as the happy condition. +// The set of condition types provided are those of the terminal subconditions. func NewBatchConditionSet(d ...ConditionType) ConditionSet { return newConditionSet(ConditionSucceeded, d...) } @@ -209,13 +211,30 @@ func (r conditionsImpl) SetCondition(new Condition) { r.accessor.SetConditions(conditions) } +func (r conditionsImpl) isTerminal(t ConditionType) bool { + for _, cond := range append(r.dependents, r.happy) { + if cond == t { + return true + } + } + return false +} + +func (r conditionsImpl) severity(t ConditionType) ConditionSeverity { + if r.isTerminal(t) { + return ConditionSeverityError + } + return ConditionSeverityInfo +} + // MarkTrue sets the status of t to true, and then marks the happy condition to // true if all other dependents are also true. func (r conditionsImpl) MarkTrue(t ConditionType) { // set the specified condition r.SetCondition(Condition{ - Type: t, - Status: corev1.ConditionTrue, + Type: t, + Status: corev1.ConditionTrue, + Severity: r.severity(t), }) // check the dependents. @@ -229,8 +248,9 @@ func (r conditionsImpl) MarkTrue(t ConditionType) { // set the happy condition r.SetCondition(Condition{ - Type: r.happy, - Status: corev1.ConditionTrue, + Type: r.happy, + Status: corev1.ConditionTrue, + Severity: r.severity(r.happy), }) } @@ -239,13 +259,15 @@ func (r conditionsImpl) MarkTrue(t ConditionType) { func (r conditionsImpl) MarkUnknown(t ConditionType, reason, messageFormat string, messageA ...interface{}) { // set the specified condition r.SetCondition(Condition{ - Type: t, - Status: corev1.ConditionUnknown, - Reason: reason, - Message: fmt.Sprintf(messageFormat, messageA...), + Type: t, + Status: corev1.ConditionUnknown, + Reason: reason, + Message: fmt.Sprintf(messageFormat, messageA...), + Severity: r.severity(t), }) // check the dependents. + isDependent := false for _, cond := range r.dependents { c := r.GetCondition(cond) // Failed conditions trump Unknown conditions @@ -257,28 +279,39 @@ func (r conditionsImpl) MarkUnknown(t ConditionType, reason, messageFormat strin } return } + if cond == t { + isDependent = true + } } - // set the happy condition - r.SetCondition(Condition{ - Type: r.happy, - Status: corev1.ConditionUnknown, - Reason: reason, - Message: fmt.Sprintf(messageFormat, messageA...), - }) + if isDependent { + // set the happy condition, if it is one of our dependent subconditions. + r.SetCondition(Condition{ + Type: r.happy, + Status: corev1.ConditionUnknown, + Reason: reason, + Message: fmt.Sprintf(messageFormat, messageA...), + Severity: r.severity(r.happy), + }) + } } // MarkFalse sets the status of t and the happy condition to False. func (r conditionsImpl) MarkFalse(t ConditionType, reason, messageFormat string, messageA ...interface{}) { - for _, t := range []ConditionType{ - t, - r.happy, - } { + types := []ConditionType{t} + for _, cond := range r.dependents { + if cond == t { + types = append(types, r.happy) + } + } + + for _, t := range types { r.SetCondition(Condition{ - Type: t, - Status: corev1.ConditionFalse, - Reason: reason, - Message: fmt.Sprintf(messageFormat, messageA...), + Type: t, + Status: corev1.ConditionFalse, + Reason: reason, + Message: fmt.Sprintf(messageFormat, messageA...), + Severity: r.severity(t), }) } } @@ -295,8 +328,9 @@ func (r conditionsImpl) InitializeConditions() { func (r conditionsImpl) InitializeCondition(t ConditionType) { if c := r.GetCondition(t); c == nil { r.SetCondition(Condition{ - Type: t, - Status: corev1.ConditionUnknown, + Type: t, + Status: corev1.ConditionUnknown, + Severity: r.severity(t), }) } } diff --git a/vendor/github.com/knative/pkg/apis/duck/v1alpha1/conditions_types.go b/vendor/github.com/knative/pkg/apis/duck/v1alpha1/conditions_types.go index 44b999210510..0dbad3397e0e 100644 --- a/vendor/github.com/knative/pkg/apis/duck/v1alpha1/conditions_types.go +++ b/vendor/github.com/knative/pkg/apis/duck/v1alpha1/conditions_types.go @@ -42,6 +42,21 @@ const ( ConditionSucceeded ConditionType = "Succeeded" ) +// ConditionSeverity expresses the severity of a Condition Type failing. +type ConditionSeverity string + +const ( + // ConditionSeverityError specifies that a failure of a condition type + // should be viewed as an error. + ConditionSeverityError ConditionSeverity = "Error" + // ConditionSeverityWarning specifies that a failure of a condition type + // should be viewed as a warning, but that things could still work. + ConditionSeverityWarning ConditionSeverity = "Warning" + // ConditionSeverityInfo specifies that a failure of a condition type + // should be viewed as purely informational, and that things could still work. + ConditionSeverityInfo ConditionSeverity = "Info" +) + // Conditions defines a readiness condition for a Knative resource. // See: https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#typical-status-properties // +k8s:deepcopy-gen=true @@ -54,6 +69,11 @@ type Condition struct { // +required Status corev1.ConditionStatus `json:"status" description:"status of the condition, one of True, False, Unknown"` + // Severity with which to treat failures of this type of condition. + // When this is not specified, it defaults to Error. + // +optional + Severity ConditionSeverity `json:"severity,omitempty" description:"how to interpret failures of this condition, one of Error, Warning, Info"` + // LastTransitionTime is the last time the condition transitioned from one status to another. // We use VolatileTime in place of metav1.Time to exclude this from creating equality.Semantic // differences (all other things held constant). @@ -93,7 +113,6 @@ func (c *Condition) IsUnknown() bool { return c.Status == corev1.ConditionUnknown } - // Conditions is an Implementable "duck type". var _ duck.Implementable = (*Conditions)(nil)