Skip to content

Commit

Permalink
Remove configCheck from EdenSetup
Browse files Browse the repository at this point in the history
This is prerequisite to use eden as library

Signed-off-by: Pavel Abramov <[email protected]>
  • Loading branch information
uncleDecart committed Oct 19, 2023
1 parent 3bb4736 commit 375ce60
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 3 additions & 0 deletions cmd/edenSetup.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ func newSetupCmd(configName, verbosity *string) *cobra.Command {
Long: `Setup harness.`,
PersistentPreRunE: preRunViperLoadFunction(cfg, configName, verbosity),
Run: func(cmd *cobra.Command, args []string) {
if err := openevec.ConfigCheck(*configName); err != nil {
log.Fatalf("Config check failed %s", err)
}
if err := openEVEC.SetupEden(*configName, configDir, softSerial, zedControlURL, ipxeOverride, grubOptions, netboot, installer); err != nil {

log.Fatalf("Setup eden failed: %s", err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/openevec/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ func resolvePath(v reflect.Value) {
}
}

func configCheck(configName string) error {
func ConfigCheck(configName string) error {

Check failure on line 318 in pkg/openevec/config.go

View workflow job for this annotation

GitHub Actions / yetus

revive: exported function ConfigCheck should have comment or be unexported https://revive.run/r#exported
configFile := utils.GetConfig(configName)
configSaved := utils.ResolveAbsPath(fmt.Sprintf("%s-%s", configName, defaults.DefaultConfigSaved))

Expand Down
4 changes: 0 additions & 4 deletions pkg/openevec/eden.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ func (openEVEC *OpenEVEC) SetupEden(configName, configDir, softSerial, zedContro

cfg := *openEVEC.cfg

if err := configCheck(configName); err != nil {
return err
}

if netboot && installer {
return fmt.Errorf("please use netboot or installer flag, not both")
}
Expand Down

0 comments on commit 375ce60

Please sign in to comment.