Skip to content

Commit

Permalink
Fix Workspaces in Sidecar to be serialized as workspaces not Workspaces
Browse files Browse the repository at this point in the history
Workspaces field in Sidecar does not have a JSON annotation, therefore
it defaults to pascalcase. This is inconsistent with other fields that
are all lowercase. We need to dd the annotations to ensure that json
schema generators work correctly.

This change annotates the Workspaces field in Sidecar with
`json:"workspaces,omitempty"`.

Fixes #3964

(cherry picked from commits 7f2eafa,
0b80063,
a9b729b)

We need to cherry pick this change into v0.24 to avoid backwards
incompatibility and regressed behavior when we release v0.25.
  • Loading branch information
jerop authored and tekton-robot committed Jun 8, 2021
1 parent 00521b9 commit 5c7a111
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pkg/apis/pipeline/v1beta1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions pkg/apis/pipeline/v1beta1/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1496,14 +1496,6 @@
"name"
],
"properties": {
"Workspaces": {
"description": "This is an alpha field. You must set the \"enable-api-fields\" feature flag to \"alpha\" for this field to be supported.\n\nWorkspaces is a list of workspaces from the Task that this Sidecar wants exclusive access to. Adding a workspace to this list means that any other Step or Sidecar that does not also request this Workspace will not have access to it.",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/v1beta1.WorkspaceUsage"
}
},
"args": {
"description": "Arguments to the entrypoint. The docker image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell",
"type": "array",
Expand Down Expand Up @@ -1638,6 +1630,14 @@
"workingDir": {
"description": "Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.",
"type": "string"
},
"workspaces": {
"description": "This is an alpha field. You must set the \"enable-api-fields\" feature flag to \"alpha\" for this field to be supported.\n\nWorkspaces is a list of workspaces from the Task that this Sidecar wants exclusive access to. Adding a workspace to this list means that any other Step or Sidecar that does not also request this Workspace will not have access to it.",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/v1beta1.WorkspaceUsage"
}
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/pipeline/v1beta1/task_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ type Sidecar struct {
// other Step or Sidecar that does not also request this Workspace will
// not have access to it.
// +optional
Workspaces []WorkspaceUsage
Workspaces []WorkspaceUsage `json:"workspaces,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down

0 comments on commit 5c7a111

Please sign in to comment.