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

Octavia l7 rule support - part 5(final): update #936

Merged
merged 2 commits into from
Apr 17, 2018

Conversation

lingxiankong
Copy link
Contributor

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 77.705% when pulling 0a664f8 on lingxiankong:update-l7rule into 1ad03b8 on gophercloud:master.

@coveralls
Copy link

coveralls commented Apr 16, 2018

Coverage Status

Coverage decreased (-0.04%) to 77.635% when pulling 34a6534 on lingxiankong:update-l7rule into 1ad03b8 on gophercloud:master.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Apr 16, 2018

Build succeeded.

@lingxiankong
Copy link
Contributor Author

@jtopjian @jrperritt the last one patch for review

@jtopjian
Copy link
Contributor

@lingxiankong It looks like AdminStateUp is a valid field:

https://github.com/openstack/octavia/blob/69a45c254be854dbdbff946dbe2564711cdecec3/octavia/api/v2/types/l7rule.py#L83

I reviewed #924 wondering how we missed that one earlier and saw that you linked to the v1/types/l7rule.py file. :)

https://github.com/openstack/octavia/blob/86812e1309feb1bbfbc5448c12b80602d2d0a141/octavia/api/v1/types/l7rule.py#L31

I think the addition of this field in both CreateOpts and UpdateOpts is small enough to add to this PR without causing too much complication. Or you can create a new PR for it -- your choice.

The field definition would be the same for both CreateOpts and UpdateOpts:

AdminStateUp *bool `json:"admin_state_up,omitempty"`

Other than that, this looks good to me :)

@jtopjian
Copy link
Contributor

jtopjian commented Apr 17, 2018

@lingxiankong Again, commented too early - sorry. It looks like AdminStateUp is missing for both Policy and Rule.

It's best to make a separate PR at this point. You can use #832 as the referenced issue -- no need to make a new issue.

The PR will simply include the missing AdminStateUp field for the 4 structs.

Copy link
Contributor

@jtopjian jtopjian left a comment

Choose a reason for hiding this comment

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

@lingxiankong One change to make. Please make the same update to the Update func, too.

But as per the other comments, let's still defer the addition of the AdminStateUp fields to a separate PR.


// UpdateRule allows Rule to be updated.
func UpdateRule(c *gophercloud.ServiceClient, policyID string, ruleID string, opts UpdateRuleOptsBuilder) (r UpdateRuleResult) {
b, _ := opts.ToRuleUpdateMap()
Copy link
Contributor

Choose a reason for hiding this comment

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

I was about to merge this and caught this. I see it's also done with the Update function which I didn't catch earlier either.

Granted it's really hard to trigger an error with this, we should still check for an error regardless.

b, err := opts.ToRuleUpdateMap()
if err != nil {
  r.Err = err
  return
}

@theopenlab-ci
Copy link

theopenlab-ci bot commented Apr 17, 2018

Build succeeded.

@jtopjian
Copy link
Contributor

LGTM - thank you for the update :)

@jtopjian jtopjian merged commit aa92b79 into gophercloud:master Apr 17, 2018
@lingxiankong lingxiankong deleted the update-l7rule branch January 17, 2019 02:38
cardoe pushed a commit to cardoe/gophercloud that referenced this pull request Aug 27, 2020
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.

None yet

3 participants