Skip to content

Commit

Permalink
Fixes and improves storage create CLI code
Browse files Browse the repository at this point in the history
  • Loading branch information
mik-dass committed Jan 20, 2021
1 parent dc76e24 commit 371c582
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/odo/cli/storage/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (o *CreateOptions) Complete(name string, cmd *cobra.Command, args []string)
// Validate validates the CreateOptions based on completed values
func (o *CreateOptions) Validate() (err error) {
// validate the storage
return o.LocalConfigInfo.ValidateStorage(o.storage)
return o.LocalConfigProvider.ValidateStorage(o.storage)
}

// Run contains the logic for the odo storage create command
Expand All @@ -82,9 +82,8 @@ func (o *CreateOptions) Run() (err error) {
return err
}

storageResultMachineReadable := storage.GetMachineReadableFormat(o.storage.Name, o.storage.Size, o.storage.Path)

if log.IsJSON() {
storageResultMachineReadable := storage.GetMachineReadableFormat(o.storage.Name, o.storage.Size, o.storage.Path)
machineoutput.OutputSuccess(storageResultMachineReadable)
} else {
log.Successf("Added storage %v to %v", o.storageName, o.Context.LocalConfigProvider.GetName())
Expand Down

0 comments on commit 371c582

Please sign in to comment.