Skip to content

Commit

Permalink
temp fix
Browse files Browse the repository at this point in the history
  • Loading branch information
feloy committed Nov 9, 2021
1 parent e94d0da commit 05b657c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions pkg/odo/cli/component/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (co *CreateOptions) Complete(name string, cmd *cobra.Command, args []string
// Get the app name
co.appName = genericclioptions.ResolveAppFlag(cmd)
// Get the project name
co.devfileMetadata.componentNamespace = co.Context.Project
co.devfileMetadata.componentNamespace = co.Context.GetProject()
// Get DevfilePath
co.DevfilePath = location.DevfileLocation(co.componentContext)
//Check whether the directory already contains a devfile, this check should happen early
Expand Down Expand Up @@ -384,10 +384,13 @@ func NewCmdCreate(name, fullName string) *cobra.Command {
}

func getContext(now bool, cmd *cobra.Command) (*genericclioptions.Context, error) {
params := genericclioptions.NewCreateParameters(cmd)
if now {
return genericclioptions.NewContextCreatingAppIfNeeded(cmd)
params = params.CreateAppIfNeeded()
} else {
params = params.IsOffline()
}
return genericclioptions.NewOfflineContext(cmd)
return genericclioptions.New(params)
}

func getEnvFilePath(componentContext string) string {
Expand Down
2 changes: 1 addition & 1 deletion pkg/odo/genericclioptions/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func New(parameters CreateParameters) (*Context, error) {
isDevfile := odoutil.CheckPathExists(ctx.devfilePath)
if parameters.devfile && isDevfile {
// Parse devfile and validate
devObj, err := devfile.ParseFromFile(ctx.devfilePath)
devObj, err := devfile.ParseAndValidateFromFile(ctx.devfilePath)
if err != nil {
return nil, fmt.Errorf("failed to parse the devfile %s, with error: %s", ctx.devfilePath, err)
}
Expand Down

0 comments on commit 05b657c

Please sign in to comment.