-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Need a "GetExists" or similar for determining if a key is set in a configuration #5694
Comments
This ^^ :) Will be an awesome addition! |
Definitely agreed that So the history here is that As @mitchellh mentioned there in a comment:
So this issue can be the home for the fact that we do indeed want to support that in the future. 😁 As Mitchell says, it'll be a decent amount of work to thread through metadata in the diff such that we can properly detect absence from config vs default values. But I think it's probably worth it for the benefit it gives to provider authors. |
This is going to solve quite a few issues regarding setting of 0. I have linked a few that I have found so far |
Anything that would be useful to help with / test out here? Just ran into #5681. |
Specifically, this allows you to create a schedule which only changes some of the group parameters without changing others, by setting the parameters you wish to remain empty to -1. This means you can adjust min or max size without affecting the desired capacity, for example. The ad hoc support for -1 isn't as nice as having real support for leaving values out (see hashicorp#5694) but it solves a real use case. Fixes hashicorp#5681.
Specifically, this allows you to create a schedule which only changes some of the group parameters without changing others, by setting the parameters you wish to remain empty to -1. This means you can adjust min or max size without affecting the desired capacity, for example. The ad hoc support for -1 isn't as nice as having real support for leaving values out (see hashicorp#5694) but it solves a real use case. Fixes hashicorp#5681.
Specifically, this allows you to create a schedule which only changes some of the group parameters without changing others, by setting the parameters you wish to remain empty to -1. This means you can adjust min or max size without affecting the desired capacity, for example. The ad hoc support for -1 isn't as nice as having real support for leaving values out (see hashicorp#5694) but it solves a real use case. Fixes hashicorp#5681.
I just ran into #5069 when trying to provision DNS MX records on DigitalOcean. Is this issue resolved in master? |
Specifically, this allows you to create a schedule which only changes some of the group parameters without changing others, by setting the parameters you wish to remain empty to -1. This means you can adjust min or max size without affecting the desired capacity, for example. The ad hoc support for -1 isn't as nice as having real support for leaving values out (see hashicorp#5694) but it solves a real use case. Fixes hashicorp#5681.
+1, ran into this in another context. |
In #15723 we added We suspect it has some caveats on edge-cases where something is removed when already set to the default in the state, due to some details of how diffs and state are represented internally. In practice, it seems like it's been working well enough to be useful in the main case, and the remaining caveats should be dealt with via some long-term work to improve how we represent diffs and state so that "unset" is a separate idea from the zero value. Since the broader work on the internal representations of things is on our radar (though not actually a GitHub issue, since it's a bit too broad/undefined at this time) and we've seen some success using |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
For AWS AutoScaling groups,
max/min/desired
capacity can be0
, so we added the code in #4693 to no longer useGetOk
in checking these values, and instead just useGet
.#5681 reminds us that simply omitting
desired_capacity
should be allowed, too, since it's not actually required in the API.We need to be know if a key was set at all, not just if it was set and not a non-default value.
d.Get
:d.GetOk
:We need to check if it's been set, regardless of the non-default status or not
The text was updated successfully, but these errors were encountered: