Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move functions to separate files in context package #4231

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions pkg/odo/genericclioptions/add_flags.go

This file was deleted.

29 changes: 29 additions & 0 deletions pkg/odo/genericclioptions/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package genericclioptions

import (
"github.com/openshift/odo/pkg/kclient"
"github.com/openshift/odo/pkg/occlient"
"github.com/openshift/odo/pkg/odo/util"
"github.com/spf13/cobra"
)

// Client returns an oc client configured for this command's options
func Client(command *cobra.Command) *occlient.Client {
return client(command)
}

// client creates an oc client based on the command flags
func client(command *cobra.Command) *occlient.Client {
client, err := occlient.New()
util.LogErrorAndExit(err, "")

return client
}

// kClient creates an kclient based on the command flags
func kClient(command *cobra.Command) *kclient.Client {
kClient, err := kclient.New()
util.LogErrorAndExit(err, "")

return kClient
}
Loading