You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to rerun (through the UI) a PipelineRun that uses generateName rather than name for its name, the new PipelineRun will fail admission with the error message: admission webhook "validation.webhook.pipeline.tekton.dev" denied the request: validation failed: Invalid resource name: length must be no more than 63 characters: metadata.name
To reproduce:
Start a PipelineRun specifying generateName rather than name, with a length of at least 58 characters.
Attempt to re-run the PipelineRun through one of these paths:
a. Go to Pipelines -> PipelineRun -> Click three dots next to the PipelineRun -> "Rerun"
b. Go to Pipelines -> Click three dots next to the Pipeline that was run -> "Start last run"
The PipelineRun will fail admission (in case 2.a without showing in the UI!) with an error message: "admission webhook "validation.webhook.pipeline.tekton.dev" denied the request: validation failed: Invalid resource name: length must be no more than 63 characters: metadata.name"
In the case where generateName is used in the previous pipeline run, the getPipelineRunGenerateName function invoked simply returns the entire generateName string which is concated by the 6 characters that the getRandomChars function returns. This is then set as the name of the new PipelineRun. If generateName is at least 58 characters long, this will result in a 64 character name, thus failing admission.
My suggestion would be to simply set generateName on the new PipelineRun to the generateName value on the old PipelineRun. When using generateName, Kubernetes will attempt to ensure uniqueness anyway (or fail trying), thus there is no need to use the getRandomChars function.
The text was updated successfully, but these errors were encountered:
When attempting to rerun (through the UI) a PipelineRun that uses
generateName
rather thanname
for its name, the new PipelineRun will fail admission with the error message:admission webhook "validation.webhook.pipeline.tekton.dev" denied the request: validation failed: Invalid resource name: length must be no more than 63 characters: metadata.name
To reproduce:
generateName
rather than name, with a length of at least 58 characters.a. Go to Pipelines -> PipelineRun -> Click three dots next to the PipelineRun -> "Rerun"
b. Go to Pipelines -> Click three dots next to the Pipeline that was run -> "Start last run"
Cause
The issue arises from this line of code:
console/frontend/packages/pipelines-plugin/src/components/pipelines/modals/common/utils.ts
Line 134 in 07b0002
In the case where generateName is used in the previous pipeline run, the
getPipelineRunGenerateName
function invoked simply returns the entire generateName string which is concated by the 6 characters that thegetRandomChars
function returns. This is then set as thename
of the new PipelineRun. IfgenerateName
is at least 58 characters long, this will result in a 64 character name, thus failing admission.My suggestion would be to simply set
generateName
on the new PipelineRun to thegenerateName
value on the old PipelineRun. When usinggenerateName
, Kubernetes will attempt to ensure uniqueness anyway (or fail trying), thus there is no need to use thegetRandomChars
function.The text was updated successfully, but these errors were encountered: