mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
don't check diags for errors
This commit is contained in:
parent
4d749e2813
commit
37b7e6ebce
@ -253,10 +253,8 @@ func (c *ImportCommand) Run(args []string) int {
|
|||||||
if isCloudMode(b) {
|
if isCloudMode(b) {
|
||||||
var schemaDiags tfdiags.Diagnostics
|
var schemaDiags tfdiags.Diagnostics
|
||||||
schemas, schemaDiags = c.MaybeGetSchemas(newState, nil)
|
schemas, schemaDiags = c.MaybeGetSchemas(newState, nil)
|
||||||
if schemaDiags.HasErrors() {
|
|
||||||
diags = diags.Append(schemaDiags)
|
diags = diags.Append(schemaDiags)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Persist the final state
|
// Persist the final state
|
||||||
log.Printf("[INFO] Writing state output to: %s", c.Meta.StateOutPath())
|
log.Printf("[INFO] Writing state output to: %s", c.Meta.StateOutPath())
|
||||||
|
@ -398,10 +398,8 @@ func (c *StateMvCommand) Run(args []string) int {
|
|||||||
if isCloudMode(b) {
|
if isCloudMode(b) {
|
||||||
var schemaDiags tfdiags.Diagnostics
|
var schemaDiags tfdiags.Diagnostics
|
||||||
schemas, schemaDiags = c.MaybeGetSchemas(stateTo, nil)
|
schemas, schemaDiags = c.MaybeGetSchemas(stateTo, nil)
|
||||||
if schemaDiags.HasErrors() {
|
|
||||||
diags = diags.Append(schemaDiags)
|
diags = diags.Append(schemaDiags)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Write the new state
|
// Write the new state
|
||||||
if err := stateToMgr.WriteState(stateTo); err != nil {
|
if err := stateToMgr.WriteState(stateTo); err != nil {
|
||||||
|
@ -173,10 +173,8 @@ func (c *StateReplaceProviderCommand) Run(args []string) int {
|
|||||||
if isCloudMode(b) {
|
if isCloudMode(b) {
|
||||||
var schemaDiags tfdiags.Diagnostics
|
var schemaDiags tfdiags.Diagnostics
|
||||||
schemas, schemaDiags = c.MaybeGetSchemas(state, nil)
|
schemas, schemaDiags = c.MaybeGetSchemas(state, nil)
|
||||||
if schemaDiags.HasErrors() {
|
|
||||||
diags = diags.Append(schemaDiags)
|
diags = diags.Append(schemaDiags)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Write the updated state
|
// Write the updated state
|
||||||
if err := stateMgr.WriteState(state); err != nil {
|
if err := stateMgr.WriteState(state); err != nil {
|
||||||
|
@ -123,10 +123,8 @@ func (c *StateRmCommand) Run(args []string) int {
|
|||||||
if isCloudMode(b) {
|
if isCloudMode(b) {
|
||||||
var schemaDiags tfdiags.Diagnostics
|
var schemaDiags tfdiags.Diagnostics
|
||||||
schemas, schemaDiags = c.MaybeGetSchemas(state, nil)
|
schemas, schemaDiags = c.MaybeGetSchemas(state, nil)
|
||||||
if schemaDiags.HasErrors() {
|
|
||||||
diags = diags.Append(schemaDiags)
|
diags = diags.Append(schemaDiags)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if err := stateMgr.WriteState(state); err != nil {
|
if err := stateMgr.WriteState(state); err != nil {
|
||||||
c.Ui.Error(fmt.Sprintf(errStateRmPersist, err))
|
c.Ui.Error(fmt.Sprintf(errStateRmPersist, err))
|
||||||
|
@ -131,10 +131,8 @@ func (c *TaintCommand) Run(args []string) int {
|
|||||||
if isCloudMode(b) {
|
if isCloudMode(b) {
|
||||||
var schemaDiags tfdiags.Diagnostics
|
var schemaDiags tfdiags.Diagnostics
|
||||||
schemas, schemaDiags = c.MaybeGetSchemas(state, nil)
|
schemas, schemaDiags = c.MaybeGetSchemas(state, nil)
|
||||||
if schemaDiags.HasErrors() {
|
|
||||||
diags = diags.Append(schemaDiags)
|
diags = diags.Append(schemaDiags)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
ss := state.SyncWrapper()
|
ss := state.SyncWrapper()
|
||||||
|
|
||||||
|
@ -170,10 +170,8 @@ func (c *UntaintCommand) Run(args []string) int {
|
|||||||
if isCloudMode(b) {
|
if isCloudMode(b) {
|
||||||
var schemaDiags tfdiags.Diagnostics
|
var schemaDiags tfdiags.Diagnostics
|
||||||
schemas, schemaDiags = c.MaybeGetSchemas(state, nil)
|
schemas, schemaDiags = c.MaybeGetSchemas(state, nil)
|
||||||
if schemaDiags.HasErrors() {
|
|
||||||
diags = diags.Append(schemaDiags)
|
diags = diags.Append(schemaDiags)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
obj.Status = states.ObjectReady
|
obj.Status = states.ObjectReady
|
||||||
ss.SetResourceInstanceCurrent(addr, obj, rs.ProviderConfig)
|
ss.SetResourceInstanceCurrent(addr, obj, rs.ProviderConfig)
|
||||||
|
Loading…
Reference in New Issue
Block a user