shipwright-io / build

Shipwright - a framework for building container images on Kubernetes
https://shipwright.io
Apache License 2.0
628 stars 107 forks source link

Correct multiple secret values in one array parameter that references different secret variables #1566

Closed SaschaSchwarze0 closed 3 months ago

SaschaSchwarze0 commented 3 months ago

Changes

There is a bug when defining the following Build:

spec:
  paramValues:
    name: param-name
    values:
    - secretValue:
        name: secret-name
        key: key-1
        format: ARG_NAME1=${SECRET_VALUE}
    - secretValue:
        name: secret-name
        key: key-2
        format: ARG_NAME2=${SECRET_VALUE}

Due to the way we iterate over the values, we caused the TaskRun to only have references to key-2. Unfortunatly, our existing unit test did not capture that. Also extending those.

Submitter Checklist

Release Notes

The usage of different secrets or secret keys as values inside one array parameter is now possible
openshift-ci[bot] commented 3 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qu1queee

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: - ~~[OWNERS](https://github.com/shipwright-io/build/blob/main/OWNERS)~~ [qu1queee] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
SaschaSchwarze0 commented 2 months ago

/cherrypick release-v0.13

openshift-cherrypick-robot commented 2 months ago

@SaschaSchwarze0: new pull request created: #1593

In response to [this](https://github.com/shipwright-io/build/pull/1566#issuecomment-2094863543): >/cherrypick release-v0.13 Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.