diff --git a/cmd/crossplanereleaser/build.go b/cmd/crossplanereleaser/build.go index 297aca5..68c4d03 100644 --- a/cmd/crossplanereleaser/build.go +++ b/cmd/crossplanereleaser/build.go @@ -36,9 +36,10 @@ func (c *buildCmd) Run(fsys afero.Fs) error { func (c *buildCmd) buildPackages(ctx context.Context, fsys afero.Fs, cfg *v1.Config) error { for _, b := range cfg.Builds { buildCfg := &build.PackageBuildConfig{ - PackageDir: b.Dir, - ExamplesDir: b.Examples, - OutputPath: getPackageOutputPath(cfg, &b), + PackageDir: b.Dir, + ExamplesDir: b.Examples, + OutputPath: getPackageOutputPath(cfg, &b), + RuntimeImageTar: b.RuntimeImageTar, } // We need to call mkdir here because crank doesn't do it for us if err := fsys.MkdirAll(filepath.Dir(buildCfg.OutputPath), 0755); err != nil { diff --git a/config/v1/config.go b/config/v1/config.go index 4e7e767..c8f1d7d 100644 --- a/config/v1/config.go +++ b/config/v1/config.go @@ -8,10 +8,11 @@ type Config struct { } type BuildConfig struct { - ID string `json:"id"` - Dir string `json:"dir"` - Examples string `json:"examples"` - NameTemplate string `json:"name_template"` + ID string `json:"id"` + Dir string `json:"dir"` + Examples string `json:"examples"` + NameTemplate string `json:"name_template"` + RuntimeImageTar string `json:"runtime_image_tar"` } type PushConfig struct { diff --git a/internal/build/build.go b/internal/build/build.go index b392ecc..b65ff76 100644 --- a/internal/build/build.go +++ b/internal/build/build.go @@ -5,9 +5,10 @@ import ( ) type PackageBuildConfig struct { - PackageDir string - ExamplesDir string - OutputPath string + PackageDir string + ExamplesDir string + OutputPath string + RuntimeImageTar string } type BuilderBackend interface { diff --git a/internal/build/build_crank.go b/internal/build/build_crank.go index a3020bb..c1d4f15 100644 --- a/internal/build/build_crank.go +++ b/internal/build/build_crank.go @@ -35,6 +35,8 @@ func (c *CrankCLIBackend) BuildPackage(ctx context.Context, cfg *PackageBuildCon if cfg.ExamplesDir != "" { args = append(args, fmt.Sprintf("--examples-root=%s", cfg.ExamplesDir)) } - // TODO: Support setting --controller-tar option + if cfg.RuntimeImageTar != "" { + args = append(args, fmt.Sprintf("--embed-runtime-image-tarball=%s", cfg.RuntimeImageTar)) + } return c.exec(ctx, args...) }