Skip to content

Commit

Permalink
Remove UpdatedContext function from context
Browse files Browse the repository at this point in the history
Removing the function since what it does seems to be already present in
the calling blocks of code.
  • Loading branch information
dharmit committed Dec 21, 2020
1 parent 051ad88 commit 00bfa66
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
9 changes: 0 additions & 9 deletions pkg/odo/cli/component/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -1059,11 +1059,6 @@ func (co *CreateOptions) s2iRun() (err error) {
return errors.Wrapf(err, "failed to persist the component settings to config file")
}
if co.now {
co.Context, co.LocalConfigInfo, err = genericclioptions.UpdatedContext(co.Context)

if err != nil {
return errors.Wrap(err, "unable to retrieve updated local config")
}
err = co.SetSourceInfo()
if err != nil {
return errors.Wrap(err, "unable to set source information")
Expand Down Expand Up @@ -1205,10 +1200,6 @@ func (co *CreateOptions) Run() (err error) {

if log.IsJSON() {
var componentDesc component.Component
co.Context, co.LocalConfigInfo, err = genericclioptions.UpdatedContext(co.Context)
if err != nil {
return err
}
state := component.GetComponentState(co.Client, *co.componentSettings.Name, co.Context.Application)

if state == component.StateTypeNotPushed || state == component.StateTypeUnknown {
Expand Down
6 changes: 0 additions & 6 deletions pkg/odo/genericclioptions/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,6 @@ func NewContextCompletion(command *cobra.Command) *Context {
return newContext(command, false, true)
}

// UpdatedContext returns a new context updated from config file
func UpdatedContext(context *Context) (*Context, *config.LocalConfigInfo, error) {
localConfiguration, err := getValidConfig(context.command, false)
return newContext(context.command, true, false), localConfiguration, err
}

// newContext creates a new context based on the command flags, creating missing app when requested
func newContext(command *cobra.Command, createAppIfNeeded bool, ignoreMissingConfiguration bool) *Context {
// Create a new occlient
Expand Down

0 comments on commit 00bfa66

Please sign in to comment.