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

[BUG] v1alpha1 Build Strategies with builder-image parameters fail #1431

Open
1 task done
adambkaplan opened this issue Nov 10, 2023 · 2 comments
Open
1 task done
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug.
Milestone

Comments

@adambkaplan
Copy link
Member

Is there an existing issue for this?

  • I have searched the existing issues

Kubernetes Version

1.27

Shipwright Version

v0.12.0

Current Behavior

If a build strategy is created using the v1alpha1 API and includes a parameter with the name builder-image, its value is not set correctly if the Build or BuildRun uses paramValues to set the parameter value.

Expected Behavior

Builds should succeed if the builder-image parameter is declared in the build strategy, even for v1alpha1 APIs. The conversion webhook should not overwrite values if they are present.

Steps To Reproduce

  1. Create a ClusterBuildStrategy that uses the v1alpha1 API and a builder-image parameter

    apiVersion: shipwright.io/v1alpha1
    kind: ClusterBuildStrategy
    metadata:
       name: source-to-image
    spec:
       ...
       parameters:
          - name: builder-image
            description: Builder image for this build strategy
  2. Create a Build that utilizes the build strategy: $ shp build create s2i-ex --strategy source-to-image ...

  3. Start a build referencing this strategy: $ shp build run s2i-ex

Anything else?

Work-around is to use a parameter name that is not builder-image.

For example, source-to-image build strategies can use the s2i-builder-image parameter.

Root issue likely due to the fact we are using "magic parameters" to translate fields that were deprecated in v1alpha1 and removed in v1beta1. I suspect we'll see a similar bug with the dockerfile parameter.

https://github.com/shipwright-io/build/blob/main/pkg/apis/build/v1beta1/build_conversion.go#L167-L186

@adambkaplan adambkaplan added the kind/bug Categorizes issue or PR as related to a bug. label Nov 10, 2023
@qu1queee qu1queee added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Jan 11, 2024
@qu1queee
Copy link
Contributor

From Refinement, @SaschaSchwarze0 @qu1queee , pls take a look.

@adambkaplan adambkaplan added this to the Backlog milestone May 8, 2024
@adambkaplan
Copy link
Member Author

Note - we should consider this bug obsolete when we stop supporting the v1alpha1 API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug.
Projects
Status: Todo
Development

No branches or pull requests

2 participants