File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -376,6 +376,11 @@ func (r *Migration) begin() (err error) {
376376// Archive the plan.
377377// Best effort to remove any retained migration resources.
378378func (r * Migration ) Archive () {
379+ defer func () {
380+ if r .provider != nil {
381+ r .provider .Close ()
382+ }
383+ }()
379384 if err := r .init (); err != nil {
380385 r .Log .Error (err , "Archive initialization failed." )
381386 return
@@ -407,6 +412,11 @@ func (r *Migration) Archive() {
407412}
408413
409414func (r * Migration ) SetPopulatorDataSourceLabels () {
415+ defer func () {
416+ if r .provider != nil {
417+ r .provider .Close ()
418+ }
419+ }()
410420 err := r .init ()
411421 if err != nil {
412422 r .Log .Error (err , "Setting Populator Data Source labels failed." )
@@ -434,6 +444,11 @@ func (r *Migration) SetPopulatorDataSourceLabels() {
434444// Cancel the migration.
435445// Delete resources associated with VMs that have been marked canceled.
436446func (r * Migration ) Cancel () error {
447+ defer func () {
448+ if r .provider != nil {
449+ r .provider .Close ()
450+ }
451+ }()
437452 if err := r .init (); err != nil {
438453 return liberr .Wrap (err )
439454 }
You can’t perform that action at this time.
0 commit comments