Skip to content

fix: correct --sbom-dir flag description (file → directory)#1648

Merged
imjasonh merged 1 commit intoko-build:mainfrom
immanuwell:fix/sbom-dir-flag-description
May 9, 2026
Merged

fix: correct --sbom-dir flag description (file → directory)#1648
imjasonh merged 1 commit intoko-build:mainfrom
immanuwell:fix/sbom-dir-flag-description

Conversation

@immanuwell
Copy link
Copy Markdown
Contributor

@immanuwell immanuwell commented May 9, 2026

--sbom-dir has been described as "Path to file where the SBOM will be written." since it landed in #822 — but the flag is clearly a directory, not a file.

How to reproduce:

ko build --help | grep sbom-dir
# Path to file where the SBOM will be written.  ← wrong

The impl literally does os.MkdirAll on the value and then drops files inside it:

// pkg/build/gobuild.go
sbomDir := filepath.Clean(dir)
os.MkdirAll(sbomDir, os.ModePerm)          // creates a dir
sbomPath := filepath.Join(sbomDir, ...)    // writes file inside it

Even the field is named SBOMDir and the flag is --sbom-dir lol.

Fix: one-word change in the flag description (filedirectory) + regenerated docs via ./hack/update-codegen.sh. No behavior change.

./hack/presubmit.sh passes.

Copilot AI review requested due to automatic review settings May 9, 2026 11:45
Copy link
Copy Markdown
Contributor

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 fixes an incorrect CLI help/flag description for --sbom-dir, clarifying that the flag value is a directory (not a file), and updates the generated reference docs accordingly.

Changes:

  • Update the --sbom-dir flag help text from “Path to file …” to “Path to directory …”.
  • Regenerate/update the CLI reference docs so all command pages reflect the corrected description.

Reviewed changes

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

Show a summary per file
File Description
pkg/commands/options/build.go Corrects the --sbom-dir cobra flag description to indicate a directory.
docs/reference/ko_build.md Updates generated CLI docs for ko build to reflect the corrected --sbom-dir description.
docs/reference/ko_run.md Updates generated CLI docs for ko run to reflect the corrected --sbom-dir description.
docs/reference/ko_resolve.md Updates generated CLI docs for ko resolve to reflect the corrected --sbom-dir description.
docs/reference/ko_create.md Updates generated CLI docs for ko create to reflect the corrected --sbom-dir description.
docs/reference/ko_apply.md Updates generated CLI docs for ko apply to reflect the corrected --sbom-dir description.

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

@imjasonh imjasonh enabled auto-merge (rebase) May 9, 2026 12:57
@imjasonh imjasonh merged commit e341d80 into ko-build:main May 9, 2026
21 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants