mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
We have two different reasons why a data resource might be read only during apply, rather than during planning as usual: the configuration contains unknown values, or the data resource as a whole depends on a managed resource which itself has a change pending. However, we didn't previously distinguish these two in a way that allowed the UI to describe the difference, and so we confusingly reported both as "config refers to values not yet known", which in turn led to a number of reasonable questions about why Terraform was claiming that but then immediately below showing the configuration entirely known. Now we'll use our existing "ActionReason" mechanism to tell the UI layer which of the two reasons applies to a particular data resource instance. The "dependency pending" situation tends to happen in conjunction with "config unknown", so we'll prefer to refer that the configuration is unknown if both are true.
65 lines
2.8 KiB
Go
65 lines
2.8 KiB
Go
// Code generated by "stringer -type=ResourceInstanceChangeActionReason changes.go"; DO NOT EDIT.
|
|
|
|
package plans
|
|
|
|
import "strconv"
|
|
|
|
func _() {
|
|
// An "invalid array index" compiler error signifies that the constant values have changed.
|
|
// Re-run the stringer command to generate them again.
|
|
var x [1]struct{}
|
|
_ = x[ResourceInstanceChangeNoReason-0]
|
|
_ = x[ResourceInstanceReplaceBecauseTainted-84]
|
|
_ = x[ResourceInstanceReplaceByRequest-82]
|
|
_ = x[ResourceInstanceReplaceByTriggers-68]
|
|
_ = x[ResourceInstanceReplaceBecauseCannotUpdate-70]
|
|
_ = x[ResourceInstanceDeleteBecauseNoResourceConfig-78]
|
|
_ = x[ResourceInstanceDeleteBecauseWrongRepetition-87]
|
|
_ = x[ResourceInstanceDeleteBecauseCountIndex-67]
|
|
_ = x[ResourceInstanceDeleteBecauseEachKey-69]
|
|
_ = x[ResourceInstanceDeleteBecauseNoModule-77]
|
|
_ = x[ResourceInstanceReadBecauseConfigUnknown-63]
|
|
_ = x[ResourceInstanceReadBecauseDependencyPending-33]
|
|
}
|
|
|
|
const (
|
|
_ResourceInstanceChangeActionReason_name_0 = "ResourceInstanceChangeNoReason"
|
|
_ResourceInstanceChangeActionReason_name_1 = "ResourceInstanceReadBecauseDependencyPending"
|
|
_ResourceInstanceChangeActionReason_name_2 = "ResourceInstanceReadBecauseConfigUnknown"
|
|
_ResourceInstanceChangeActionReason_name_3 = "ResourceInstanceDeleteBecauseCountIndexResourceInstanceReplaceByTriggersResourceInstanceDeleteBecauseEachKeyResourceInstanceReplaceBecauseCannotUpdate"
|
|
_ResourceInstanceChangeActionReason_name_4 = "ResourceInstanceDeleteBecauseNoModuleResourceInstanceDeleteBecauseNoResourceConfig"
|
|
_ResourceInstanceChangeActionReason_name_5 = "ResourceInstanceReplaceByRequest"
|
|
_ResourceInstanceChangeActionReason_name_6 = "ResourceInstanceReplaceBecauseTainted"
|
|
_ResourceInstanceChangeActionReason_name_7 = "ResourceInstanceDeleteBecauseWrongRepetition"
|
|
)
|
|
|
|
var (
|
|
_ResourceInstanceChangeActionReason_index_3 = [...]uint8{0, 39, 72, 108, 150}
|
|
_ResourceInstanceChangeActionReason_index_4 = [...]uint8{0, 37, 82}
|
|
)
|
|
|
|
func (i ResourceInstanceChangeActionReason) String() string {
|
|
switch {
|
|
case i == 0:
|
|
return _ResourceInstanceChangeActionReason_name_0
|
|
case i == 33:
|
|
return _ResourceInstanceChangeActionReason_name_1
|
|
case i == 63:
|
|
return _ResourceInstanceChangeActionReason_name_2
|
|
case 67 <= i && i <= 70:
|
|
i -= 67
|
|
return _ResourceInstanceChangeActionReason_name_3[_ResourceInstanceChangeActionReason_index_3[i]:_ResourceInstanceChangeActionReason_index_3[i+1]]
|
|
case 77 <= i && i <= 78:
|
|
i -= 77
|
|
return _ResourceInstanceChangeActionReason_name_4[_ResourceInstanceChangeActionReason_index_4[i]:_ResourceInstanceChangeActionReason_index_4[i+1]]
|
|
case i == 82:
|
|
return _ResourceInstanceChangeActionReason_name_5
|
|
case i == 84:
|
|
return _ResourceInstanceChangeActionReason_name_6
|
|
case i == 87:
|
|
return _ResourceInstanceChangeActionReason_name_7
|
|
default:
|
|
return "ResourceInstanceChangeActionReason(" + strconv.FormatInt(int64(i), 10) + ")"
|
|
}
|
|
}
|