-
-
Notifications
You must be signed in to change notification settings - Fork 351
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
fog-core 2.x, fog-json 1.x #433
Conversation
Looks good in theory, seems there are a couple breakages though, unfortunately. |
References #227
56480c0
to
ec620d8
Compare
ListenerDescriptions and BackendServerDescriptions are used to build ad-hoc collections but are not registered as attributes of the LoadBalancer model.
'ListenerDescriptions' => attributes['ListenerDescriptions'], | ||
'BackendServerDescriptions' => attributes['BackendServerDescriptions'], | ||
) | ||
end |
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.
Why do you need this? Maybe we need to improve this method on fog-core
?
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.
Attributes are not registered by an attribute
declaration but are used to generate to collections from the underlying attributes data.
This seems like a reasonable workaround using normal OO methodology.
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.
Got it. I'm not really pointing this as a problem but i'm more interested in knowing the reasons behind it. If it does inflect an in improvement in fog-core
i would be more then happy to do it myself. =)
Are those attributes not being used by the DSL for a particular reason? Is there something i can improve in fog-core
to help improve the usage?
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.
They seem to describe related resources but not this resource, which is my they are not included as attributes. If other providers are having this issue, we could introduce a "hidden attribute" (data we want to keep but does not describe the current model).
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.
Hmmm. So you mean an attribute
that ideally does not belong to this resource but the API expects? Like a concept issue from the API standpoint?
BTW, this is not a blocker. I'm just trying to figure out the use case to see if/how we can improve fog-core
. My main goal now is to get it to a better state.
Copying the test failure here for convenience:
Question: Is this test failure the result of breaking changes in the updated dependencies (eg. fog-core) or is it a result of the preceding warning:
I'm not seeing any mention of "volumes" in the fog-core changelog There were actually very few changes between 1.45 and 2.0
|
I don't think fog-core has a notion of volumes at all, so I don't think it would be that. Other changes to fog-core could be causing this, I suppose, but I'm not sure which one specifically. I suppose the association reload fix might relate, but I'm not at all certain about that (none of the others look particularly related). |
What should we make of the "Unable to fetch credentials: Expected(200) <=> Actual(404 Not Found)" error? Do you think it's related to the test failure in volume_tests.rb? Sorry if these are noob questions, I don't know much about fog yet. |
@jaredbeck no worries. I think it is probably unrelated (and it's just a warning). Most likely there is an actual issue in the parameters passed within that attach volumes call. |
new fog-core model#reload resets the model the current remote state. The previous implementation of volume relied upon initializing with a device, reloading the model several times, and then attaching with a server instance is set. IMO, the new fog-core is doing the correct thing. To support this behavior, make #attach and #detach public methods and require a device argument in #attach. #server= does exist but only as an attr_writer. This may cause some confusion in the future release and must be included in the CHANGELOG.
got it working. needed to change the volume interface slightly, but I think it's for the better. |
LGTM! |
end | ||
|
||
def attach(new_server) | ||
def attach(new_server, new_device) |
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.
Could you elaborate on why the new argument is needed? The rest looks good, but I don't think I'm quite groking this. Thanks!
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.
Tests asserted this procedure
v = service.volumes.create(device: '/dev/sda1', **)
v.server = service.instances.create(**) # requires :device
In step 1, a device is provided to a volume instance. In step 2, the model calls Fog.wait_for { ready? }
(implicit reload) and then attaches the server.
The issue is between step 1 and 2, there is a property of the local model (device = '/dev/sda1'
) that does not match the remote model (device = nil
).
On reload
:
fog-core 1.x
, thedevice
attribute retained it's value.fog-core 2.x
,device
is set the correct remote value (nil
).
IMO a reload
should put the local model in the same state as the remote model. To enforce that, I've removed the ability for volume.server = server
to attach volume and instead require calling volume.attach(server, device)
.
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.
Sounds like a plan, thanks for clarifying.
Thanks @lanej et al. for your work on this. |
References #227