The logic for validating prompted values in 'new' wasn't quite right, leading to the possibility of creating Pulumi.yaml files with blank project names. This manifests in various ways and I've hit it a number of times over the past few months because of the way we handle project/stack name conflicts in 'new' -- which itself is a bit annoying too: https://github.com/pulumi/pulumi/blob/master/pkg/cmd/pulumi/new.go#L206-L207 Because we substitue a default value of "", and because the prompting logic assumed default values are always valid, we would skip validation and therefore accept a blank Pulumi.yaml file. This generates an invalid project which causes errors elsewhere, such as error: failed to load Pulumi project located at ".../Pulumi.yaml": project is missing a 'name' attribute I hit this all the time with our getting started guide because I've gone through it so many times and have leftover stacks from prior run-throughs. I wouldn't be surprised if a lot of people hit this. The solution here validates all values, including the default. Note also that we failed to validate the value used by 'new --yes' which meant you could bypass all validation by passing --yes, leading to similar outcomes. I've added a couple new tests for these cases. There is a risk we depend on illegal default values somewhere which will now be rejected, but that would seem strange, and assuming the tests pass, I would assume that's not true. Let me know if that's wrong. Fixes pulumi/pulumi#3255. |
||
---|---|---|
.. | ||
creds.go | ||
paths.go | ||
plugins.go | ||
plugins_install_nodejs_test.go | ||
plugins_install_python_test.go | ||
plugins_install_test.go | ||
plugins_test.go | ||
project.go | ||
project_test.go | ||
settings.go | ||
templates.go | ||
templates_test.go | ||
workspace.go |