rhtconsulting / rhc-ose

OpenShift Automation and Utilities by Red Hat Consulting
42 stars 34 forks source link

Final version of the promotion tool #73

Closed oybed closed 8 years ago

oybed commented 8 years ago

What does this PR do?

This PR introduces the "osc-manage-image" tool. This tool is meant to be the one used to promote a newly created test image to be the main ose3 base image.

How should this be manually tested?

NOTE: to avoid disruption to the already in-use "ose3-base" image, make sure to follow these steps carefully.

  1. Make sure 2 test images are available, e.g.: At time of writing, these two images are available: ose-test-img-0000-28-Oct-2015 and ose-test-img-1039-27-Oct-2015
    1. Capture the ID of these images - used to validate the steps below
  2. Change the value of "image_name" in provisioning/lib/constants to one of the above images, e.g.: ose-test-img-0000-28-Oct-2015
    1. For the purpose of this test, this image becomes the "base" image to be retired and the name of the newly promoted image
    2. Also make sure a instance/vm is using the image before doing the promotion
  3. Run the "osc-manage-image" tool to promote the other image, e.g.: ./osc-manage-image --action=promote --image-name=ose-test-img-1039-27-Oct-2015
  4. Verify that the original "ose-test-img-0000-28-Oct-2015" has been renamed something like "ose3-delete-after-X-Y-Z", verify "ose-test-img-1039-27-Oct-2015" has been renamed to "ose-test-img-0000-28-Oct-2015"
    1. Use the image IDs from step 1a above to validate the images
  5. Verify that the instance/vm using the former "base image" is now using the image named "ose3-delete-after...."
  6. Verify that the newly become "base image" is marked with Public set to "Yes"

Example run:

>> ./osc-manage-image --action=promote --image-name=ose-test-img-1039-27-Oct-2015
This will promote 'ose-test-img-1039-27-Oct-2015' to 'ose3-base' - do you want to continue? [Y]: n
Exiting...
>>  ./osc-manage-image --action=promote --image-name=ose-test-img-1039-27-Oct-2015
This will promote 'ose-test-img-1039-27-Oct-2015' to 'ose3-base' - do you want to continue? [Y]: 
Backing up image 'ose3-base' => 'ose3-delete-after-12-Feb-2016' ...
Promoting image 'ose-test-img-1039-27-Oct-2015' => 'ose3-base' ...
Done! Image 'ose-test-img-1039-27-Oct-2015' has been promoted to 'ose3-base'.

Is there a relevant Issue open for this?

N/A

Who would you like to review this?

/cc @etsauer

etsauer commented 8 years ago

@oybed looks good. Going to merge.