Skip to content

filecontent argument fields appear to accept multiple arguments #346

@negz

Description

@negz

I just updated to the latest commit (919e701) because I wanted to use the new type:"filecontent" feature (thank you!). It works as expected, but I notice in the help output the argument is followed by ..., which I believe implies multiple arguments could be supplied. Is this an artifact of the field type being []byte?

See <function-io> in the help output below.

$ _output/bin/linux_arm64/xfn run negz/xfn-nop:latest ~/fnio.yaml moo
Usage: crossplane run <image> <function-io> ...

Run a Composition Function.

Arguments:
  <image>              OCI image to run.
  <function-io> ...    YAML encoded FunctionIO to pass to the function.

Flags:
  -h, --help                   Show context-sensitive help.
  -d, --debug                  Print verbose logging statements.
  -v, --version                Print version and quit.

  -c, --cache-dir="/xfn"       Directory used for caching function images and containers.
      --timeout=30s            Maximum time for which the function may run before being killed.
      --map-root-uid=100000    UID that will map to 0 in the function's user namespace. The following 65336 UIDs must be available. Ignored if xfn does not have CAP_SETUID and CAP_SETGID.
      --map-root-gid=100000    GID that will map to 0 in the function's user namespace. The following 65336 GIDs must be available. Ignored if xfn does not have CAP_SETUID and CAP_SETGID.
// Command runs a Composition function.
type Command struct {
	CacheDir   string        `short:"c" help:"Directory used for caching function images and containers." default:"/xfn"`
	Timeout    time.Duration `help:"Maximum time for which the function may run before being killed." default:"30s"`
	MapRootUID int           `help:"UID that will map to 0 in the function's user namespace. The following 65336 UIDs must be available. Ignored if xfn does not have CAP_SETUID and CAP_SETGID." default:"100000"`
	MapRootGID int           `help:"GID that will map to 0 in the function's user namespace. The following 65336 GIDs must be available. Ignored if xfn does not have CAP_SETUID and CAP_SETGID." default:"100000"`

	Image      string `arg:"" help:"OCI image to run."`
	FunctionIO []byte `arg:"" help:"YAML encoded FunctionIO to pass to the function." type:"filecontent"`
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions