mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Add a new ChangeReason, ReasonDeleteBecauseNoMoveTarget, to provide better information in cases where a planned deletion is due to moving a resource to a target not in configuration. Consider a case in which a resource instance exists in state at address A, and the user adds a moved block to move A to address B. Whether by the user's intention or not, address B does not exist in configuration. Terraform combines the move from A to B, and the lack of configuration for B, into a single delete action for the (previously nonexistent) entity B. Prior to this commit, the Terraform plan will report that resource B will be destroyed because it does not exist in configuration, without explicitly connecting this to the move. This commit provides the user an additional clue as to what has happened, in a case in which Terraform has elided a user's action and inaction into one potentially destructive change.
69 lines
3.0 KiB
Go
69 lines
3.0 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[ResourceInstanceDeleteBecauseNoMoveTarget-65]
|
|
_ = x[ResourceInstanceReadBecauseConfigUnknown-63]
|
|
_ = x[ResourceInstanceReadBecauseDependencyPending-33]
|
|
}
|
|
|
|
const (
|
|
_ResourceInstanceChangeActionReason_name_0 = "ResourceInstanceChangeNoReason"
|
|
_ResourceInstanceChangeActionReason_name_1 = "ResourceInstanceReadBecauseDependencyPending"
|
|
_ResourceInstanceChangeActionReason_name_2 = "ResourceInstanceReadBecauseConfigUnknown"
|
|
_ResourceInstanceChangeActionReason_name_3 = "ResourceInstanceDeleteBecauseNoMoveTarget"
|
|
_ResourceInstanceChangeActionReason_name_4 = "ResourceInstanceDeleteBecauseCountIndexResourceInstanceReplaceByTriggersResourceInstanceDeleteBecauseEachKeyResourceInstanceReplaceBecauseCannotUpdate"
|
|
_ResourceInstanceChangeActionReason_name_5 = "ResourceInstanceDeleteBecauseNoModuleResourceInstanceDeleteBecauseNoResourceConfig"
|
|
_ResourceInstanceChangeActionReason_name_6 = "ResourceInstanceReplaceByRequest"
|
|
_ResourceInstanceChangeActionReason_name_7 = "ResourceInstanceReplaceBecauseTainted"
|
|
_ResourceInstanceChangeActionReason_name_8 = "ResourceInstanceDeleteBecauseWrongRepetition"
|
|
)
|
|
|
|
var (
|
|
_ResourceInstanceChangeActionReason_index_4 = [...]uint8{0, 39, 72, 108, 150}
|
|
_ResourceInstanceChangeActionReason_index_5 = [...]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 i == 65:
|
|
return _ResourceInstanceChangeActionReason_name_3
|
|
case 67 <= i && i <= 70:
|
|
i -= 67
|
|
return _ResourceInstanceChangeActionReason_name_4[_ResourceInstanceChangeActionReason_index_4[i]:_ResourceInstanceChangeActionReason_index_4[i+1]]
|
|
case 77 <= i && i <= 78:
|
|
i -= 77
|
|
return _ResourceInstanceChangeActionReason_name_5[_ResourceInstanceChangeActionReason_index_5[i]:_ResourceInstanceChangeActionReason_index_5[i+1]]
|
|
case i == 82:
|
|
return _ResourceInstanceChangeActionReason_name_6
|
|
case i == 84:
|
|
return _ResourceInstanceChangeActionReason_name_7
|
|
case i == 87:
|
|
return _ResourceInstanceChangeActionReason_name_8
|
|
default:
|
|
return "ResourceInstanceChangeActionReason(" + strconv.FormatInt(int64(i), 10) + ")"
|
|
}
|
|
}
|