From d0967bbe5e78dbcdd5bc189d5fc2becafc4be0f2 Mon Sep 17 00:00:00 2001 From: Jordan Liggitt Date: Fri, 6 Jan 2023 00:58:23 -0500 Subject: [PATCH] Prune trailing newlines when enums are disabled --- staging/src/k8s.io/apiserver/pkg/util/openapi/enablement.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staging/src/k8s.io/apiserver/pkg/util/openapi/enablement.go b/staging/src/k8s.io/apiserver/pkg/util/openapi/enablement.go index 693821ac025..b1db3c42b05 100644 --- a/staging/src/k8s.io/apiserver/pkg/util/openapi/enablement.go +++ b/staging/src/k8s.io/apiserver/pkg/util/openapi/enablement.go @@ -68,7 +68,7 @@ func pruneEnums(schema *spec.Schema) *spec.Schema { // note that the new lines before the header should be removed too, // thus the slice range. clone() - schema.Description = schema.Description[:headerIndex] + schema.Description = strings.TrimSpace(schema.Description[:headerIndex]) } if len(schema.Enum) != 0 { // remove the enum field