cmd: make createDeployment a private function
This commit is contained in:
parent
f9913c4948
commit
066dbb7206
@ -49,7 +49,7 @@ func NewCmdCreateDeployment(f cmdutil.Factory, cmdOut, cmdErr io.Writer) *cobra.
|
||||
Long: deploymentLong,
|
||||
Example: deploymentExample,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
err := CreateDeployment(f, cmdOut, cmdErr, cmd, args)
|
||||
err := createDeployment(f, cmdOut, cmdErr, cmd, args)
|
||||
cmdutil.CheckErr(err)
|
||||
},
|
||||
}
|
||||
@ -62,8 +62,7 @@ func NewCmdCreateDeployment(f cmdutil.Factory, cmdOut, cmdErr io.Writer) *cobra.
|
||||
return cmd
|
||||
}
|
||||
|
||||
// CreateDeployment implements the behavior to run the create deployment command
|
||||
func CreateDeployment(f cmdutil.Factory, cmdOut, cmdErr io.Writer, cmd *cobra.Command, args []string) error {
|
||||
func createDeployment(f cmdutil.Factory, cmdOut, cmdErr io.Writer, cmd *cobra.Command, args []string) error {
|
||||
name, err := NameFromCommandArgs(cmd, args)
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -80,6 +80,6 @@ func TestCreateDeploymentNoImage(t *testing.T) {
|
||||
cmd := NewCmdCreateDeployment(f, buf, buf)
|
||||
cmd.Flags().Set("dry-run", "true")
|
||||
cmd.Flags().Set("output", "name")
|
||||
err := CreateDeployment(f, buf, buf, cmd, []string{depName})
|
||||
err := createDeployment(f, buf, buf, cmd, []string{depName})
|
||||
assert.Error(t, err, "at least one image must be specified")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user