Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

fix switched active and standby host infos #13

Merged
merged 1 commit into from
Dec 30, 2020

Conversation

Schnitzel
Copy link
Member

@Schnitzel Schnitzel commented Dec 24, 2020

during testing of v0.1.8 I realized that the active and standby hosts are switched in the HostMigration object after the migration was done, this lead to the issue that the URLs in the lagoon UI where also shown wrong.
After some debugging I realized that there was probably a logic issue in the code, here what I found:

  1. we create the HostMigration object in the current standby namespace, hence the source is the current standby and future active and destination is the current active and future standby
  2. in the code the part that runs migrateDestinationToSource is the part that moves the host from the current active (destination) to the future active (source), but we stored the routes in standbyMigratedIngress while it should be stored in activeMigratedIngress
  3. the code migrateSourceToDestination had it exactly switched

I pushed the fix as amazeeio/dioscuri:v0.1.9rc1 for testing and it seems to work nicely:

here an example before the fix:

kind: HostMigration
apiVersion: dioscuri.amazee.io/v1
spec:
  activeEnvironment: drupal-example-test1-controller-master2
  destinationNamespace: drupal-example-test1-controller-master
  hosts:
    activeHosts: 'https://standby.controller.test1.amazee.io'
    standbyHosts: 'https://active.controller.test1.amazee.io'

and after the fix

kind: HostMigration
apiVersion: dioscuri.amazee.io/v1
spec:
  activeEnvironment: drupal-example-test1-controller-master
  destinationNamespace: drupal-example-test1-controller-master2
  hosts:
    activeHosts: 'https://active.controller.test1.amazee.io'
    standbyHosts: 'https://standby.controller.test1.amazee.io'

@Schnitzel Schnitzel merged commit 51e76ec into main Dec 30, 2020
@shreddedbacon
Copy link
Member

LGTM, I probably missed this as the active/standby test in Lagoon doesn't check this either.

Will write an additional test that checks this too.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants