MCPcopy Index your code
hub / github.com/devspace-sh/devspace / newContextCmd

Function newContextCmd

cmd/use/context.go:20–43  ·  view source on GitHub ↗
(f factory.Factory, globalFlags *flags.GlobalFlags)

Source from the content-addressed store, hash-verified

18}
19
20func newContextCmd(f factory.Factory, globalFlags *flags.GlobalFlags) *cobra.Command {
21 cmd := &ContextCmd{GlobalFlags: globalFlags}
22
23 useContext := &cobra.Command{
24 Use: "context",
25 Short: "Tells DevSpace which kube context to use",
26 Long: `
27#######################################################
28############### devspace use context ##################
29#######################################################
30Switches the current kube-context
31
32Example:
33devspace use context my-context
34#######################################################
35 `,
36 Args: cobra.MaximumNArgs(1),
37 RunE: func(cobraCmd *cobra.Command, args []string) error {
38 return cmd.RunUseContext(f, args)
39 },
40 }
41
42 return useContext
43}
44
45// RunUseContext executes the functionality "devspace use namespace"
46func (cmd *ContextCmd) RunUseContext(f factory.Factory, args []string) error {

Callers 1

NewUseCmdFunction · 0.70

Calls 1

RunUseContextMethod · 0.95

Tested by

no test coverage detected