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,9 +253,7 @@ 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)
}
diags = diags.Append(schemaDiags)
}
// Persist the final state

View File

@ -398,9 +398,7 @@ 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)
}
diags = diags.Append(schemaDiags)
}
// Write the new state

View File

@ -173,9 +173,7 @@ 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)
}
diags = diags.Append(schemaDiags)
}
// Write the updated state

View File

@ -123,9 +123,7 @@ 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)
}
diags = diags.Append(schemaDiags)
}
if err := stateMgr.WriteState(state); err != nil {

View File

@ -131,9 +131,7 @@ 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)
}
diags = diags.Append(schemaDiags)
}
ss := state.SyncWrapper()

View File

@ -170,9 +170,7 @@ 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)
}
diags = diags.Append(schemaDiags)
}
obj.Status = states.ObjectReady