Skip to content

Commit

Permalink
CLI fixups (#113)
Browse files Browse the repository at this point in the history
* Fixup omitempty tag. Causes marshaler to go crazy

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>

* Bind ELEMENTAL_TARGET to target

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
  • Loading branch information
mudler committed Feb 18, 2022
1 parent 22cfa40 commit 9f1859e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var installCmd = &cobra.Command{
Short: "elemental installer",
Args: cobra.MaximumNArgs(1),
PreRun: func(cmd *cobra.Command, args []string) {
viper.BindEnv("target", "ELEMENTAL_TARGET")
viper.BindPFlags(cmd.Flags())
},
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
2 changes: 1 addition & 1 deletion pkg/types/v1/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ type RunConfig struct {
Reboot bool `yaml:"reboot,omitempty" mapstructure:"reboot"`
PowerOff bool `yaml:"poweroff,omitempty" mapstructure:"poweroff"`
DirectoryUpgrade string // configured only via flag, no need to map it to any config
ChannelUpgrades bool `yaml:"CHANNEL_UPGRADES, omitempty" mapstructure:"CHANNEL_UPGRADES"`
ChannelUpgrades bool `yaml:"CHANNEL_UPGRADES,omitempty" mapstructure:"CHANNEL_UPGRADES"`
UpgradeImage string `yaml:"UPGRADE_IMAGE,omitempty" mapstructure:"UPGRADE_IMAGE"`
RecoveryImage string `yaml:"RECOVERY_IMAGE,omitempty" mapstructure:"RECOVERY_IMAGE"`
RecoveryUpgrade bool // configured only via flag, no need to map it to any config
Expand Down

0 comments on commit 9f1859e

Please sign in to comment.