Resource type substitution is destructive in convergence
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Heat |
Fix Released
|
High
|
Zane Bitter | ||
Newton |
Won't Fix
|
High
|
Zane Bitter | ||
Ocata |
Fix Committed
|
High
|
Zane Bitter | ||
Pike |
Fix Committed
|
High
|
Zane Bitter | ||
Queens |
Fix Released
|
High
|
Zane Bitter |
Bug Description
We're supposed to be able to replace a deprecated resource type like OS::Heat:
The likely cause is https:/
The test that was supposed to guard against this is checking completely the wrong resource - the server (which isn't even modified) instead of the software deployment group (which is getting replaced when it shouldn't be): https:/
Changed in heat: | |
status: | Triaged → In Progress |
tags: | added: convergence-bugs ocata-backport-potential pike-backport-potential |
Reviewed: https:/ /review. openstack. org/516759 /git.openstack. org/cgit/ openstack/ heat/commit/ ?id=93b4551d9a1 ff9194b30a079f0 2db691129c69b0
Committed: https:/
Submitter: Zuul
Branch: master
commit 93b4551d9a1ff91 94b30a079f02db6 91129c69b0
Author: Zane Bitter <email address hidden>
Date: Wed Nov 1 18:03:20 2017 -0400
Fix non-destructive upgrade for deprecated res types in convergence
When a user updates from a deprecated resource type to an but-differently -named one (e.g. from :Heat:: SoftwareDeploym ents to OS::Heat: :SoftwareDeploy mentGroup) , Heat 640ea5a59b7e532 c022a4939b the new Resource
equivalent-
OS:
is supposed to change the type without replacing the resource as it would
normally do when a resource type changes. This was broken in convergence,
because since 45073226752c58d
object we create during the check_resource operation (using the new type's
plugin) is no longer automatically initialised with data from the database
as resources in the legacy path are.
Move the substitution checking to the Resource.load() method, so that it convergence( ) method then we need only check that the resource class
now returns an instance of the new plugin where allowed. In the actual
update_
is the one we'd expect from the new template, and replace the resource if
not.
We do have a test that is designed to check that this is working, but in it
we didn't compare the physical IDs of the resource that is potentially
getting replaced, but rather the physical IDs of some other resource that
can't possibly get modified (surprise! it doesn't change).
Change-Id: I75778abc303525 a71d0a918f7192f 00a43c21284
Closes-Bug: #1729439