Skip to content

Conversation

@nurof3n
Copy link
Contributor

@nurof3n nurof3n commented Oct 10, 2025

Prerequisite checklist

  • Read the contribution guidelines regarding submitting new changes to the project;
  • Tested your changes against relevant architectures and platforms;
  • Ran make fmt on your commit series before opening this PR;
  • Updated relevant documentation.

Description of changes

Add support for specifying the following service build options in the compose.yaml file, when using kraft cloud compose and kraft compose:

  • args
  • target
  • secrets

@github-project-automation github-project-automation bot moved this to 🧊 Icebox in KraftKit Roadmap Oct 10, 2025
@nurof3n nurof3n changed the title Compose file build options feat: Compose file build options Oct 10, 2025
@nurof3n nurof3n force-pushed the nurof3n/compose-build-options branch from 9d060f3 to 3f94bb2 Compare October 11, 2025 10:54
@nurof3n nurof3n requested a review from nderjung October 11, 2025 10:58
initrd/rootfs.go Outdated
// BuildRootfs generates a rootfs based on the provided working directory and
// the rootfs entrypoint for the provided target(s).
func BuildRootfs(ctx context.Context, workdir, rootfs string, compress bool, arch string) (initrd.Initrd, []string, []string, error) {
func BuildRootfs(ctx context.Context, workdir, rootfs string, compress bool, arch string, initrdOptions []InitrdOption) (Initrd, []string, []string, error) {
Copy link
Member

@nderjung nderjung Oct 13, 2025

Choose a reason for hiding this comment

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

Let's turn the prototype into an options pattern:

- func BuildRootfs(ctx context.Context, workdir, rootfs string, compress bool, arch string, initrdOptions []InitrdOption) (Initrd, []string, []string, error) {
+ func BuildRootfs(ctx context.Context, opts ...InitrdOption) (Initrd, []string, []string, error) {

Later:

var bopts InitrdOoptions
for _, opt := range opts {
  if err := opt(&bopts); err != nil {
     return nil, nil, nil, err
  }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

with these changes the processing of paths is moved to the callers, do you want me to move it inside WithOutput and WithCacheDir?

@craciunoiuc craciunoiuc requested a review from nderjung November 10, 2025 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🧊 Icebox

Development

Successfully merging this pull request may close these issues.

2 participants