From 9b9f22f06b5e76e0420cbc9ef135a57b5571e3a3 Mon Sep 17 00:00:00 2001 From: Quan Tian Date: Fri, 6 Jan 2023 19:02:24 +0800 Subject: [PATCH] Fix unknown field error in deployment lifecycle e2e The terminationGracePeriodSeconds field was capitalized wrongly, leading to unknown field warning when running deployment lifecycle e2e: STEP: patching the Deployment @ 01/06/23 10:59:25.969 W0106 10:59:25.978292 433473 warnings.go:70] unknown field "spec.template.spec.TerminationGracePeriodSeconds" The issue was undiscovered because the patched value didn't change, so the test would succeed anyway. Signed-off-by: Quan Tian --- test/e2e/apps/deployment.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/e2e/apps/deployment.go b/test/e2e/apps/deployment.go index a5b06f3bcbb..8c74b5ffb0c 100644 --- a/test/e2e/apps/deployment.go +++ b/test/e2e/apps/deployment.go @@ -184,6 +184,7 @@ var _ = SIGDescribe("Deployment", func() { */ framework.ConformanceIt("should run the lifecycle of a Deployment", func(ctx context.Context) { one := int64(1) + two := int64(2) deploymentResource := schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "deployments"} testNamespaceName := f.Namespace.Name testDeploymentName := "test-deployment" @@ -259,7 +260,7 @@ var _ = SIGDescribe("Deployment", func() { "replicas": testDeploymentMinimumReplicas, "template": map[string]interface{}{ "spec": map[string]interface{}{ - "TerminationGracePeriodSeconds": &one, + "terminationGracePeriodSeconds": &two, "containers": [1]map[string]interface{}{{ "name": testDeploymentName, "image": testDeploymentPatchImage, @@ -301,7 +302,8 @@ var _ = SIGDescribe("Deployment", func() { deployment.Status.ReadyReplicas == testDeploymentMinimumReplicas && deployment.Status.UpdatedReplicas == testDeploymentMinimumReplicas && deployment.Status.UnavailableReplicas == 0 && - deployment.Spec.Template.Spec.Containers[0].Image == testDeploymentPatchImage + deployment.Spec.Template.Spec.Containers[0].Image == testDeploymentPatchImage && + *deployment.Spec.Template.Spec.TerminationGracePeriodSeconds == two if !found { framework.Logf("observed Deployment %v in namespace %v with ReadyReplicas %v", deployment.ObjectMeta.Name, deployment.ObjectMeta.Namespace, deployment.Status.ReadyReplicas) }