From 841e2a334fe08b38a685ea23eafdd1ce4fc34739 Mon Sep 17 00:00:00 2001 From: Jonas Pettersson Date: Fri, 27 Mar 2020 14:16:07 +0100 Subject: [PATCH] Add missing omitempty that breaks compatibility Adding "omitempty" on the optional "description" field in WorkspacePipelineDeclaration, to be compatible with previous versions. v1alpha1 is type aliased with v1beta1, but a new optional field is added. Submitting without "omitempty" will result in an error from the admission webhook: "webhook.tekton.dev" denied the request: mutation failed: cannot decode incoming new object: json: unknown field: "description" By adding "omitempty" tag, this field is not sent to the server when empty. --- pkg/apis/pipeline/v1beta1/workspace_types.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/apis/pipeline/v1beta1/workspace_types.go b/pkg/apis/pipeline/v1beta1/workspace_types.go index e2c768a563a..f0eab019486 100644 --- a/pkg/apis/pipeline/v1beta1/workspace_types.go +++ b/pkg/apis/pipeline/v1beta1/workspace_types.go @@ -81,7 +81,7 @@ type WorkspacePipelineDeclaration struct { // used in the Pipeline. It can be useful to include a bit of detail about which // tasks are intended to have access to the data on the workspace. // +optional - Description string `json:"description"` + Description string `json:"description,omitempty"` } // WorkspacePipelineTaskBinding describes how a workspace passed into the pipeline should be