(f factory.Factory, globalFlags *flags.GlobalFlags)
| 18 | } |
| 19 | |
| 20 | func 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 | ####################################################### |
| 30 | Switches the current kube-context |
| 31 | |
| 32 | Example: |
| 33 | devspace 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" |
| 46 | func (cmd *ContextCmd) RunUseContext(f factory.Factory, args []string) error { |
no test coverage detected