-
Notifications
You must be signed in to change notification settings - Fork 66
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
Fix: legacy backend state reading and GC #338
Conversation
Codecov Report
@@ Coverage Diff @@
## master #338 +/- ##
==========================================
+ Coverage 76.58% 79.62% +3.03%
==========================================
Files 24 23 -1
Lines 1764 1737 -27
==========================================
+ Hits 1351 1383 +32
+ Misses 335 272 -63
- Partials 78 82 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a user applies a Configuration without spec.Backend
, then the terraform apply
job will use the default kubernetes backend whose secret is {Namespace: ${env.TERRAFORM_BACKEND_NAMESPACE} || ${configuration.Namespace}, Name: tfstate-default-${confguration.Name}}
.
Then, the user restarts the controller with --controller-namespace
. In this case, the terraform apply
job will use the default kubernetes backend whose secret is {Namespace: ${env.TERRAFORM_BACKEND_NAMESPACE} || ${configuration.Namespace}, Name: tfstate-default-${confguration.UID}}
.
The two backend secrets are in the same namespace but have different names. Will this cause an error?
Shoule we add some e2e tests for the "restart controller with |
There are duplications. But it's OK.
|
Fix: legacy backend GC add e2e test split package Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
For now if restart controller with
--controller-namespace
. The configuration state will becomeGeneratingTerraformOutputs
and stuck. This is because controller can't got the legacy backend.Fix that
Configuration.Spec.Backend
will be overwritten if set--controller-namespace
. Instead, now controlleronly overwrite
Configuration.Spec.Backend
when no backend specified.How is this tested
Add both unittest and e2e test
Signed-off-by: Qiaozp qiaozhongpei.qzp@alibaba-inc.com