Skip to content

Add --runtime-class flag to buildrun create#366

Open
IrvingMg wants to merge 1 commit intoshipwright-io:mainfrom
IrvingMg:feature/ship-0040
Open

Add --runtime-class flag to buildrun create#366
IrvingMg wants to merge 1 commit intoshipwright-io:mainfrom
IrvingMg:feature/ship-0040

Conversation

@IrvingMg
Copy link

@IrvingMg IrvingMg commented Jan 13, 2026

Changes

Adds support for the --runtime-class flag.

Fixes #363

/kind feature

Submitter Checklist

  • Includes tests if functionality changed/was added
  • Includes docs if changes are user-facing
  • Set a kind label on this PR
  • Release notes block has been filled in, or marked NONE

See the contributor guide
for details on coding conventions, github and prow interactions, and the code review process.

Release Notes

Added `--runtime-class` flag to `shp buildrun create` command to specify a RuntimeClass for the build pod.

Signed-off-by: Irving Mondragón <mirvingr@gmail.com>
@openshift-ci openshift-ci bot added kind/feature Categorizes issue or PR as related to a new feature. release-note labels Jan 13, 2026
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 13, 2026
@IrvingMg
Copy link
Author

Note: The shipwright-io/build dependency is currently pointing to the main branch since the RuntimeClassName field was added in shipwright-io/build#2079 but not yet included in a release. This can be updated to a proper release version once available.

Copy link
Member

@adambkaplan adambkaplan left a comment

Choose a reason for hiding this comment

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

/approve

Looks good to me, needs a 2nd set of eyes for lgtm

github.com/schollz/progressbar/v3 v3.18.0
github.com/shipwright-io/build v0.18.0
github.com/spf13/cobra v1.10.1
github.com/shipwright-io/build v0.18.2-0.20260112084729-e48a9ff9aa57
Copy link
Member

Choose a reason for hiding this comment

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

👍 - necessary to get the new API. We will update to v0.19.0 when we get ready to release next month.

)
}

// buildRuntimeClassNameFlag registers flags for adding BuildRunSpec.RuntimeClassName
Copy link
Member

Choose a reason for hiding this comment

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

👍

Comment on lines +95 to +101
t.Run(".spec.runtimeClassName", func(_ *testing.T) {
err := flags.Set(RuntimeClassNameFlag, *expected.RuntimeClassName)
g.Expect(err).To(o.BeNil())

g.Expect(expected.RuntimeClassName).To(o.Equal(spec.RuntimeClassName), "spec.runtimeClassName")
})

Copy link
Member

Choose a reason for hiding this comment

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

👍

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 27, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adambkaplan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 27, 2026
@adambkaplan
Copy link
Member

/assign @hasanawad94

/cc @rxinui

For review and /lgtm

@IrvingMg
Copy link
Author

Hi @HeavyWombat @qu1queee @rxinui,

Just checking in on this, it’s approved and ready for LGTM. Could you take a quick look so we can merge and close #363? Thanks!

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds support for the --runtime-class flag to BuildRun-related commands in the Shipwright CLI (shp). The feature allows users to specify a RuntimeClass for build pods, implementing the functionality described in SHIP-0040. The PR includes comprehensive test coverage and documentation updates.

Changes:

  • Added --runtime-class flag to BuildRun creation commands (shp buildrun create, shp build run, shp build upload)
  • Updated vendored dependencies to include the RuntimeClassName field in BuildRunSpec from shipwright-io/build
  • Added test coverage for the new flag functionality

Reviewed changes

Copilot reviewed 7 out of 22 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/shp/flags/flags.go Added RuntimeClassNameFlag constant and buildRuntimeClassNameFlag registration function
pkg/shp/flags/buildrun.go Integrated RuntimeClassName into BuildRunSpecFromFlags and added sanitization logic
pkg/shp/flags/buildrun_test.go Added test cases for RuntimeClassName flag handling and sanitization
docs/shp_buildrun_create.md Updated documentation to include the --runtime-class flag
docs/shp_build_run.md Updated documentation to include the --runtime-class flag
docs/shp_build_upload.md Updated documentation to include the --runtime-class flag
go.mod Updated shipwright-io/build dependency to include RuntimeClassName API support
go.sum Updated checksums for dependency changes
vendor/github.com/shipwright-io/build/pkg/apis/build/v1beta1/buildrun_types.go Added RuntimeClassName field to BuildRunSpec
vendor/github.com/shipwright-io/build/pkg/apis/build/v1beta1/build_types.go Added RuntimeClassName field to BuildSpec and RuntimeClassNameNotValid reason
vendor/modules.txt Updated dependency versions
vendor/github.com/spf13/cobra/* Updated cobra library to v1.10.2
vendor/github.com/onsi/gomega/* Updated gomega library to v1.39.0

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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/feature Categorizes issue or PR as related to a new feature. release-note size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[FEATURE] SHIP-0040: Command line option to set runtime class on Build/BuildRun

3 participants