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
Add servergroup policy and rules field support #1382
Add servergroup policy and rules field support #1382
Conversation
9830dcd
to
dc206a8
Compare
@Tjev Sorry for the very long delay. CI has been fixed and I rebased to run the tests etc. could you check as the servergroup tests are failing |
Hello @nikParasyr, I fixed the linter errors and amended the changes. Could I please ask for a re-run of the CI? |
6a4a198
to
946c752
Compare
Hello @nikParasyr, could I ask for some guidance please? I am not sure why the acceptance tests are failing right now.. :/ |
@Tjev ill try to find some time this week to have a look as there is a lot going on atm. sorry for the delay |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Tjev , I actually had some time now :)
I've added some comments in the review.
Moreover, for the tests failing I see in the logs:
2022-09-22T10:31:31.8755532Z | # openstack_compute_servergroup_v2.sg_1 must be replaced
2022-09-22T10:31:31.8755973Z | -/+ resource "openstack_compute_servergroup_v2" "sg_1" {
2022-09-22T10:31:31.8756461Z | ~ id = "89ac55b0-baac-46e5-b2be-306dc0851d33" -> (known after apply)
2022-09-22T10:31:31.8756913Z | ~ members = [] -> (known after apply)
2022-09-22T10:31:31.8757160Z | name = "sg_1"
2022-09-22T10:31:31.8757419Z | - policies = [
2022-09-22T10:31:31.8757693Z | - "affinity",
2022-09-22T10:31:31.8758004Z | ] -> null # forces replacement
2022-09-22T10:31:31.8758364Z | ~ region = "RegionOne" -> (known after apply)
2022-09-22T10:31:31.8758664Z | # (1 unchanged attribute hidden)
2022-09-22T10:31:31.8758888Z | }
for multiple tests. This basically indicated that the Read function is not working properly.
From reading a bit the docs here it looks like policies
is available till 2.63 and then from 2.64 policy
and rules
are available.
In the Read function you dont set Microversion which means that you could set policy/rules on the create, but will not read these proeprties as its using <=2.63 microversion and thus not set them.
So i would first try to read with 2.64 MicroVersion and if its successful set policy
and rules
, otherwise if i get an error i'd try to read without setting a Microversion and set policies
. If i still get an error then just return the error.
I hope this makes sense.
946c752
to
cc26a95
Compare
Hello again @nikParasyr ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Tjev Im not sure why the ci is not running. I tried to kick it but it doesnt. In any case. I've made a couple of comments. Hopefully when you push these changes the ci will work properly. Also
gofmt -s -w .
before comitting will save you from various linting issues
776b6c2
to
aea59f8
Compare
Hello @nikParasyr, once again, I tried to include your feedback. Sorry for the formatting errors, I had some issues with my local go env (gofmt would not work, etc..) and I didn't have enough time on my hands to fix it properly. I was now able to format as instructed ( I left the singular check for presence of |
aea59f8
to
e089773
Compare
the requested changes were addressed
e089773
to
1a9d4c3
Compare
@Tjev I rebased your PR to trigger tests. |
b84dd7e
to
a8b4ca4
Compare
59242cc
to
fd26060
Compare
fd26060
to
09804ca
Compare
09804ca
to
27f6e00
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thank you @nikParasyr & @kayrus ! |
Should resolve #1143.
Addition of
policy
andrules
fields, which replace thepolicies
field since API microversion 2.64. Support for the fields has already been added to Gophercloud.