-
Notifications
You must be signed in to change notification settings - Fork 95
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
Move system smtp to secret #280
Conversation
Pending to implement the upgrade procedure but the current PR state should have the needed code in templates and operator to deploy SMTP configuration with a secret instead of a configmap. |
d042026
to
e979a47
Compare
Updated PR to include upgrade process to migrate from the 'smtp' ConfigMap to the 'system-smtp' Secret. |
looking good |
Currently the upgrade procedure should work because there isn't an upgrade step at this moment that requires "atomicity" of the changes. |
missing smtp secret documentation |
e979a47
to
a39024d
Compare
Added system-smtp secret documentation. |
a39024d
to
a260fdd
Compare
I've noticed the APIManager controller unit test related to the upgrade fails. The reason for that is that the upgrade code expects the "system" ConfigMap to exist (see migrateSystemSMTPData method in upgrade.go) but it does not exist anymore due to it has been removed in this PR being replaced by a secret. Should we make the UpgradeApiManager implement an interface and use an interface instead from the apimanager_controller being the upgrader a field of the ReconcileAPIManager struct? and mock it in the test so the upgrade method returns an arbitrary result? What do you think? |
Why not just create the smtp configmap for the upgrade test? you can even test the config map has been replaced by secret. |
09a7a86
to
1bb71cb
Compare
I thought about that but this means that in the next release the test will break/need to be changed so they would be prone to errors. Also the number of calls to the Reconcile method in the test will vary depending on the number of elements to upgrade. In any case I've implemented it so you can see how the addition of this new functionality has affected the test in the apimanager_controller_test (in a new commit). Additionally I also needed to mock system-sidekiq DC and add more mock elements into the system-app DC. |
In the next release, all the upgrade tests do not make sense at all and have to be "removed", as it has to be done with the upgrade code. |
1bb71cb
to
3992aca
Compare
3992aca
to
f3e442a
Compare
Code Climate has analyzed commit f3e442a and detected 21 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
system-smtp documentation table updated |
This PR changes the deployment of the SMTP configuration from a ConfigMap to a Secret.
The reason of this is because some of the configuration contains credentials.