Skip to content
This repository was archived by the owner on Nov 16, 2022. It is now read-only.

Conversation

@mhajas
Copy link
Contributor

@mhajas mhajas commented Apr 30, 2020

JIRA ID

Additional Information

Verification Steps

Checklist:

  • Verified by team member
  • Comments where necessary
  • Automated Tests
  • Documentation changes if necessary

Additional Notes

return r.ManageError(instance, err)
}

// Skip Reconcilation of Keycloak if there is any migration needed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's how this should work:

  • The migrator should operate on a processed desiredState. The idea is to modify it (the desiredState) to meet migration needs.
  • Implementing it as you proposed, will tie our hands for the future. A migrated version might require additional K8s objects (such as ConfigMaps or Secrets). As the migrator executes before the reconciler (and moreover, the reconciler backs off during the migration), those objects will not be created. This may lead to many problems in the future and very messy code. I'd like to avoid it.
  • The migrator should obtain a copy of desiredState from the main loop (pass by value), find the StatefulSet object, change its number of replicas to 1 and pass it back to the main loop.
  • Once the ActionRunner executes it, the number of replicas should drop to 1 (if your cluster had 10 replicas, 9 of them should get into terminating state) and the StatefulSet rolling upgrade should kill the remaining one during the upgrade.
  • The next loop should increase the number of replicas back to 10.

So it seems to me there some bug in the migrator, so that it doesn't return a modified StatefulSet. Would you mind to check it up?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @slaskawi. I see now. This was just an idea. I will incorporate your suggestions.

@mhajas mhajas force-pushed the KEYCLOAK-14035-Operator-migration-step-doesn-t-work branch from b92f093 to cadf0f8 Compare May 4, 2020 07:57
@mhajas mhajas marked this pull request as ready for review May 4, 2020 07:58
@mhajas
Copy link
Contributor Author

mhajas commented May 4, 2020

@slaskawi I think this is ready for review now.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 41.338% when pulling cadf0f8 on mhajas:KEYCLOAK-14035-Operator-migration-step-doesn-t-work into c3a2a13 on keycloak:master.

@slaskawi slaskawi merged commit 62057bc into keycloak:master May 4, 2020
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.

3 participants