-
Notifications
You must be signed in to change notification settings - Fork 59
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
crowbar: Remove forgotten nodes from proposals #1116
base: master
Are you sure you want to change the base?
Conversation
@@ -132,7 +132,32 @@ def transition(inst, name, state) | |||
end | |||
|
|||
if state == "delete" | |||
# Do more work here - one day. | |||
# Remove node from all applied proposals | |||
RoleObject.all.select(&:proposal?).each do |role| |
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.
Lint/ShadowingOuterLocalVariable: Shadowing outer local variable - role.
Forgotten nodes are not removed from existing proposals (applied and non-applied). While the webui removes non-existing nodes when displaying a proposal, if only the API is used, applying a proposal with such non-existing nodes may result in failures. Closes sap-oc#8
cf0e0a0
to
a31a710
Compare
@vuntz shall we merge this, or the CI failure is a blocker? |
@aspiers could you weigh in please, we need your help :-) |
The CI failure is a standard haproxy failure which has been happening for a while. I doubt the CI even exercises this code path. |
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.
I haven't thought hard about this, but it feels like there might be one or even two privacy violations here. I'm sure that's typical within Crowbar, but while fixing them is out of scope of this PR, maybe it shouldn't add new ones.
The first one would be directly manipulating RoleObject
s which represent proposals, rather than going through a Proposal
facade. Secondly, removing nodes from proposals seems like something that should belong to Proposal
, not here. I'm inclined to think that DeployerService
should simply invoke that API, rather than implement the removal itself.
However there's a good chance I'm way off base here, in which case let me know and I'll remove my -1.
Forgotten nodes are not removed from existing proposals (applied and
non-applied). While the webui removes non-existing nodes when displaying
a proposal, if only the API is used, applying a proposal with such
non-existing nodes may result in failures.
Closes sap-oc#8