cli icon indicating copy to clipboard operation
cli copied to clipboard

support v1 for sign and verify command

Open Yongxuanzhang opened this issue 1 year ago • 10 comments

Changes

This commit adds v1 support for sign and verify.

close https://github.com/tektoncd/cli/issues/2214

Submitter Checklist

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

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

See the contribution guide for more details.

Release Notes

tkn supports v1 Task and Pipeline sign and verify

Yongxuanzhang avatar Jan 17 '24 18:01 Yongxuanzhang

Skipping CI for Draft Pull Request. If you want CI signal for your change, please convert it to an actual PR. You can still manually trigger a test run with /test all

tekton-robot avatar Jan 17 '24 18:01 tekton-robot

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: To complete the pull request process, please assign vdemeester after the PR has been reviewed. You can assign the PR to them by writing /assign @vdemeester in a comment when ready.

The full list of commands accepted by this bot can be found 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 avatar Jan 17 '24 18:01 tekton-robot

/kind feature

Yongxuanzhang avatar Jan 17 '24 21:01 Yongxuanzhang

/retest

Yongxuanzhang avatar Jan 17 '24 22:01 Yongxuanzhang

/retest

Yongxuanzhang avatar Jan 18 '24 18:01 Yongxuanzhang

@Yongxuanzhang seems like it needs another rebase 🙏🏼

vdemeester avatar Feb 19 '24 09:02 vdemeester

@Yongxuanzhang seems like it needs another rebase 🙏🏼

Just rebased, sorry for the delay 🙏 I was focusing on something else in the past months

Yongxuanzhang avatar Mar 28 '24 14:03 Yongxuanzhang

@Yongxuanzhang seems like it needs another rebase 🙏🏼

Just rebased, sorry for the delay 🙏 I was focusing on something else in the past months

Did you try with some approach for reading it through yaml ?

piyush-garg avatar Apr 01 '24 08:04 piyush-garg

@Yongxuanzhang seems like it needs another rebase 🙏🏼

Just rebased, sorry for the delay 🙏 I was focusing on something else in the past months

Did you try with some approach for reading it through yaml ?

Sorry I cannot think of a way which is not error prone. :( Like I mentioned before, detecting the content from file can lead to unexpected outcome.

Since it is an experiment feature, why don't we start with the easier one then iterate?

Yongxuanzhang avatar Apr 08 '24 16:04 Yongxuanzhang

Hey @Yongxuanzhang

Coming back to this after a long, you can try something like this which we are already using CLI code

func getApiVersion(pipelineLocation string, httpClient http.Client) (string, error) {
	b, err := file.LoadFileContent(httpClient, pipelineLocation, file.IsYamlFile(), fmt.Errorf("invalid file format for %s: .yaml or .yml file extension and format required", pipelineLocation))
	if err != nil {
		return "", err
	}
	m := map[string]interface{}{}
	err = yaml.UnmarshalStrict(b, &m)
	if err != nil {
		return "nil", err
	}
	return fmt.Sprint(m["apiVersion"]), nil
}

We have this file load function at https://github.com/tektoncd/cli/blob/main/pkg/file/file.go

piyush-garg avatar Jun 21 '24 07:06 piyush-garg

@Yongxuanzhang: PR needs rebase.

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 avatar Nov 03 '25 18:11 tekton-robot