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

Fix(health): terraform conflict #3419

Closed
wants to merge 1 commit into from

Conversation

evanli18
Copy link
Contributor

Signed-off-by: Evan Li evan.li97@outlook.com

Description of your changes

"Fixes #3355": Fix health state of the terrafrom comp

Signed-off-by: Evan Li <evan.li97@outlook.com>
@codecov
Copy link

codecov bot commented Mar 11, 2022

Codecov Report

Merging #3419 (999a926) into master (ca8d664) will increase coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3419   +/-   ##
=======================================
  Coverage   39.25%   39.26%           
=======================================
  Files         267      267           
  Lines       26415    26416    +1     
=======================================
+ Hits        10370    10372    +2     
- Misses      14360    14361    +1     
+ Partials     1685     1683    -2     
Flag Coverage Δ
apiserver-unittests 28.03% <ø> (+0.12%) ⬆️
e2e-multicluster-test 26.98% <0.00%> (-0.02%) ⬇️
e2e-rollout-tests 23.34% <0.00%> (-0.03%) ⬇️
e2etests 30.71% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...troller/core.oam.dev/v1alpha2/application/apply.go 58.21% <0.00%> (-0.41%) ⬇️
...ponentdefinition/componentdefinition_controller.go 66.66% <0.00%> (-5.56%) ⬇️
.../core/scopes/healthscope/healthscope_controller.go 70.72% <0.00%> (-0.87%) ⬇️
pkg/oam/util/helper.go 47.56% <0.00%> (-0.49%) ⬇️
pkg/resourcekeeper/gc.go 80.50% <0.00%> (+0.62%) ⬆️
...ller/core.oam.dev/v1alpha2/application/revision.go 65.10% <0.00%> (+0.81%) ⬆️
...dev/v1alpha2/application/application_controller.go 80.37% <0.00%> (+0.93%) ⬆️
...ler/core.oam.dev/v1alpha2/application/generator.go 75.34% <0.00%> (+1.36%) ⬆️
pkg/resourcekeeper/componentrevision.go 58.33% <0.00%> (+8.33%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca8d664...999a926. Read the comment docs.

if configuration.Status.Apply.State != terraformtypes.Available {
if appRev.Name != configuration.GetLabels()["app.oam.dev/appRevision"] ||
configuration.Status.Apply.State != terraformtypes.Available ||
configuration.Status.ObservedGeneration != configuration.Generation {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add an && logic to check whether configuration.Status.ObservedGeneration is set.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That good. here we also need to compare apprev

Copy link
Collaborator

Choose a reason for hiding this comment

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

What will happen if we don't compare apprev?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In kubebuilder, client.Get always gets data from the cache, so client.Get gets data from the cache immediately after applying object.

Ref: kubernetes-sigs/controller-runtime#343

@evanli18 evanli18 closed this Mar 16, 2022
@evanli18 evanli18 deleted the fix/terraform_conflict branch March 16, 2022 09:23
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.

Application 进行更新后 terrafrom component 无法通过 data-passing 拿到正确数据
2 participants