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

Use oci image to run a task #2130

Merged
merged 2 commits into from Nov 21, 2023
Merged

Conversation

williamlfish
Copy link
Contributor

@williamlfish williamlfish commented Sep 21, 2023

Changes

update the task start cmd to also allow an oci bundle with a task name.
Issue link here

create an argument for --image or -i that can pull an oci image and run a task from that bundle, still takes a positional argument as the task name

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes tests (if functionality changed/added)
  • Run the code checkers with make check
  • Regenerate the manpages, docs and go formatting with make generated
  • Commit messages follow commit message best practices

See the contribution guide
for more details.

Release Notes

@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 21, 2023
@tekton-robot
Copy link
Contributor

Hi @williamlfish. Thanks for your PR.

I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 21, 2023
@vinamra28
Copy link
Member

/ok-to-test

@tekton-robot tekton-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 22, 2023
@williamlfish
Copy link
Contributor Author

/retest

@williamlfish
Copy link
Contributor Author

/test pull-tekton-cli-integration-tests

@williamlfish
Copy link
Contributor Author

/assign @vdemeester

@williamlfish
Copy link
Contributor Author

@vdemeester the issue mentions creating a pipelinerun as well, since the logic is essentially the same, it might make sense to just bundle that logic and build the resource off the argument's and a "kind" param. I can add that to this pr, but was worried it would get much bigger, and wanted a chance to get approval on the approach. I can update this pr to do both and with more general func exported from somewhere ( not sure exactly where yet 😅 ) or just add that on a subsequent pr and update this cmd on the switch ( see comment on the code ). lemme know your thoughts. thanks!

var tname string
if len(args) > 0 {

switch {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

here is where i think we can generalize the logic for a task and a pipeline? @vdemeester

"os"
"strings"
"time"

"github.com/google/go-containerregistry/pkg/name"
Copy link
Contributor

Choose a reason for hiding this comment

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

not goimported

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤔 the linter seems happy enough, and i did run goimports -l -e -w ./pkg/cmd/task/start*.

I noticed the makefile has a goimports cmd, but its looking in a .bin/ of the current dir, and i dont have goimports installed there. Is there a way to setup the .bin/ from the makefile with the required dependencies? Not sure what the difference would be, running there vs where i have it installed, but happy to update, or if there is documentation I'm missing somewhere can you please point me in that direction? thanks 😸

Copy link
Member

Choose a reason for hiding this comment

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

@williamlfish it should "auto-install" it in the .bin folder on the make lint commands (or whatever the target name is). At least that's what it's supposed to do 😛

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vdemeester I updated make lint to do that with the latest commit, it was previously just installing golangci-lint. I'm not sure what version or what binary yamllint is supposed to be, but we should have that auto install too, for now i just moved to to the end so it fails there if someone does not have it installed 🤷‍♀️

@piyush-garg
Copy link
Contributor

/retest

@piyush-garg
Copy link
Contributor

lgtm

@piyush-garg
Copy link
Contributor

/lgtm

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

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

/meow

@tekton-robot
Copy link
Contributor

@vdemeester: cat image

In response to this:

/meow

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vdemeester

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 Nov 21, 2023
@tekton-robot tekton-robot merged commit 193b54a into tektoncd:main Nov 21, 2023
8 checks passed
@williamlfish williamlfish deleted the run-task-from-oci branch November 21, 2023 21:42
vinamra28 added a commit that referenced this pull request Jan 11, 2024
#2178 | [vinamra28] Bump choco and readme to v0.33.0 | 2023/11/16-07:52
#2178 | [vinamra28] Fix the release script | 2023/11/16-07:52
#2177 | [dependabot[bot]] Bump github.com/tektoncd/pipeline from 0.53.0 to 0.53.1 | 2023/11/16-11:30
#2180 | [dependabot[bot]] Bump github.com/tektoncd/triggers from 0.25.2 to 0.25.3 | 2023/11/16-18:28
#2181 | [dependabot[bot]] Bump github.com/tektoncd/pipeline from 0.53.1 to 0.53.2 | 2023/11/17-07:00
#2179 | [dependabot[bot]] Bump k8s.io/cli-runtime from 0.26.10 to 0.26.11 | 2023/11/17-07:40
#2182 | [dependabot[bot]] Bump github.com/creack/pty from 1.1.20 to 1.1.21 | 2023/11/20-06:08
#2130 | [William Fish] update the `task start` cmd to also allow an oci bundle with a task name to be created from the cli | 2023/11/21-10:00
#2130 | [William Fish] update make lint to run goimports and download it to the correct place | 2023/11/21-10:00
#2176 | [Vincent Demeester] Add a pre-commit setup to the repository. | 2023/11/21-15:38
null | [dependabot[bot]] Bump github.com/go-jose/go-jose/v3 from 3.0.0 to 3.0.1 | 2023/11/22-06:36
null | [dependabot[bot]] Bump github.com/tektoncd/hub from 1.15.0 to 1.15.1 | 2023/11/27-15:20
null | [dependabot[bot]] Bump knative.dev/serving | 2023/11/28-11:02
null | [dependabot[bot]] Bump golang.org/x/term from 0.14.0 to 0.15.0 | 2023/11/29-04:10
null | [dependabot[bot]] Bump github.com/tektoncd/pipeline from 0.53.2 to 0.54.0 | 2023/11/29-05:06
null | [dependabot[bot]] Bump github.com/ktr0731/go-fuzzyfinder from 0.7.0 to 0.8.0 | 2023/11/30-16:06
null | [dependabot[bot]] Bump github.com/theupdateframework/go-tuf from 0.6.1 to 0.7.0 | 2023/12/01-06:56
null | [dependabot[bot]] Bump github.com/google/go-containerregistry from 0.16.1 to 0.17.0 | 2023/12/02-05:48
null | [dependabot[bot]] Bump github.com/sigstore/sigstore from 1.7.5 to 1.7.6 | 2023/12/05-04:02
null | [dependabot[bot]] Bump golang.org/x/crypto from 0.16.0 to 0.17.0 | 2023/12/19-07:22
null | [dependabot[bot]] Bump github.com/tektoncd/pipeline from 0.54.0 to 0.54.1 | 2023/12/21-07:16
null | [dependabot[bot]] Bump github.com/tektoncd/pipeline from 0.54.1 to 0.54.2 | 2023/12/22-02:10
null | [dependabot[bot]] Bump github.com/sigstore/sigstore from 1.7.6 to 1.8.0 | 2023/12/22-03:22
null | [dependabot[bot]] Bump k8s.io/cli-runtime from 0.26.11 to 0.26.12 | 2023/12/22-04:20
null | [dependabot[bot]] Bump github.com/tektoncd/pipeline from 0.54.2 to 0.55.0 | 2023/12/22-06:58
null | [Piyush Garg] Bump sigstore/cosign to v2.2.2 | 2023/12/22-13:42
null | [PuneetPunamiya] Adds hub version in output of `tkn version` command | 2024/01/03-07:22
null | [dependabot[bot]] Bump golang.org/x/term from 0.15.0 to 0.16.0 | 2024/01/07-07:54
null | [dependabot[bot]] Bump github.com/cloudflare/circl from 1.3.5 to 1.3.7 | 2024/01/09-06:54
null | [vinamra28] Bump golang and goreleaser versions | 2024/01/11-11:12

Signed-off-by: vinamra28 <jvinamra776@gmail.com>
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. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants