validate commandΒΆ
Use multiple arguments to validate multiple files:
Available flags:
Flag | Required | Short | Description |
---|---|---|---|
vars | No | path to FILE containing template variables, must be JSON or YAML format |
|
var | No | template variable in KEY=VALUE form, can either be a comma separated list or specified multiple times. | |
verbose | No | -v | print all the template variables and final resources after templating |
All flags must be specified before arguments:
See the templating section for examples.
Supported ResourcesΒΆ
The following resource kinds are supported:
TemplatingΒΆ
A templated YAML file can look like this:
apiVersion: nais.io/v1alpha1
kind: Application
metadata:
name: {{app}}
namespace: some-team
labels:
team: some-team
spec:
image: {{image}}
To validate a templated file, provide a variable file or specify the variables as flags.
Variable FileΒΆ
The variable file must be in either JSON or YAML format:
Specify the path to the variable file with the --vars
flag:
Variable FlagsΒΆ
Specify variables in the key=value
form with the --var
flag.
Multiple variables can be provided as a comma separated list of pairs:
...or by specifying the --var
flag multiple times:
If both a variable file and variable flags are provided:
...the flags will override any variables set by the file:
nais validate --vars vars.yaml --var image=some-other-image -v nais.yaml
[π] Setting template variable 'app' to 'some-app'
[π] Setting template variable 'image' to 'some-image'
[β οΈ] Overwriting template variable 'image'; previous value was 'some-image'
[π] Setting template variable 'image' to 'some-other-image'
...
Verbose OutputΒΆ
The --verbose
(shorthand -v
) flag prints additional information, such as template variables set and the final templated resources:
[π] Setting template variable 'app' to 'some-app'
[π] Setting template variable 'image' to 'some-image'
[π¨οΈ] Printing "nais.yaml"...
---
apiVersion: nais.io/v1alpha1
kind: Application
metadata:
name: some-app
namespace: some-team
labels:
team: some-team
spec:
image: some-image
[β
] "nais.yaml" is valid