Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport of Return debuggable CAS errors on consul state put into v1.5 #33457

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion internal/backend/remote-state/consul/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,11 @@
}
// transaction was rolled back
if !ok {
return fmt.Errorf("consul CAS failed with transaction errors: %v", resp.Errors)
message := ""
for _, respError := resp.Errors {

Check failure on line 238 in internal/backend/remote-state/consul/client.go

View workflow job for this annotation

GitHub Actions / Code Consistency Checks

expected boolean or range expression, found assignment (missing parentheses around composite literal?)

Check failure on line 238 in internal/backend/remote-state/consul/client.go

View workflow job for this annotation

GitHub Actions / Code Consistency Checks

expected boolean or range expression, found assignment (missing parentheses around composite literal?)

Check failure on line 238 in internal/backend/remote-state/consul/client.go

View workflow job for this annotation

GitHub Actions / Race Tests

syntax error: cannot use _, respError := resp.Errors as value

Check failure on line 238 in internal/backend/remote-state/consul/client.go

View workflow job for this annotation

GitHub Actions / Unit Tests

syntax error: cannot use _, respError := resp.Errors as value
message += respError.What,

Check failure on line 239 in internal/backend/remote-state/consul/client.go

View workflow job for this annotation

GitHub Actions / Race Tests

syntax error: unexpected comma at end of statement

Check failure on line 239 in internal/backend/remote-state/consul/client.go

View workflow job for this annotation

GitHub Actions / Unit Tests

syntax error: unexpected comma at end of statement
}

Check failure on line 240 in internal/backend/remote-state/consul/client.go

View workflow job for this annotation

GitHub Actions / Code Consistency Checks

expected operand, found '}'

Check failure on line 240 in internal/backend/remote-state/consul/client.go

View workflow job for this annotation

GitHub Actions / Code Consistency Checks

expected operand, found '}'
return fmt.Errorf("consul CAS failed with transaction errors: %s", message)

Check failure on line 241 in internal/backend/remote-state/consul/client.go

View workflow job for this annotation

GitHub Actions / Code Consistency Checks

expected ';', found 'return'

Check failure on line 241 in internal/backend/remote-state/consul/client.go

View workflow job for this annotation

GitHub Actions / Code Consistency Checks

expected ';', found 'return'
}

if len(resp.Results) != 1 {
Expand Down Expand Up @@ -289,7 +293,7 @@
return store(payload)
}

func (c *RemoteClient) Delete() error {

Check failure on line 296 in internal/backend/remote-state/consul/client.go

View workflow job for this annotation

GitHub Actions / Code Consistency Checks

expected ';', found error

Check failure on line 296 in internal/backend/remote-state/consul/client.go

View workflow job for this annotation

GitHub Actions / Code Consistency Checks

expected ';', found error
c.mu.Lock()
defer c.mu.Unlock()

Expand Down
Loading