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

avoid repetitive errors on adding fdb entry if it already exists #11788

Merged
merged 1 commit into from
Nov 4, 2016

Conversation

rajatchopra
Copy link
Contributor

cc @openshift/networking

Copy link
Contributor

@knobunc knobunc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM based on @rajatchopra 's description of how F5 works.

@@ -977,7 +977,12 @@ func (f5 *f5LTM) AddVtep(ipStr string) error {
Name: macAddr,
Endpoint: ipStr,
}
return f5.post(url, payload, nil)
err = f5.post(url, payload, nil)
if err != nil && err.(F5Error).httpStatusCode != HTTP_CONFLICT_CODE {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're sure it'll always be an F5Error type returned from f5.post()? Might be safer to check the cast and always return the error if !err.(F5Error)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are constructing this error type.
https://github.com/rajatchopra/origin/blob/f5_fdb/pkg/router/f5/f5.go#L407
The field httpStatusCode is always filled up either with nil value '0' if the request failed without obtaining the http status code or with the actual status code here:
https://github.com/rajatchopra/origin/blob/f5_fdb/pkg/router/f5/f5.go#L430

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, cool.

@rajatchopra
Copy link
Contributor Author

Example error that this code tries to bypass:

E1104 17:41:07.977028       1 plugin.go:521] Error in adding node '10.3.89.134' to F5s FDB - Encountered an error on
POST request to URL https://10.3.88.54/mgmt/tm/net/fdb/tunnel/~Common~vxlan5000/records: HTTP code: 409; error from F5:
01020066:3: The requested L2 forward tunnel (/Common/vxlan5000 0a:0a:0a:03:59:86) already exists in partition Common.

@dcbw
Copy link
Contributor

dcbw commented Nov 4, 2016

LGTM

@knobunc
Copy link
Contributor

knobunc commented Nov 4, 2016

[merge]

@openshift-bot
Copy link
Contributor

openshift-bot commented Nov 4, 2016

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/11152/) (Image: devenv-rhel7_5320)

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to dd78339

@openshift-bot
Copy link
Contributor

[Test]ing while waiting on the merge queue

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to dd78339

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/11152/) (Base Commit: 6bf8b33)

@openshift-bot openshift-bot merged commit 262bb72 into openshift:master Nov 4, 2016
@rajatchopra rajatchopra deleted the f5_fdb branch November 7, 2016 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants