From 0d36bff01dc49b9fa08abc231d1f5e281ba530d4 Mon Sep 17 00:00:00 2001 From: Rafael Gomes Date: Mon, 22 Jan 2024 00:51:15 -0300 Subject: [PATCH] Fix issue that doesn't switch profile back to `default` if an error happens while running `copy-image-from-upstream` command (#135) * fix: ensure that profile is switched back to default * docs: update CHANGELOG --- CHANGELOG.md | 4 ++++ lib/command/copy_image_from_upstream.rb | 1 + 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2ccaa6f..76298ffb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,10 @@ Changes since the last non-beta release. _Please add entries here for your pull requests that are not yet released._ +### Fixed + +- Fixed issue where cpln profile was not switched back to `default` if an error happened while running `copy-image-from-upstream` command. [PR 135](https://github.com/shakacode/heroku-to-control-plane/pull/135) by [Rafael Gomes](https://github.com/rafaelgomesxyz). + ### Added - Added `--domain` option to `maintenance`, `maintenance:on` and `maintenance:off` commands. [PR 131](https://github.com/shakacode/heroku-to-control-plane/pull/131) by [Rafael Gomes](https://github.com/rafaelgomesxyz). diff --git a/lib/command/copy_image_from_upstream.rb b/lib/command/copy_image_from_upstream.rb index be052dff..08b7840d 100644 --- a/lib/command/copy_image_from_upstream.rb +++ b/lib/command/copy_image_from_upstream.rb @@ -38,6 +38,7 @@ def call # rubocop:disable Metrics/MethodLength pull_image_from_upstream push_image_to_app ensure + cp.profile_switch("default") delete_upstream_profile end