Bug #25429
closedWhen a mandatory variable has not value but a default one is configured, use it
Description
For now, the "default" value in technique metadata is only use to set the first initial value on a directive field.
Sometime, for example during migration, a new mandatory variable is added to a technique and directive already exists.
When we set that variable with a default value, we still get a generation error because the default value is not use, because there wasn't a loop throught updating the directive which would allow to provide the directive with the value.
We want to change that and just use the default value if:
- the variable is mandatory,
- it has no value (or only empty value, which is the same in Rudder).
We won't change anything for an optional variable with a default value. In that case, it's still possible to use an empty value.
The effect of that change is that the technique creator can choose to avoid user to go all of their existing technique and update them and still ask for a mandatory value.
The current alternative is to mark the variable as optionnal and check in the cfengine/powershell code for the availability of a value, and use the default here (which is more involving and duplicate the work).
Updated by François ARMAND 4 months ago
- Status changed from New to In progress
- Assignee set to François ARMAND
Updated by François ARMAND 4 months ago
- Status changed from In progress to Pending technical review
- Assignee changed from François ARMAND to Vincent MEMBRÉ
- Pull Request set to https://github.com/Normation/rudder/pull/5863
Updated by Anonymous 3 months ago
- Status changed from Pending technical review to Pending release
Applied in changeset rudder|2514b494e6d12f70ec6c31dc1381971c8d894eb7.
Updated by Vincent MEMBRÉ 3 months ago
- Status changed from Pending release to Released
This bug has been fixed in Rudder 8.1.7 which was released today.