Skip to content

Commit

Permalink
test for parameters with space (#1931)
Browse files Browse the repository at this point in the history
* test for parameters with space

Signed-off-by: Simpcyclassy <chioma.onyekpere@gmail.com>

* add contributor

Signed-off-by: Simpcyclassy <chioma.onyekpere@gmail.com>

* handle bundle parameter escape

Signed-off-by: Simpcyclassy <chioma.onyekpere@gmail.com>

* update parameters documentation

Signed-off-by: Simpcyclassy <chioma.onyekpere@gmail.com>

* Merge branch 'release/v1' into parameter-space-error

Signed-off-by: Simpcyclassy <chioma.onyekpere@gmail.com>

* array to slice paramenter

Signed-off-by: Simpcyclassy <chioma.onyekpere@gmail.com>

* define params as array var

Signed-off-by: Simpcyclassy <chioma.onyekpere@gmail.com>

* add schema version to yaml file

Signed-off-by: Simpcyclassy <chioma.onyekpere@gmail.com>

* Help get PR merged

* Run mage build to generate the cli command documentation to include
  the recent changes
* Skip the failing test that was added. This PR has enough to fix the
  comma parsing, and a follow-up will fix this failing test for when a
parameter has a space in it.

Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>

* Fix merge conflicts with release/v1

Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>

Co-authored-by: Carolyn Van Slyck <me@carolynvanslyck.com>
  • Loading branch information
Simpcyclassy and carolynvs authored Apr 29, 2022
1 parent 8ba9ade commit cba074a
Show file tree
Hide file tree
Showing 13 changed files with 202 additions and 123 deletions.
3 changes: 2 additions & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ and we will add you. **All** contributors belong here. 💯
* [Mahendra Bishnoi](https://github.com/mahendrabishnoi2)
* [Yingrong Zhao](https://github.com/VinozzZ)
* [Saksham Sharma](https://github.com/sakkshm26)
* [Jeremy Goss](https://github.com/Jemgoss)
* [Jeremy Goss](https://github.com/Jemgoss)
* [Chioma Onyekpere](https://github.com/Simpcyclassy)
16 changes: 8 additions & 8 deletions cmd/porter/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ For example, the 'debug' driver may be specified, which simply logs the info giv
"Path to the porter manifest file. Defaults to the bundle in the current directory.")
f.StringVar(&opts.CNABFile, "cnab-file", "",
"Path to the CNAB bundle.json file.")
f.StringSliceVarP(&opts.ParameterSets, "parameter-set", "p", nil,
f.StringArrayVarP(&opts.ParameterSets, "parameter-set", "p", nil,
"Name of a parameter set for the bundle. It should be a named set of parameters and may be specified multiple times.")
f.StringSliceVar(&opts.Params, "param", nil,
f.StringArrayVar(&opts.Params, "param", nil,
"Define an individual parameter in the form NAME=VALUE. Overrides parameters otherwise set via --parameter-set. May be specified multiple times.")
f.StringSliceVarP(&opts.CredentialIdentifiers, "cred", "c", nil,
"Credential to use when installing the bundle. It should be a named set of credentials and may be specified multiple times.")
Expand Down Expand Up @@ -223,9 +223,9 @@ For example, the 'debug' driver may be specified, which simply logs the info giv
"Path to the porter manifest file. Defaults to the bundle in the current directory.")
f.StringVar(&opts.CNABFile, "cnab-file", "",
"Path to the CNAB bundle.json file.")
f.StringSliceVarP(&opts.ParameterSets, "parameter-set", "p", nil,
f.StringArrayVarP(&opts.ParameterSets, "parameter-set", "p", nil,
"Name of a parameter set file for the bundle. May be either a named set of parameters or a filepath, and specified multiple times.")
f.StringSliceVar(&opts.Params, "param", nil,
f.StringArrayVar(&opts.Params, "param", nil,
"Define an individual parameter in the form NAME=VALUE. Overrides parameters otherwise set via --parameter-set. May be specified multiple times.")
f.StringSliceVarP(&opts.CredentialIdentifiers, "cred", "c", nil,
"Credential to use when installing the bundle. It should be a named set of credentials and may be specified multiple times.")
Expand Down Expand Up @@ -282,9 +282,9 @@ For example, the 'debug' driver may be specified, which simply logs the info giv
"Path to the porter manifest file. Defaults to the bundle in the current directory.")
f.StringVar(&opts.CNABFile, "cnab-file", "",
"Path to the CNAB bundle.json file.")
f.StringSliceVarP(&opts.ParameterSets, "parameter-set", "p", nil,
f.StringArrayVarP(&opts.ParameterSets, "parameter-set", "p", nil,
"Name of a parameter set file for the bundle. May be either a named set of parameters or a filepath, and specified multiple times.")
f.StringSliceVar(&opts.Params, "param", nil,
f.StringArrayVar(&opts.Params, "param", nil,
"Define an individual parameter in the form NAME=VALUE. Overrides parameters otherwise set via --parameter-set. May be specified multiple times.")
f.StringSliceVarP(&opts.CredentialIdentifiers, "cred", "c", nil,
"Credential to use when installing the bundle. May be either a named set of credentials or a filepath, and specified multiple times.")
Expand Down Expand Up @@ -339,9 +339,9 @@ For example, the 'debug' driver may be specified, which simply logs the info giv
"Path to the porter manifest file. Defaults to the bundle in the current directory. Optional unless a newer version of the bundle should be used to uninstall the bundle.")
f.StringVar(&opts.CNABFile, "cnab-file", "",
"Path to the CNAB bundle.json file.")
f.StringSliceVarP(&opts.ParameterSets, "parameter-set", "p", nil,
f.StringArrayVarP(&opts.ParameterSets, "parameter-set", "p", nil,
"Name of a parameter set file for the bundle. May be either a named set of parameters or a filepath, and specified multiple times.")
f.StringSliceVar(&opts.Params, "param", nil,
f.StringArrayVar(&opts.Params, "param", nil,
"Define an individual parameter in the form NAME=VALUE. Overrides parameters otherwise set via --parameter-set. May be specified multiple times.")
f.StringSliceVarP(&opts.CredentialIdentifiers, "cred", "c", nil,
"Credential to use when uninstalling the bundle. May be either a named set of credentials or a filepath, and specified multiple times.")
Expand Down
28 changes: 14 additions & 14 deletions docs/content/cli/bundles_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,20 @@ porter bundles install [INSTALLATION] [flags]
### Options

```
--allow-docker-host-access Controls if the bundle should have access to the host's Docker daemon with elevated privileges. See https://porter.sh/configuration/#allow-docker-host-access for the full implications of this flag.
--cnab-file string Path to the CNAB bundle.json file.
-c, --cred strings Credential to use when installing the bundle. It should be a named set of credentials and may be specified multiple times.
-d, --driver string Specify a driver to use. Allowed values: docker, debug (default "docker")
-f, --file string Path to the porter manifest file. Defaults to the bundle in the current directory.
--force Force a fresh pull of the bundle
-h, --help help for install
--insecure-registry Don't require TLS for the registry
-l, --label strings Associate the specified labels with the installation. May be specified multiple times.
-n, --namespace string Create the installation in the specified namespace. Defaults to the global namespace.
--no-logs Do not persist the bundle execution logs
--param strings Define an individual parameter in the form NAME=VALUE. Overrides parameters otherwise set via --parameter-set. May be specified multiple times.
-p, --parameter-set strings Name of a parameter set for the bundle. It should be a named set of parameters and may be specified multiple times.
-r, --reference string Use a bundle in an OCI registry specified by the given reference.
--allow-docker-host-access Controls if the bundle should have access to the host's Docker daemon with elevated privileges. See https://porter.sh/configuration/#allow-docker-host-access for the full implications of this flag.
--cnab-file string Path to the CNAB bundle.json file.
-c, --cred strings Credential to use when installing the bundle. It should be a named set of credentials and may be specified multiple times.
-d, --driver string Specify a driver to use. Allowed values: docker, debug (default "docker")
-f, --file string Path to the porter manifest file. Defaults to the bundle in the current directory.
--force Force a fresh pull of the bundle
-h, --help help for install
--insecure-registry Don't require TLS for the registry
-l, --label strings Associate the specified labels with the installation. May be specified multiple times.
-n, --namespace string Create the installation in the specified namespace. Defaults to the global namespace.
--no-logs Do not persist the bundle execution logs
--param stringArray Define an individual parameter in the form NAME=VALUE. Overrides parameters otherwise set via --parameter-set. May be specified multiple times.
-p, --parameter-set stringArray Name of a parameter set for the bundle. It should be a named set of parameters and may be specified multiple times.
-r, --reference string Use a bundle in an OCI registry specified by the given reference.
```

### Options inherited from parent commands
Expand Down
28 changes: 14 additions & 14 deletions docs/content/cli/bundles_invoke.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@ porter bundles invoke [INSTALLATION] --action ACTION [flags]
### Options

```
--action string Custom action name to invoke.
--allow-docker-host-access Controls if the bundle should have access to the host's Docker daemon with elevated privileges. See https://porter.sh/configuration/#allow-docker-host-access for the full implications of this flag.
--cnab-file string Path to the CNAB bundle.json file.
-c, --cred strings Credential to use when installing the bundle. May be either a named set of credentials or a filepath, and specified multiple times.
-d, --driver string Specify a driver to use. Allowed values: docker, debug (default "docker")
-f, --file string Path to the porter manifest file. Defaults to the bundle in the current directory.
--force Force a fresh pull of the bundle
-h, --help help for invoke
--insecure-registry Don't require TLS for the registry
-n, --namespace string Namespace of the specified installation. Defaults to the global namespace.
--no-logs Do not persist the bundle execution logs
--param strings Define an individual parameter in the form NAME=VALUE. Overrides parameters otherwise set via --parameter-set. May be specified multiple times.
-p, --parameter-set strings Name of a parameter set file for the bundle. May be either a named set of parameters or a filepath, and specified multiple times.
-r, --reference string Use a bundle in an OCI registry specified by the given reference.
--action string Custom action name to invoke.
--allow-docker-host-access Controls if the bundle should have access to the host's Docker daemon with elevated privileges. See https://porter.sh/configuration/#allow-docker-host-access for the full implications of this flag.
--cnab-file string Path to the CNAB bundle.json file.
-c, --cred strings Credential to use when installing the bundle. May be either a named set of credentials or a filepath, and specified multiple times.
-d, --driver string Specify a driver to use. Allowed values: docker, debug (default "docker")
-f, --file string Path to the porter manifest file. Defaults to the bundle in the current directory.
--force Force a fresh pull of the bundle
-h, --help help for invoke
--insecure-registry Don't require TLS for the registry
-n, --namespace string Namespace of the specified installation. Defaults to the global namespace.
--no-logs Do not persist the bundle execution logs
--param stringArray Define an individual parameter in the form NAME=VALUE. Overrides parameters otherwise set via --parameter-set. May be specified multiple times.
-p, --parameter-set stringArray Name of a parameter set file for the bundle. May be either a named set of parameters or a filepath, and specified multiple times.
-r, --reference string Use a bundle in an OCI registry specified by the given reference.
```

### Options inherited from parent commands
Expand Down
30 changes: 15 additions & 15 deletions docs/content/cli/bundles_uninstall.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,21 @@ porter bundles uninstall [INSTALLATION] [flags]
### Options

```
--allow-docker-host-access Controls if the bundle should have access to the host's Docker daemon with elevated privileges. See https://porter.sh/configuration/#allow-docker-host-access for the full implications of this flag.
--cnab-file string Path to the CNAB bundle.json file.
-c, --cred strings Credential to use when uninstalling the bundle. May be either a named set of credentials or a filepath, and specified multiple times.
--delete Delete all records associated with the installation, assuming the uninstall action succeeds
-d, --driver string Specify a driver to use. Allowed values: docker, debug (default "docker")
-f, --file string Path to the porter manifest file. Defaults to the bundle in the current directory. Optional unless a newer version of the bundle should be used to uninstall the bundle.
--force Force a fresh pull of the bundle
--force-delete UNSAFE. Delete all records associated with the installation, even if uninstall fails. This is intended for cleaning up test data and is not recommended for production environments.
-h, --help help for uninstall
--insecure-registry Don't require TLS for the registry
-n, --namespace string Namespace of the specified installation. Defaults to the global namespace.
--no-logs Do not persist the bundle execution logs
--param strings Define an individual parameter in the form NAME=VALUE. Overrides parameters otherwise set via --parameter-set. May be specified multiple times.
-p, --parameter-set strings Name of a parameter set file for the bundle. May be either a named set of parameters or a filepath, and specified multiple times.
-r, --reference string Use a bundle in an OCI registry specified by the given reference.
--allow-docker-host-access Controls if the bundle should have access to the host's Docker daemon with elevated privileges. See https://porter.sh/configuration/#allow-docker-host-access for the full implications of this flag.
--cnab-file string Path to the CNAB bundle.json file.
-c, --cred strings Credential to use when uninstalling the bundle. May be either a named set of credentials or a filepath, and specified multiple times.
--delete Delete all records associated with the installation, assuming the uninstall action succeeds
-d, --driver string Specify a driver to use. Allowed values: docker, debug (default "docker")
-f, --file string Path to the porter manifest file. Defaults to the bundle in the current directory. Optional unless a newer version of the bundle should be used to uninstall the bundle.
--force Force a fresh pull of the bundle
--force-delete UNSAFE. Delete all records associated with the installation, even if uninstall fails. This is intended for cleaning up test data and is not recommended for production environments.
-h, --help help for uninstall
--insecure-registry Don't require TLS for the registry
-n, --namespace string Namespace of the specified installation. Defaults to the global namespace.
--no-logs Do not persist the bundle execution logs
--param stringArray Define an individual parameter in the form NAME=VALUE. Overrides parameters otherwise set via --parameter-set. May be specified multiple times.
-p, --parameter-set stringArray Name of a parameter set file for the bundle. May be either a named set of parameters or a filepath, and specified multiple times.
-r, --reference string Use a bundle in an OCI registry specified by the given reference.
```

### Options inherited from parent commands
Expand Down
28 changes: 14 additions & 14 deletions docs/content/cli/bundles_upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@ porter bundles upgrade [INSTALLATION] [flags]
### Options

```
--allow-docker-host-access Controls if the bundle should have access to the host's Docker daemon with elevated privileges. See https://porter.sh/configuration/#allow-docker-host-access for the full implications of this flag.
--cnab-file string Path to the CNAB bundle.json file.
-c, --cred strings Credential to use when installing the bundle. It should be a named set of credentials and may be specified multiple times.
-d, --driver string Specify a driver to use. Allowed values: docker, debug (default "docker")
-f, --file string Path to the porter manifest file. Defaults to the bundle in the current directory.
--force Force a fresh pull of the bundle
-h, --help help for upgrade
--insecure-registry Don't require TLS for the registry
-n, --namespace string Namespace of the specified installation. Defaults to the global namespace.
--no-logs Do not persist the bundle execution logs
--param strings Define an individual parameter in the form NAME=VALUE. Overrides parameters otherwise set via --parameter-set. May be specified multiple times.
-p, --parameter-set strings Name of a parameter set file for the bundle. May be either a named set of parameters or a filepath, and specified multiple times.
-r, --reference string Use a bundle in an OCI registry specified by the given reference.
--version string Version to which the installation should be upgraded. This represents the version of the bundle, which assumes the convention of setting the bundle tag to its version.
--allow-docker-host-access Controls if the bundle should have access to the host's Docker daemon with elevated privileges. See https://porter.sh/configuration/#allow-docker-host-access for the full implications of this flag.
--cnab-file string Path to the CNAB bundle.json file.
-c, --cred strings Credential to use when installing the bundle. It should be a named set of credentials and may be specified multiple times.
-d, --driver string Specify a driver to use. Allowed values: docker, debug (default "docker")
-f, --file string Path to the porter manifest file. Defaults to the bundle in the current directory.
--force Force a fresh pull of the bundle
-h, --help help for upgrade
--insecure-registry Don't require TLS for the registry
-n, --namespace string Namespace of the specified installation. Defaults to the global namespace.
--no-logs Do not persist the bundle execution logs
--param stringArray Define an individual parameter in the form NAME=VALUE. Overrides parameters otherwise set via --parameter-set. May be specified multiple times.
-p, --parameter-set stringArray Name of a parameter set file for the bundle. May be either a named set of parameters or a filepath, and specified multiple times.
-r, --reference string Use a bundle in an OCI registry specified by the given reference.
--version string Version to which the installation should be upgraded. This represents the version of the bundle, which assumes the convention of setting the bundle tag to its version.
```

### Options inherited from parent commands
Expand Down
Loading

0 comments on commit cba074a

Please sign in to comment.