Skip to content

Commit

Permalink
Fix the comments of the binding cmd. (kubernetes-retired#2611)
Browse files Browse the repository at this point in the history
  • Loading branch information
wayilau authored and yangweiwei committed May 10, 2019
1 parent b500fb2 commit 20d9061
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/svcat/binding/bind_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ func NewBindCmd(cxt *command.Context) *cobra.Command {
return cmd
}

// Validate checks that the required arguments have been provided
func (c *bindCmd) Validate(args []string) error {
if len(args) == 0 {
return fmt.Errorf("an instance name is required")
Expand Down Expand Up @@ -126,6 +127,8 @@ func (c *bindCmd) Validate(args []string) error {
return nil
}

// Run creates the binding.
// An error returned when failed.
func (c *bindCmd) Run() error {
return c.bind()
}
Expand Down
2 changes: 2 additions & 0 deletions cmd/svcat/binding/describe_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func NewDescribeCmd(cxt *command.Context) *cobra.Command {
return cmd
}

// Validate checks that the required arguments have been provided
func (c *describeCmd) Validate(args []string) error {
if len(args) == 0 {
return fmt.Errorf("a binding name is required")
Expand All @@ -60,6 +61,7 @@ func (c *describeCmd) Validate(args []string) error {
return nil
}

// Run print the secret of a binding which retrieved by name and namespace.
func (c *describeCmd) Run() error {
return c.describe()
}
Expand Down
3 changes: 3 additions & 0 deletions cmd/svcat/binding/get_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func NewGetCmd(cxt *command.Context) *cobra.Command {
return cmd
}

// Validate checks that the required arguments have been provided
func (c *getCmd) Validate(args []string) error {
if len(args) > 0 {
c.name = args[0]
Expand All @@ -61,6 +62,8 @@ func (c *getCmd) Validate(args []string) error {
return nil
}

// Run get all bindings when the name of the getcmd is not empty,
// otherwise get single.
func (c *getCmd) Run() error {
if c.name == "" {
return c.getAll()
Expand Down
2 changes: 2 additions & 0 deletions cmd/svcat/binding/unbind_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ func NewUnbindCmd(cxt *command.Context) *cobra.Command {
return cmd
}

// Validate checks that the required arguments have been provided
func (c *unbindCmd) Validate(args []string) error {
if len(args) == 0 {
if len(c.bindingNames) == 0 {
Expand All @@ -99,6 +100,7 @@ func (c *unbindCmd) Validate(args []string) error {
return nil
}

// Run delete bindings by the name of the instance.
func (c *unbindCmd) Run() error {
// Indicates an error occurred and that a non-zero exit code should be used
var hasErrors bool
Expand Down

0 comments on commit 20d9061

Please sign in to comment.