Skip to content

Commit bdf277c

Browse files
committed
Configurable build-disk deploy command
This PR allows the deployment-command used when building expandable disk-images to be configured by the user. Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
1 parent bf2cdb9 commit bdf277c

3 files changed

Lines changed: 3 additions & 1 deletion

File tree

cmd/build-disk.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ func NewBuildDisk(root *cobra.Command, addCheckRoot bool) *cobra.Command {
109109
c.Flags().Bool("unprivileged", false, "Makes a build runnable within a non-privileged container, avoids mounting filesystems (experimental)")
110110
c.Flags().VarP(imgType, "type", "t", "Type of image to create")
111111
c.Flags().StringSliceP("cloud-init", "c", []string{}, "Cloud-init config files")
112+
c.Flags().StringSlice("deploy-command", []string{"elemental", "--debug", "reset", "--reboot"}, "Deployment command for expandable images")
112113
addPlatformFlags(c)
113114
addLocalImageFlag(c)
114115
addSquashFsCompressionFlags(c)

pkg/action/build-disk.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ func (b *BuildDiskAction) createBuildDiskStateYaml(sysMeta, recMeta interface{},
688688
func (b *BuildDiskAction) SetExpandableCloudInitStage() error {
689689
var deployCmd []string
690690

691-
deployCmd = []string{"elemental", "--debug", "reset", "--reboot"}
691+
deployCmd = b.spec.DeployCmd
692692
if !b.spec.Active.Source.IsEmpty() {
693693
deployCmd = append(deployCmd, "--system.uri", b.spec.Active.Source.String())
694694
}

pkg/types/v1/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,7 @@ type DiskSpec struct {
627627
CloudInit []string `yaml:"cloud-init,omitempty" mapstructure:"cloud-init"`
628628
GrubDefEntry string `yaml:"grub-entry-name,omitempty" mapstructure:"grub-entry-name"`
629629
Type string `yaml:"type,omitempty" mapstructure:"type"`
630+
DeployCmd []string `yaml:"deploy-command,omitempty" mapstructure:"deploy-command"`
630631
}
631632

632633
// Sanitize checks the consistency of the struct, returns error

0 commit comments

Comments
 (0)