diff --git a/pkg/odo/cli/component/create.go b/pkg/odo/cli/component/create.go index 6809afcd06b..eb32826ef57 100644 --- a/pkg/odo/cli/component/create.go +++ b/pkg/odo/cli/component/create.go @@ -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") @@ -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 { diff --git a/pkg/odo/genericclioptions/context.go b/pkg/odo/genericclioptions/context.go index d26e5a23c4a..848b1ad6ec9 100644 --- a/pkg/odo/genericclioptions/context.go +++ b/pkg/odo/genericclioptions/context.go @@ -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