Skip to content

Commit c20fa28

Browse files
authored
[v1.1.x] Move recovery hostname to cloud-config-defaults (#2047)
* Move recovery hostname to cloud-config-defaults Setting recovery hostname is mostly a nice-to-have and can be destructive so move it to cloud-config-defaults feature. Signed-off-by: Fredrik Lönnegren <[email protected]> * Fix lints Signed-off-by: Fredrik Lönnegren <[email protected]> --------- Signed-off-by: Fredrik Lönnegren <[email protected]>
1 parent bc91df2 commit c20fa28

File tree

12 files changed

+16
-13
lines changed

12 files changed

+16
-13
lines changed

cmd/build-disk.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func NewBuildDisk(root *cobra.Command, addCheckRoot bool) *cobra.Command {
4040
Use: "build-disk image",
4141
Short: "Build a disk image using the given image (experimental and subject to change)",
4242
Args: cobra.MaximumNArgs(1),
43-
PreRunE: func(cmd *cobra.Command, args []string) error {
43+
PreRunE: func(_ *cobra.Command, _ []string) error {
4444
if addCheckRoot {
4545
return CheckRoot()
4646
}

cmd/build-iso.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func NewBuildISO(root *cobra.Command, addCheckRoot bool) *cobra.Command {
4343
" * <sourceType> - might be [\"dir\", \"file\", \"oci\", \"docker\", \"channel\"], as default is \"docker\"\n" +
4444
" * <sourceName> - is path to file or directory, image name with tag version or channel name",
4545
Args: cobra.MaximumNArgs(1),
46-
PreRunE: func(cmd *cobra.Command, args []string) error {
46+
PreRunE: func(_ *cobra.Command, _ []string) error {
4747
if addCheckRoot {
4848
return CheckRoot()
4949
}

cmd/cloud-init.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func NewCloudInitCmd(root *cobra.Command) *cobra.Command {
3535
Use: "cloud-init",
3636
Short: "Run cloud-init",
3737
Args: cobra.MinimumNArgs(1),
38-
PreRun: func(cmd *cobra.Command, args []string) {
38+
PreRun: func(cmd *cobra.Command, _ []string) {
3939
_ = viper.BindPFlags(cmd.Flags())
4040
},
4141
RunE: func(cmd *cobra.Command, args []string) error {

cmd/config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ func ReadConfigRun(configDir string, flags *pflag.FlagSet, mounter mount.Interfa
184184
cfgExtra := filepath.Join(configDir, "config.d")
185185
if exists, _ := utils.Exists(cfg.Fs, cfgExtra); exists {
186186
viper.AddConfigPath(cfgExtra)
187-
err := filepath.WalkDir(cfgExtra, func(path string, d fs.DirEntry, err error) error {
187+
err := filepath.WalkDir(cfgExtra, func(_ string, d fs.DirEntry, _ error) error {
188188
if !d.IsDir() && filepath.Ext(d.Name()) == ".yaml" {
189189
viper.SetConfigType("yaml")
190190
viper.SetConfigName(strings.TrimSuffix(d.Name(), ".yaml"))

cmd/install.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func NewInstallCmd(root *cobra.Command, addCheckRoot bool) *cobra.Command {
3737
Use: "install DEVICE",
3838
Short: "Elemental installer",
3939
Args: cobra.MaximumNArgs(1),
40-
PreRunE: func(cmd *cobra.Command, args []string) error {
40+
PreRunE: func(_ *cobra.Command, _ []string) error {
4141
if addCheckRoot {
4242
return CheckRoot()
4343
}

cmd/pull-image.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func NewPullImageCmd(root *cobra.Command, addCheckRoot bool) *cobra.Command {
3333
Use: "pull-image IMAGE DESTINATION",
3434
Short: "Pull remote image to local file",
3535
Args: cobra.ExactArgs(2),
36-
PreRunE: func(cmd *cobra.Command, args []string) error {
36+
PreRunE: func(_ *cobra.Command, _ []string) error {
3737
if addCheckRoot {
3838
return CheckRoot()
3939
}

cmd/reset.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ func NewResetCmd(root *cobra.Command, addCheckRoot bool) *cobra.Command {
3333
Use: "reset",
3434
Short: "Reset OS",
3535
Args: cobra.ExactArgs(0),
36-
PreRunE: func(cmd *cobra.Command, args []string) error {
36+
PreRunE: func(_ *cobra.Command, _ []string) error {
3737
if addCheckRoot {
3838
return CheckRoot()
3939
}
4040
return nil
4141
},
42-
RunE: func(cmd *cobra.Command, args []string) error {
42+
RunE: func(cmd *cobra.Command, _ []string) error {
4343
path, err := exec.LookPath("mount")
4444
if err != nil {
4545
return err

cmd/run-stage.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func NewRunStage(root *cobra.Command) *cobra.Command {
3131
Use: "run-stage STAGE",
3232
Short: "Run stage from cloud-init",
3333
Args: cobra.MinimumNArgs(1),
34-
PreRun: func(cmd *cobra.Command, args []string) {
34+
PreRun: func(_ *cobra.Command, _ []string) {
3535

3636
},
3737
RunE: func(cmd *cobra.Command, args []string) error {

cmd/upgrade.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ func NewUpgradeCmd(root *cobra.Command, addCheckRoot bool) *cobra.Command {
3636
Use: "upgrade",
3737
Short: "Upgrade the system",
3838
Args: cobra.ExactArgs(0),
39-
PreRunE: func(cmd *cobra.Command, args []string) error {
39+
PreRunE: func(_ *cobra.Command, _ []string) error {
4040
if addCheckRoot {
4141
return CheckRoot()
4242
}
4343
return nil
4444
},
4545

46-
RunE: func(cmd *cobra.Command, args []string) error {
46+
RunE: func(cmd *cobra.Command, _ []string) error {
4747
path, err := exec.LookPath("mount")
4848
if err != nil {
4949
return err

cmd/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func NewVersionCmd(root *cobra.Command) *cobra.Command {
2929
Use: "version",
3030
Args: cobra.ExactArgs(0),
3131
Short: "Print the version",
32-
Run: func(cmd *cobra.Command, args []string) {
32+
Run: func(cmd *cobra.Command, _ []string) {
3333
v := version.Get()
3434
commit := v.GitCommit
3535
if len(commit) > 7 {

0 commit comments

Comments
 (0)