Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration updates #394

Merged
merged 5 commits into from
Oct 21, 2020
Merged

Configuration updates #394

merged 5 commits into from
Oct 21, 2020

Conversation

ChunyiLyu
Copy link
Contributor

This closes #225

Note to reviewers: remember to look at the commits in this PR and consider if they can be squashed

Summary Of Changes

  • adds a timestamped annotation to the server-conf configmap "rabbitmq.com/serverConfUpdatedAt" when the configMap is updated
  • controller compares the timestamp of the server-conf configMap and the sts restart timestamp (if exists)
  • if the sts restart timestamp is before the server conf timestamp, or if the server-conf has the timestamp, and the sts doesn't, the controller restarts the sts by annotating the podTemplate (how we trigger the sts restart is the same as before)
  • randomized specs for unit tests.
  • deleted unused method "UpdateRequiresStsRestart()" from all the resource builders; it was used previously in the controller for sts updates.
  • added test cases in integration to ensure annotations are added for sts and server-conf configmap for all rabbitmq configurations updates.
  • no new system tests since the use case is the same as before and already covered.

Additional Context

Local Testing

Have run unit, integration, and system tests locally.

- the controller adds a timestamp to sts podTemplate annotation to
trigger its restart
- this commits adds a timestamp annotation to server-conf configMap
every time it's updated
- if the sts restart annotation does not exist or the time is
prior to the server-conf annotation, we restart the sts by annotating it
Copy link
Member

@Zerpet Zerpet left a comment

Choose a reason for hiding this comment

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

Looking good. I made a recommendation around the decision to requeue. Feel free to comment if you disagree with the recommendation.

Copy link
Member

@ansd ansd left a comment

Choose a reason for hiding this comment

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

Very good!
I like that UpdateRequiresStsRestart is gone 🙂

Copy link
Member

@Zerpet Zerpet left a comment

Choose a reason for hiding this comment

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

Ginkgo's DescribeTables are awesome! 🙌

@ChunyiLyu ChunyiLyu merged commit 73233e7 into main Oct 21, 2020
@ChunyiLyu ChunyiLyu deleted the configuration-updates branch October 21, 2020 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Better solution for updating configurations
3 participants