don't check diags for errors

This commit is contained in:
Megan Bang 2022-08-30 18:03:57 -05:00
parent 4d749e2813
commit 37b7e6ebce
6 changed files with 6 additions and 18 deletions

View File

@ -253,10 +253,8 @@ func (c *ImportCommand) Run(args []string) int {
if isCloudMode(b) {
var schemaDiags tfdiags.Diagnostics
schemas, schemaDiags = c.MaybeGetSchemas(newState, nil)
if schemaDiags.HasErrors() {
diags = diags.Append(schemaDiags)
}
}
// Persist the final state
log.Printf("[INFO] Writing state output to: %s", c.Meta.StateOutPath())

View File

@ -398,10 +398,8 @@ func (c *StateMvCommand) Run(args []string) int {
if isCloudMode(b) {
var schemaDiags tfdiags.Diagnostics
schemas, schemaDiags = c.MaybeGetSchemas(stateTo, nil)
if schemaDiags.HasErrors() {
diags = diags.Append(schemaDiags)
}
}
// Write the new state
if err := stateToMgr.WriteState(stateTo); err != nil {

View File

@ -173,10 +173,8 @@ func (c *StateReplaceProviderCommand) Run(args []string) int {
if isCloudMode(b) {
var schemaDiags tfdiags.Diagnostics
schemas, schemaDiags = c.MaybeGetSchemas(state, nil)
if schemaDiags.HasErrors() {
diags = diags.Append(schemaDiags)
}
}
// Write the updated state
if err := stateMgr.WriteState(state); err != nil {

View File

@ -123,10 +123,8 @@ func (c *StateRmCommand) Run(args []string) int {
if isCloudMode(b) {
var schemaDiags tfdiags.Diagnostics
schemas, schemaDiags = c.MaybeGetSchemas(state, nil)
if schemaDiags.HasErrors() {
diags = diags.Append(schemaDiags)
}
}
if err := stateMgr.WriteState(state); err != nil {
c.Ui.Error(fmt.Sprintf(errStateRmPersist, err))

View File

@ -131,10 +131,8 @@ func (c *TaintCommand) Run(args []string) int {
if isCloudMode(b) {
var schemaDiags tfdiags.Diagnostics
schemas, schemaDiags = c.MaybeGetSchemas(state, nil)
if schemaDiags.HasErrors() {
diags = diags.Append(schemaDiags)
}
}
ss := state.SyncWrapper()

View File

@ -170,10 +170,8 @@ func (c *UntaintCommand) Run(args []string) int {
if isCloudMode(b) {
var schemaDiags tfdiags.Diagnostics
schemas, schemaDiags = c.MaybeGetSchemas(state, nil)
if schemaDiags.HasErrors() {
diags = diags.Append(schemaDiags)
}
}
obj.Status = states.ObjectReady
ss.SetResourceInstanceCurrent(addr, obj, rs.ProviderConfig)