Repository: knative/serving
Pull request #7883 (2020-05-07 18:21:37)

Add log stream to the HA tests
Helps debugging.

/assign mattmoor @tcnghia 
/cc @mgencur 

knative-prow-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/knative/serving/pull/7883#" title="Author self-approved">vagababov</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=knative%2Fserving).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[test/OWNERS](https://github.com/knative/serving/blob/master/test/OWNERS)~~ [vagababov]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->

Patch:
diff --git a/cmd/queue/main.go b/cmd/queue/main.go
index 8647fd23e..f66c30d1b 100644
--- a/cmd/queue/main.go
+++ b/cmd/queue/main.go
@@ -342,14 +342,14 @@ func main() {
 	defer flush(logger)
 
 	logger = logger.With(
-		zap.String(logkey.Key, types.NamespacedName{
+		zap.Object(logkey.Key, pkglogging.NamespacedName(types.NamespacedName{
 			Namespace: env.ServingNamespace,
 			Name:      env.ServingRevision,
-		}.String()),
+		})),
 		zap.String(logkey.Pod, env.ServingPod))
 
 	if err := validateEnv(env); err != nil {
-		logger.Fatal(err.Error())
+		logger.Fatalw("Error validating env", zap.Error(err))
 	}
 
 	// Report stats on Go memory usage every 30 seconds.
@@ -438,7 +438,7 @@ func main() {
 		})
 
 		for serverName, srv := range servers {
-			logger.Infof("Shutting down %s server", serverName)
+			logger.Info("Shutting down server: ", serverName)
 			if err := srv.Shutdown(context.Background()); err != nil {
 				logger.Errorw("Failed to shutdown server", zap.String("server", serverName), zap.Error(err))
 			}
diff --git a/config/core/configmaps/dummy.go b/config/core/configmaps/dummy.go
new file mode 100644
index 000000000..ee729dd5d
--- /dev/null
+++ b/config/core/configmaps/dummy.go
@@ -0,0 +1,19 @@
+/*
+Copyright 2020 The Knative Authors
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Package configmaps is a placeholder that allows us to pull in config files
+// via go mod vendor.
+package configmaps
diff --git a/config/core/deployments/dummy.go b/config/core/deployments/dummy.go
new file mode 100644
index 000000000..a3bde1ba6
--- /dev/null
+++ b/config/core/deployments/dummy.go
@@ -0,0 +1,19 @@
+/*
+Copyright 2020 The Knative Authors
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Package deployments is a placeholder that allows us to pull in config files
+// via go mod vendor.
+package deployments
diff --git a/config/core/dummy.go b/config/core/dummy.go
new file mode 100644
index 000000000..9658a36aa
--- /dev/null
+++ b/config/core/dummy.go
@@ -0,0 +1,19 @@
+/*
+Copyright 2020 The Knative Authors
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Package core is a placeholder that allows us to pull in config files
+// via go mod vendor.
+package core
diff --git a/config/core/resources/dummy.go b/config/core/resources/dummy.go
new file mode 100644
index 000000000..229171cdc
--- /dev/null
+++ b/config/core/resources/dummy.go
@@ -0,0 +1,19 @@
+/*
+Copyright 2020 The Knative Authors
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Package resources is a placeholder that allows us to pull in config files
+// via go mod vendor.
+package resources
diff --git a/config/core/roles/dummy.go b/config/core/roles/dummy.go
new file mode 100644
index 000000000..cddff2b7f
--- /dev/null
+++ b/config/core/roles/dummy.go
@@ -0,0 +1,19 @@
+/*
+Copyright 2020 The Knative Authors
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Package roles is a placeholder that allows us to pull in config files
+// via go mod vendor.
+package roles
diff --git a/config/core/webhooks/dummy.go b/config/core/webhooks/dummy.go
new file mode 100644
index 000000000..4de28428b
--- /dev/null
+++ b/config/core/webhooks/dummy.go
@@ -0,0 +1,19 @@
+/*
+Copyright 2020 The Knative Authors
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Package webhooks is a placeholder that allows us to pull in config files
+// via go mod vendor.
+package webhooks
diff --git a/config/hpa-autoscaling/dummy.go b/config/hpa-autoscaling/dummy.go
new file mode 100644
index 000000000..f009a605c
--- /dev/null
+++ b/config/hpa-autoscaling/dummy.go
@@ -0,0 +1,19 @@
+/*
+Copyright 2020 The Knative Authors
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Package autoscaling is a placeholder that allows us to pull in config files
+// via go mod vendor.
+package autoscaling
diff --git a/config/namespace-wildcard-certs/dummy.go b/config/namespace-wildcard-certs/dummy.go
new file mode 100644
index 000000000..678e72478
--- /dev/null
+++ b/config/namespace-wildcard-certs/dummy.go
@@ -0,0 +1,19 @@
+/*
+Copyright 2020 The Knative Authors
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Package certs is a placeholder that allows us to pull in config files
+// via go mod vendor.
+package certs
diff --git a/config/post-install/dummy.go b/config/post-install/dummy.go
new file mode 100644
index 000000000..c5cc04518
--- /dev/null
+++ b/config/post-install/dummy.go
@@ -0,0 +1,19 @@
+/*
+Copyright 2020 The Knative Authors
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Package install is a placeholder that allows us to pull in config files
+// via go mod vendor.
+package install


Test patch:
diff --git a/test/ha/activator_test.go b/test/ha/activator_test.go
index d7d2e70b4..a0d04278d 100644
--- a/test/ha/activator_test.go
+++ b/test/ha/activator_test.go
@@ -24,6 +24,7 @@ import (
 	"testing"
 
 	"knative.dev/pkg/system"
+	"knative.dev/pkg/test/logstream"
 
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	"knative.dev/pkg/ptr"
@@ -47,6 +48,8 @@ const (
 // that we can scale from zero after activator restart.
 func TestActivatorHA(t *testing.T) {
 	clients := e2e.Setup(t)
+	cancel := logstream.Start(t)
+	defer cancel()
 
 	if err := waitForDeploymentScale(clients, activatorDeploymentName, haReplicas); err != nil {
 		t.Fatalf("Deployment %s not scaled to %d: %v", activatorDeploymentName, haReplicas, err)
diff --git a/test/ha/autoscalerhpa_test.go b/test/ha/autoscalerhpa_test.go
index d47cedc57..462d11a7d 100644
--- a/test/ha/autoscalerhpa_test.go
+++ b/test/ha/autoscalerhpa_test.go
@@ -22,8 +22,10 @@ import (
 	"testing"
 
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
 	"knative.dev/pkg/system"
 	pkgTest "knative.dev/pkg/test"
+	"knative.dev/pkg/test/logstream"
 	"knative.dev/serving/pkg/apis/autoscaling"
 	rtesting "knative.dev/serving/pkg/testing/v1"
 	"knative.dev/serving/test"
@@ -38,6 +40,8 @@ const (
 
 func TestAutoscalerHPAHANewRevision(t *testing.T) {
 	clients := e2e.Setup(t)
+	cancel := logstream.Start(t)
+	defer cancel()
 
 	if err := waitForDeploymentScale(clients, autoscalerHPADeploymentName, haReplicas); err != nil {
 		t.Fatalf("Deployment %s not scaled to %d: %v", autoscalerHPADeploymentName, haReplicas, err)
diff --git a/test/ha/controller_test.go b/test/ha/controller_test.go
index 0578646e9..1e537eafd 100644
--- a/test/ha/controller_test.go
+++ b/test/ha/controller_test.go
@@ -22,17 +22,19 @@ import (
 	"testing"
 
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
 	"knative.dev/pkg/system"
+	"knative.dev/pkg/test/logstream"
 	"knative.dev/serving/test"
 	"knative.dev/serving/test/e2e"
 )
 
-const (
-	controllerDeploymentName = "controller"
-)
+const controllerDeploymentName = "controller"
 
 func TestControllerHA(t *testing.T) {
 	clients := e2e.Setup(t)
+	cancel := logstream.Start(t)
+	defer cancel()
 
 	if err := waitForDeploymentScale(clients, controllerDeploymentName, haReplicas); err != nil {
 		t.Fatalf("Deployment %s not scaled to %d: %v", controllerDeploymentName, haReplicas, err)
diff --git a/third_party/contour-latest/contour.yaml b/third_party/contour-latest/contour.yaml
index 1b9748c0e..6bd84ec28 100644
--- a/third_party/contour-latest/contour.yaml
+++ b/third_party/contour-latest/contour.yaml
@@ -1406,7 +1406,7 @@ spec:
         # if we change this on each version, you can no longer upgrade
         # just by applying the deployment YAML.
         # See #2423, #2395, #2150, and #2030 for earlier questions about this.
-        image: gcr.io/knative-nightly/knative.dev/net-contour/vendor/github.com/projectcontour/contour/cmd/contour@sha256:29503f5af78a1301a07b270d79952c67501eb8f645dda051ce6b0ec83c0f4991
+        image: gcr.io/knative-nightly/knative.dev/net-contour/vendor/github.com/projectcontour/contour/cmd/contour@sha256:4f7ff8187ef1d0872f345c9ef35b8e976e9e87248da5f7509477661cdbcd0cd3
         imagePullPolicy: Always
         command:
         - contour
@@ -1635,7 +1635,7 @@ spec:
         - --contour-key-file=/certs/tls.key
         - --config-path=/config/contour.yaml
         command: ["contour"]
-        image: gcr.io/knative-nightly/knative.dev/net-contour/vendor/github.com/projectcontour/contour/cmd/contour@sha256:29503f5af78a1301a07b270d79952c67501eb8f645dda051ce6b0ec83c0f4991
+        image: gcr.io/knative-nightly/knative.dev/net-contour/vendor/github.com/projectcontour/contour/cmd/contour@sha256:4f7ff8187ef1d0872f345c9ef35b8e976e9e87248da5f7509477661cdbcd0cd3
         imagePullPolicy: Always
         name: contour
         ports:
@@ -1726,7 +1726,7 @@ spec:
         args:
         - envoy
         - shutdown-manager
-        image: gcr.io/knative-nightly/knative.dev/net-contour/vendor/github.com/projectcontour/contour/cmd/contour@sha256:29503f5af78a1301a07b270d79952c67501eb8f645dda051ce6b0ec83c0f4991
+        image: gcr.io/knative-nightly/knative.dev/net-contour/vendor/github.com/projectcontour/contour/cmd/contour@sha256:4f7ff8187ef1d0872f345c9ef35b8e976e9e87248da5f7509477661cdbcd0cd3
         imagePullPolicy: Always
         lifecycle:
           preStop:
@@ -1802,7 +1802,7 @@ spec:
         - --envoy-key-file=/certs/tls.key
         command:
         - contour
-        image: gcr.io/knative-nightly/knative.dev/net-contour/vendor/github.com/projectcontour/contour/cmd/contour@sha256:29503f5af78a1301a07b270d79952c67501eb8f645dda051ce6b0ec83c0f4991
+        image: gcr.io/knative-nightly/knative.dev/net-contour/vendor/github.com/projectcontour/contour/cmd/contour@sha256:4f7ff8187ef1d0872f345c9ef35b8e976e9e87248da5f7509477661cdbcd0cd3
         imagePullPolicy: Always
         name: envoy-initconfig
         volumeMounts:
@@ -3243,7 +3243,7 @@ spec:
         # if we change this on each version, you can no longer upgrade
         # just by applying the deployment YAML.
         # See #2423, #2395, #2150, and #2030 for earlier questions about this.
-        image: gcr.io/knative-nightly/knative.dev/net-contour/vendor/github.com/projectcontour/contour/cmd/contour@sha256:29503f5af78a1301a07b270d79952c67501eb8f645dda051ce6b0ec83c0f4991
+        image: gcr.io/knative-nightly/knative.dev/net-contour/vendor/github.com/projectcontour/contour/cmd/contour@sha256:4f7ff8187ef1d0872f345c9ef35b8e976e9e87248da5f7509477661cdbcd0cd3
         imagePullPolicy: Always
         command:
         - contour
@@ -3472,7 +3472,7 @@ spec:
         - --contour-key-file=/certs/tls.key
         - --config-path=/config/contour.yaml
         command: ["contour"]
-        image: gcr.io/knative-nightly/knative.dev/net-contour/vendor/github.com/projectcontour/contour/cmd/contour@sha256:29503f5af78a1301a07b270d79952c67501eb8f645dda051ce6b0ec83c0f4991
+        image: gcr.io/knative-nightly/knative.dev/net-contour/vendor/github.com/projectcontour/contour/cmd/contour@sha256:4f7ff8187ef1d0872f345c9ef35b8e976e9e87248da5f7509477661cdbcd0cd3
         imagePullPolicy: Always
         name: contour
         ports:
@@ -3563,7 +3563,7 @@ spec:
         args:
         - envoy
         - shutdown-manager
-        image: gcr.io/knative-nightly/knative.dev/net-contour/vendor/github.com/projectcontour/contour/cmd/contour@sha256:29503f5af78a1301a07b270d79952c67501eb8f645dda051ce6b0ec83c0f4991
+        image: gcr.io/knative-nightly/knative.dev/net-contour/vendor/github.com/projectcontour/contour/cmd/contour@sha256:4f7ff8187ef1d0872f345c9ef35b8e976e9e87248da5f7509477661cdbcd0cd3
         imagePullPolicy: Always
         lifecycle:
           preStop:
@@ -3639,7 +3639,7 @@ spec:
         - --envoy-key-file=/certs/tls.key
         command:
         - contour
-        image: gcr.io/knative-nightly/knative.dev/net-contour/vendor/github.com/projectcontour/contour/cmd/contour@sha256:29503f5af78a1301a07b270d79952c67501eb8f645dda051ce6b0ec83c0f4991
+        image: gcr.io/knative-nightly/knative.dev/net-contour/vendor/github.com/projectcontour/contour/cmd/contour@sha256:4f7ff8187ef1d0872f345c9ef35b8e976e9e87248da5f7509477661cdbcd0cd3
         imagePullPolicy: Always
         name: envoy-initconfig
         volumeMounts:
diff --git a/third_party/contour-latest/net-contour.yaml b/third_party/contour-latest/net-contour.yaml
index 0a8570ff5..50aa80342 100644
--- a/third_party/contour-latest/net-contour.yaml
+++ b/third_party/contour-latest/net-contour.yaml
@@ -33,7 +33,7 @@ metadata:
   name: config-contour
   namespace: knative-serving
   labels:
-    serving.knative.dev/release: "v20200504-78a8b6d"
+    serving.knative.dev/release: "v20200507-8f27913"
 data:
   _example: |
     ################################
@@ -90,7 +90,7 @@ spec:
       - name: controller
         # This is the Go import path for the binary that is containerized
         # and substituted here.
-        image: gcr.io/knative-nightly/knative.dev/net-contour/cmd/controller@sha256:394b28a5fc144aab7a8f28074b329e948a9d2e44e2f06078b943ef22eac1a7c7
+        image: gcr.io/knative-nightly/knative.dev/net-contour/cmd/controller@sha256:e2f5b37dabcbc1741be1965ebc47f3f20521d12caf8dd798bc788bdb2d51bf12
         resources:
           requests:
             cpu: 40m
diff --git a/third_party/kourier-latest/kourier.yaml b/third_party/kourier-latest/kourier.yaml
index 8bac6ebb7..a04cae1c4 100644
--- a/third_party/kourier-latest/kourier.yaml
+++ b/third_party/kourier-latest/kourier.yaml
@@ -148,7 +148,7 @@ spec:
         app: 3scale-kourier-control
     spec:
       containers:
-      - image: gcr.io/knative-nightly/knative.dev/net-kourier/cmd/kourier@sha256:39b511e932c792599b62deafd134f67df5ff582cc26abf0127ffcbeefbc8238b
+      - image: gcr.io/knative-nightly/knative.dev/net-kourier/cmd/kourier@sha256:01cfb84279d80a467b761ea26c98e0072e2cb23a3de8e36597eb2ba5a970589e
         imagePullPolicy: Always
         name: kourier-control
         env: