-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix YAML template for Kubernetes on GCP #478
Conversation
Remove type statements for provider-namespace configuration values. Change from default to value to assign initial value. Signed-off-by: Scott Lowe <slowe@pulumi.com>
kubernetes-gcp-yaml/Pulumi.yaml
Outdated
gcp:project: | ||
type: string | ||
value: changeme | ||
gcp:region: | ||
type: string | ||
default: us-central1 | ||
value: us-central1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the fix for this is to remove these provider config settings from the root config
block (the program block), as they'll be written to Pulumi.{stack}.yaml
during pulumi new
with defaults from the template
block. When I run pulumi new
with this branch, for example, I don't see changeme
in the CLI prompt as a default, and after creation, I get empty string:
config:
asasdasdfa:nodesPerZone: "1"
gcp:project: ""
gcp:region: us-central1
Tried with 3.48 and 3.49 and got the same result. Looking at other *-gcp-yaml
templates, it seems they all keep these confined to template.config
, so we should be good just removing them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't leave those out; they are referenced later in the template. In order to be able to reference them later, they have to be included in the config
block. And there has to be at least a value key under each of them, because the template won't work otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, ok. Well if this fixes it, let’s go ahead and merge — we can always come back it. Thanks for the explanation and the fix!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @aq17 @AaronFriel Curious what we would expect to be used here? It doesn't feel right to require that we include dummy values like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, for keys that should have a default, using value
instead of type
and default
is correct. Agree that using a dummy key isn’t ideal but workable for now; one idea could be to add a required
option in lieu of value
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it is possible to omit gcp:project
and gcp:region
from the template and still reference them; when running pulumi up
, you should get
warning: unable to detect a global setting for GCP Project;
Pulumi will rely on per-resource settings for this operation.
Set the GCP Project by using:
`pulumi config set gcp:project <project>`
if it isn't set in your stack config, which seems preferable to using dummy values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aq17 Interesting; I was under the impression that the only way to use a configuration value (provider-namespaced or otherwise) was to include it in the config
block (the template does reference gcp:project
later on). I'll try removing it from the config
block and report back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the fix for this is to remove these provider config settings from the root config block
Actually, it is possible to omit gcp:project and gcp:region from the template and still reference them
Finally got a chance to try this locally myself, and just removing those two settings does seem to do the trick, yeah.
We should also remove them from the template's page on pulumi.com: https://www.pulumi.com/templates/kubernetes/gcp/#customizing-the-project
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also tested this locally and it seemed to work; I wanted to run one more set of tests to be sure. Agreed that if we remove these settings we need to update the landing page as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've run a few tests and can't find any ill effects from removing gcp:project
and gcp:region
from the top-level config
block, so I'll push another commit that just removes those and re-request reviews before merging.
kubernetes-gcp-yaml/Pulumi.yaml
Outdated
gcp:project: | ||
type: string | ||
value: changeme | ||
gcp:region: | ||
type: string | ||
default: us-central1 | ||
value: us-central1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, ok. Well if this fixes it, let’s go ahead and merge — we can always come back it. Thanks for the explanation and the fix!
Remove provider configuration values from top-level config block Signed-off-by: Scott Lowe <slowe@pulumi.com>
* Fix YAML template for Kubernetes on GCP Remove type statements for provider-namespace configuration values. Change from default to value to assign initial value. Signed-off-by: Scott Lowe <slowe@pulumi.com> * Remove provider configuration values Remove provider configuration values from top-level config block Signed-off-by: Scott Lowe <slowe@pulumi.com> Signed-off-by: Scott Lowe <slowe@pulumi.com>
This PR fixes issues with the YAML template for Kubernetes on GCP, which was affected by the issue described in #477. No other templates were identified as being affected by #477.
This PR fixes #477.