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:
girish ramnani
2019-03-04 22:26:24 +05:30
committed by GitHub
parent 7fef28a7c9
commit 2a47599245
25 changed files with 2535 additions and 2173 deletions

View File

@@ -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")
}