{"action":"closed","issue":{"url":"https://api.github.com/repos/knative/build-pipeline/issues/273","repository_url":"https://api.github.com/repos/knative/build-pipeline","labels_url":"https://api.github.com/repos/knative/build-pipeline/issues/273/labels{/name}","comments_url":"https://api.github.com/repos/knative/build-pipeline/issues/273/comments","events_url":"https://api.github.com/repos/knative/build-pipeline/issues/273/events","html_url":"https://github.com/knative/build-pipeline/issues/273","id":385432073,"node_id":"MDU6SXNzdWUzODU0MzIwNzM=","number":273,"title":"Gracefully handle Task Step name that can't be used as Pod name","user":{"login":"bobcatfish","id":432502,"node_id":"MDQ6VXNlcjQzMjUwMg==","avatar_url":"https://avatars2.githubusercontent.com/u/432502?v=4","gravatar_id":"","url":"https://api.github.com/users/bobcatfish","html_url":"https://github.com/bobcatfish","followers_url":"https://api.github.com/users/bobcatfish/followers","following_url":"https://api.github.com/users/bobcatfish/following{/other_user}","gists_url":"https://api.github.com/users/bobcatfish/gists{/gist_id}","starred_url":"https://api.github.com/users/bobcatfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobcatfish/subscriptions","organizations_url":"https://api.github.com/users/bobcatfish/orgs","repos_url":"https://api.github.com/users/bobcatfish/repos","events_url":"https://api.github.com/users/bobcatfish/events{/privacy}","received_events_url":"https://api.github.com/users/bobcatfish/received_events","type":"User","site_admin":false},"labels":[{"id":1039521510,"node_id":"MDU6TGFiZWwxMDM5NTIxNTEw","url":"https://api.github.com/repos/knative/build-pipeline/labels/bug","name":"bug","color":"d73a4a","default":true},{"id":1039521523,"node_id":"MDU6TGFiZWwxMDM5NTIxNTIz","url":"https://api.github.com/repos/knative/build-pipeline/labels/help%20wanted","name":"help wanted","color":"008672","default":true}],"state":"closed","locked":false,"assignee":{"login":"shashwathi","id":9938926,"node_id":"MDQ6VXNlcjk5Mzg5MjY=","avatar_url":"https://avatars0.githubusercontent.com/u/9938926?v=4","gravatar_id":"","url":"https://api.github.com/users/shashwathi","html_url":"https://github.com/shashwathi","followers_url":"https://api.github.com/users/shashwathi/followers","following_url":"https://api.github.com/users/shashwathi/following{/other_user}","gists_url":"https://api.github.com/users/shashwathi/gists{/gist_id}","starred_url":"https://api.github.com/users/shashwathi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shashwathi/subscriptions","organizations_url":"https://api.github.com/users/shashwathi/orgs","repos_url":"https://api.github.com/users/shashwathi/repos","events_url":"https://api.github.com/users/shashwathi/events{/privacy}","received_events_url":"https://api.github.com/users/shashwathi/received_events","type":"User","site_admin":false},"assignees":[{"login":"shashwathi","id":9938926,"node_id":"MDQ6VXNlcjk5Mzg5MjY=","avatar_url":"https://avatars0.githubusercontent.com/u/9938926?v=4","gravatar_id":"","url":"https://api.github.com/users/shashwathi","html_url":"https://github.com/shashwathi","followers_url":"https://api.github.com/users/shashwathi/followers","following_url":"https://api.github.com/users/shashwathi/following{/other_user}","gists_url":"https://api.github.com/users/shashwathi/gists{/gist_id}","starred_url":"https://api.github.com/users/shashwathi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shashwathi/subscriptions","organizations_url":"https://api.github.com/users/shashwathi/orgs","repos_url":"https://api.github.com/users/shashwathi/repos","events_url":"https://api.github.com/users/shashwathi/events{/privacy}","received_events_url":"https://api.github.com/users/shashwathi/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-11-28T19:55:30Z","updated_at":"2018-11-29T14:01:25Z","closed_at":"2018-11-29T14:01:25Z","author_association":"CONTRIBUTOR","body":"## Expected Behavior\r\nIf you create a Task with a step that has a name which cannot be used for some reason, you should either be:\r\n\r\n* Told immediately (via webhook) that it is invalid\r\n* Something should be done to make the name usable\r\n\r\n## Actual Behavior\r\nIf you create a step with a name that cannot be used as a pod name, the underlying TaskRun/Build will start executing, and only fail when finally trying to create the Pod i.e. AFTER running:\r\n\r\n- build-step-credential-initializer\r\n- build-step-git-source\r\n- build-step-place-tools\r\n\r\n```yaml\r\n  status:\r\n    builder: Cluster\r\n    completionTime: null\r\n    conditions:\r\n    - lastTransitionTime: 2018-11-28T20:02:23Z\r\n      message: 'Pod \"demo-pipeline-run-5-deploy-app-dxrvb\" is invalid: spec.initContainers[3].name:\r\n        Invalid value: \"build-step-replaceImage\": a DNS-1123 label must consist of\r\n        lower case alphanumeric characters or ''-'', and must start and end with an\r\n        alphanumeric character (e.g. ''my-name'',  or ''123-abc'', regex used for\r\n        validation is ''[a-z0-9]([-a-z0-9]*[a-z0-9])?'')'\r\n      reason: BuildExecuteFailed\r\n      status: \"False\"\r\n      type: Succeeded\r\n    startTime: null\r\n    stepStates: null\r\n    stepsCompleted: null\r\n```\r\n\r\n## Steps to Reproduce the Problem\r\n\r\n  1. Create a Task that uses camelcase for a step name, e.g. `replaceImage`\r\n  2. Create a TaskRun that executes it\r\n  3. Run `kubectl get builds -o yaml` and watch the underlying Build progress\r\n\r\nSpecifically you can use the demo yaml in #274 like so:\r\n\r\n1. Modify `build_task.yaml` so that the step called `build-and-push` is called `buildAndPush` instead:\r\n\r\nhttps://github.com/knative/build-pipeline/blob/57367eb34b38916bad49768d408605fe1bf9358e/examples/build_task.yaml#L20\r\n\r\n2. Create all the CRDs you need:\r\n\r\n```bash\r\nkubectl apply -f examples/\r\nkubectl apply -f examples/pipelines\r\nkubectl apply -f examples/demo\r\n```\r\n\r\n3. Invoke the PipelineRun:\r\n\r\n```bash\r\nkubectl apply -f examples/demo/run\r\n```\r\n\r\n4. Run `kubectl get pipelineruns -o yaml` repeatedly until you see the error"}}
{"actor":{"display_login":"knative-prow-robot"}}