mirror of
https://github.com/redhat-developer/odo.git
synced 2025-10-19 03:06:19 +03:00
broke out the preferences and config (#1362)
* broke out the preferences and config * resolved UTs * resolved golangCI comments * resolved some e2e tests * resolved error message in tests * Resolved codeclimate issue * resolved the e2e_test failure * resolved some comments on the PR * renamed GlobalConfig to Preference * made the logic of unset simpler * reverted the test changed * use log instead of fmt for output * resolved e2e test * use log.Info instead of log.Println
This commit is contained in:
@@ -3,9 +3,9 @@ package project
|
||||
import (
|
||||
"github.com/golang/glog"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/redhat-developer/odo/pkg/config"
|
||||
"github.com/redhat-developer/odo/pkg/log"
|
||||
"github.com/redhat-developer/odo/pkg/occlient"
|
||||
"github.com/redhat-developer/odo/pkg/preference"
|
||||
)
|
||||
|
||||
// ApplicationInfo holds information about one project
|
||||
@@ -26,7 +26,7 @@ func GetCurrent(client *occlient.Client) string {
|
||||
func SetCurrent(client *occlient.Client, projectName string) error {
|
||||
currentProject := GetCurrent(client)
|
||||
|
||||
cfg, err := config.New()
|
||||
cfg, err := preference.New()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "unable to access config file")
|
||||
}
|
||||
@@ -91,7 +91,7 @@ func Delete(client *occlient.Client, projectName string) (string, error) {
|
||||
}
|
||||
|
||||
// delete from config
|
||||
cfg, err := config.New()
|
||||
cfg, err := preference.New()
|
||||
if err != nil {
|
||||
return "", errors.Wrapf(err, "unable to delete project from config file")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user