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

Fix converted legacy bundle->remote resolver syntax to be case-insensitive for kind #6061

Merged

Conversation

abayer
Copy link
Contributor

@abayer abayer commented Jan 27, 2023

Changes

fixes #6058

When we finished deprecating the legacy bundle resolution syntax, we recommended users change from:

      taskRef:
        name: git-batch-merge
        bundle: gcr.io/tekton-releases/catalog/upstream/git-batch-merge:0.2

to

      taskRef:
        resolver: bundles
        params:
          - name: bundle
            value: gcr.io/tekton-releases/catalog/upstream/git-batch-merge:0.2
          - name: name
            value: git-batch-merge
          - name: kind
            value: Task

But that created a problem - we have been comparing the kind parameter to the dev.tekton.image.kind annotation value in the bundle, which is generally all lower-case. Since we generally use Task, Pipeline, etc for kind values in our syntax, we've created a situation where the "normal" way to specify a kind, i.e., capitalized, is not going to work for most, if not all, bundles.

To fix this, we're changing the check in the remote bundles resolver to do a case-insensitive comparison.

/kind bug

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

The remote bundles resolver now matches the kind value in its parameters and in bundle layers in a case-insensitive manner.

@abayer abayer added the kind/bug Categorizes issue or PR as related to a bug. label Jan 27, 2023
@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 27, 2023
@tekton-robot tekton-robot requested review from dibyom and wlynch January 27, 2023 13:45
@abayer
Copy link
Contributor Author

abayer commented Jan 27, 2023

/assign @afrittoli @chuangw6 @JeromeJu

@tekton-robot
Copy link
Collaborator

@abayer: GitHub didn't allow me to assign the following users: JeromeJu.

Note that only tektoncd members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

/assign @afrittoli @chuangw6 @JeromeJu

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.

…itive for kind

fixes tektoncd#6058

When we finished deprecating the legacy bundle resolution syntax, we recommended users change from:
```
      taskRef:
        name: git-batch-merge
        bundle: gcr.io/tekton-releases/catalog/upstream/git-batch-merge:0.2
```
to
```
      taskRef:
        resolver: bundles
        params:
          - name: bundle
            value: gcr.io/tekton-releases/catalog/upstream/git-batch-merge:0.2
          - name: name
            value: git-batch-merge
          - name: kind
            value: Task
```

But that created a problem - we have been comparing the `kind` parameter to the `dev.tekton.image.kind` annotation value in the bundle, which is generally all lower-case. Since we generally use `Task`, `Pipeline`, etc for `kind` values in our syntax, we've created a situation where the "normal" way to specify a `kind`, i.e., capitalized, is not going to work for most, if not all, bundles.

To fix this, we're changing the check in the remote bundles resolver to do a case-insensitive comparison.

Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
@abayer abayer force-pushed the case-insensitive-bundle-resolver-kind branch from 659fb04 to cddc1c6 Compare January 27, 2023 18:52
@JeromeJu
Copy link
Member

LTGM just one last nit will it be helpful to also include this 'notice' at https://github.com/tektoncd/pipeline/blob/main/docs/bundle-resolver.md?

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

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

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 Jan 30, 2023
@jerop jerop added this to the Pipelines v0.45 milestone Jan 30, 2023
@abayer
Copy link
Contributor Author

abayer commented Jan 30, 2023

/test check-pr-has-kind-label

@tekton-robot
Copy link
Collaborator

@abayer: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test pull-tekton-pipeline-alpha-integration-tests
  • /test pull-tekton-pipeline-build-tests
  • /test pull-tekton-pipeline-integration-tests
  • /test tekton-pipeline-unit-tests

The following commands are available to trigger optional jobs:

  • /test pull-tekton-pipeline-go-coverage

Use /test all to run all jobs.

In response to this:

/test check-pr-has-kind-label

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.

Copy link
Member

@afrittoli afrittoli left a comment

Choose a reason for hiding this comment

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

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 31, 2023
@tekton-robot tekton-robot merged commit 66cdefa into tektoncd:main Jan 31, 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/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Legacy bundle syntax does not work with remote resoruces
6 participants