Fix error on upgrade caused by new vendordata2 attributes#869
Conversation
33d03c5 to
400b44e
Compare
400b44e to
5933b49
Compare
|
Thank you, this fix is definitvely working. |
OddBloke
left a comment
There was a problem hiding this comment.
We're missing some non-integration testing here, and I have concerns about how we got here, but this otherwise looks pretty good to me; I'm going to run the test locally now.
| else: | ||
| pytest.skip(not_run_message) | ||
|
|
||
| launch_kwargs = {'image_id': session_cloud._get_initial_image()} |
There was a problem hiding this comment.
Should we promote _get_initial_image to the public API?
(Side note, which I noticed when reading _get_initial_images code: should we be caching that value so that we avoid getting different "initial" images if we call that before and after an image publication?)
There was a problem hiding this comment.
What do you mean by before and after an image publication?
Although, now that I look at it again, should I just make released_image_id public and use that instead?
There was a problem hiding this comment.
What do you mean by before and after an image publication?
We'll call _get_initial_image once when session_cloud is first instantiated (in the entire test run), and once again here: if a release image is released between those two calls, we'll run this test and the other tests against different images.
Although, now that I look at it again, should I just make released_image_id public and use that instead?
Aha, yeah, I guess we are caching the value already! 👍
I've confirmed that the test in this branch fails when run against an old focal image with a deb built from main: and passes with a deb built from this branch: |
|
@OddBloke I believe I addressed your comments. I had a question/comment about the unit test.
|
Proposed Commit Message
Additional Context
We haven't caught this is our current upgrade test because we haven't been checking for error status of
cloud-init status. I added a check for that in the larger upgrade test as well.Test Steps
Since the latest cloud-init version is already in LXD images, it's not as straightforward. You can launch a xenial instance and then upgrade to the latest PPA/deb. For other releases, you can launch an instance, manually downgrade to 20.4.1, run a
cloud-init clean, then upgrade to latest. I've manually reproduced the bug both ways and manually verified the bug both ways.I also locally reproduced/verified the new integration test by launching the test against a xenial instance (CI uses focal).