Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating an example pipelinerun with array indexing #6060

Merged

Conversation

pritidesai
Copy link
Member

Changes

  • Validate param values indexing into an array which are mapped to a pipeline params instead of echoing.
  • Add an example of how to reference a single element from an array.

This is for the preparation of a potential promotion of #5688.

Signed-off-by: pritidesai pdesai@us.ibm.com

/kind misc

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs included if any changes are user facing
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

NONE

@tekton-robot tekton-robot added release-note-none Denotes a PR that doesnt merit a release note. kind/misc Categorizes issue or PR as a miscellaneuous one. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 27, 2023
@pritidesai pritidesai added this to the Pipelines v0.45 milestone Jan 27, 2023
Copy link
Member

@XinruZhang XinruZhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @pritidesai !

I gave it a try and figured out that the PipelineRun failed because its child TaskRun failed to substitue the environment variable 🤔 Not sure why does that happen.

TaskRun  "step-echo-params-1" exited with code 1 (image: "docker.io/library/bash@sha256:46aef8866a15877c36cf72736f1433e827c648d27dfcc9f1c1f187e8df762be9"); for logs run: kubectl -n default logs pipelinerun-param-array-indexing-c8jkb-deploy-pod -c step-echo-params-1

> kubectl -n default logs pipelinerun-param-array-indexing-c8jkb-deploy-pod -c step-echo-params-1
failed to validate the one and only argument of the script
Want: staging, Got: $(params.environments[0])

@XinruZhang
Copy link
Member

It seems to be a bug, created an issue #6066 to track it.

@Yongxuanzhang
Copy link
Member

Yongxuanzhang commented Jan 27, 2023

staging

Could you check if you have enabled alpha feature flag? I can get the same error if not enabled.
The example should work.

@pritidesai
Copy link
Member Author

Could you check if you have enabled alpha feature flag? I can get the same error if not enabled.

Thanks @XinruZhang and @Yongxuanzhang. Yeah its misleading, we could do a little better at handling this - I have created an issue -#6102 - addressing a similar behavior, using alpha feature without enabling alpha flag.

Validating the expected param values while indexing into an array when task
array params mapped to a pipeline array params and task string params are
an elements of a pipeline array param

Signed-off-by: pritidesai <pdesai@us.ibm.com>
@pritidesai pritidesai force-pushed the example-param-array-indexing branch from fe28cd7 to 7bfd19f Compare February 2, 2023 22:34
@XinruZhang
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 2, 2023
@XinruZhang
Copy link
Member

Thank you @pritidesai !

Copy link
Member

@Yongxuanzhang Yongxuanzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hope I can approve 😅

Copy link
Member

@jerop jerop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you @pritidesai!

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jerop, Yongxuanzhang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 3, 2023
@tekton-robot tekton-robot merged commit 331d50e into tektoncd:main Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/misc Categorizes issue or PR as a miscellaneuous one. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesnt merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants