-
Notifications
You must be signed in to change notification settings - Fork 897
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
Map server to zone in pods #19770
Map server to zone in pods #19770
Conversation
This is required to manage servers when running in containers. Without this change a user would be stuck with a single server and would not be able to make use of the features that zones provide.
This will be used by the UI instead of their current, separate logic
In specs we often will create a server, which creates a zone for us in the factory. Previously, even when we were simulating running in pods, that would leave us with one server and one zone. Now, the zone creation process is checking the environment for podified and creating a server itself. This leaves us with an extra call to MiqEnvironment::Command.is_podified and some bonus server records. This commit handles both of those issues.
d27d378
to
3fdfb86
Compare
Cross repo test for UI PR and API ManageIQ/manageiq-cross_repo-tests#58 |
Checked commits carbonin/manageiq@eaf2420~...3fdfb86 with ruby 2.5.5, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 app/models/zone.rb
|
@h-kataria Do you know why the UI blocks deletion of Zones when schedules are attached? |
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.
👍 ... just want some clarification on the zone->schedules thing in the UI
As far as I could tell it was added in commit 2170f15bd09d4fe69fd3759e00dcc5b87e4096c6 (2013) |
This PR makes some changes to zones and servers to make them easier to manage in pods.
Automatically create a server when a zone is created and delete the servers in a zone when a zone is deleted. This also requires toning down the restrictions on deleting servers and zones.
While testing this change I found that the UI has separate logic to determine when a zone is able to be deleted. This PR also consolidates that logic with the most important change that we're allowing a zone to be deleted if it has schedules associated with it. Previously the UI prevented the delete if schedules were present, but the model didn't check for that and, in fact, has a
:dependent_destroy
on the relation.Applies to ManageIQ/manageiq-pods#353