Skip to content

Commit

Permalink
Merge pull request #2974 from Shell32-Natsu/function-definition
Browse files Browse the repository at this point in the history
remove not used args & use const string instead of literal
  • Loading branch information
monopole committed Sep 15, 2020
2 parents 29a444f + e5809e4 commit f864e15
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/config/internal/commands/run-fns.go
Expand Up @@ -108,7 +108,7 @@ func (r *RunFnRunner) runE(c *cobra.Command, args []string) error {

// getContainerFunctions parses the commandline flags and arguments into explicit
// Functions to run.
func (r *RunFnRunner) getContainerFunctions(c *cobra.Command, args, dataItems []string) (
func (r *RunFnRunner) getContainerFunctions(c *cobra.Command, dataItems []string) (
[]*yaml.RNode, error) {

if r.Image == "" && r.StarPath == "" && r.ExecPath == "" && r.StarURL == "" {
Expand Down Expand Up @@ -202,7 +202,7 @@ data: {}
}
err = rc.PipeE(
yaml.LookupCreate(yaml.MappingNode, "metadata", "annotations"),
yaml.SetField("config.kubernetes.io/function", yaml.NewScalarRNode(value)))
yaml.SetField(runtimeutil.FunctionAnnotationKey, yaml.NewScalarRNode(value)))
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -276,7 +276,7 @@ func (r *RunFnRunner) preRunE(c *cobra.Command, args []string) error {
return errors.Errorf("0 or 1 arguments supported, function arguments go after '--'")
}

fns, err := r.getContainerFunctions(c, args, dataItems)
fns, err := r.getContainerFunctions(c, dataItems)
if err != nil {
return err
}
Expand Down

0 comments on commit f864e15

Please sign in to comment.