mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
Merge pull request #2974 from Shell32-Natsu/function-definition
remove not used args & use const string instead of literal
This commit is contained in:
@@ -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 == "" {
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user