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 empty rolloutBatch will panic whole controller bug #1646

Merged
merged 2 commits into from May 12, 2021
Merged

fix empty rolloutBatch will panic whole controller bug #1646

merged 2 commits into from May 12, 2021

Conversation

wangyikewxgm
Copy link
Collaborator

@wangyikewxgm wangyikewxgm commented May 12, 2021

fix #1631
1.add validation webhook to verify rolloutBatches must not be empty
2.guarantee empty rolloutBatches couldn't crash whole controller even though disable webhook

@codecov
Copy link

codecov bot commented May 12, 2021

Codecov Report

Merging #1646 (496fb98) into master (58b3fff) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1646      +/-   ##
==========================================
- Coverage   62.39%   62.36%   -0.04%     
==========================================
  Files         120      120              
  Lines       11931    11937       +6     
==========================================
  Hits         7444     7444              
- Misses       3724     3730       +6     
  Partials      763      763              
Flag Coverage Δ
e2etests 43.74% <33.33%> (-0.23%) ⬇️
unittests 58.19% <100.00%> (-0.03%) ⬇️

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

Impacted Files Coverage Δ
pkg/controller/common/rollout/workloads/common.go 98.50% <100.00%> (+0.09%) ⬆️
...ok/core.oam.dev/v1alpha2/application/validation.go 86.66% <100.00%> (+2.05%) ⬆️
...ponentdefinition/componentdefinition_controller.go 79.20% <0.00%> (-4.00%) ⬇️
...dev/v1alpha2/application/application_controller.go 79.13% <0.00%> (-3.60%) ⬇️
...ller/core.oam.dev/v1alpha2/application/revision.go 70.78% <0.00%> (-3.38%) ⬇️
...ev/v1alpha2/core/scopes/healthscope/healthscope.go 90.40% <0.00%> (-1.02%) ⬇️
...oam.dev/v1alpha2/applicationconfiguration/apply.go 68.34% <0.00%> (ø)
...g/controller/core.oam.dev/v1alpha2/core/revison.go 72.97% <0.00%> (+1.80%) ⬆️
pkg/webhook/common/rollout/rollout_plan.go 64.91% <0.00%> (+3.50%) ⬆️
...erizedworkload/containerizedworkload_controller.go 77.08% <0.00%> (+5.20%) ⬆️
... and 1 more

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 58b3fff...496fb98. Read the comment docs.

@wangyikewxgm wangyikewxgm changed the title fix rolloutBatch empty panic whole controller bug fix empty rolloutBatch will panic whole controller bug May 12, 2021
Copy link
Collaborator

@wonderflow wonderflow left a comment

Choose a reason for hiding this comment

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

good job

@wonderflow wonderflow merged commit 0a4c20c into kubevela:master May 12, 2021
yangsoon pushed a commit to yangsoon/kubevela that referenced this pull request May 13, 2021
* add webhook for app and avoid controller panic

neat imports

* add test for rollout verify
yangsoon pushed a commit to yangsoon/kubevela that referenced this pull request May 17, 2021
* add webhook for app and avoid controller panic

neat imports

* add test for rollout verify
# Conflicts:
#	pkg/webhook/core.oam.dev/v1alpha2/application/validating_handler_test.go
#	pkg/webhook/core.oam.dev/v1alpha2/application/validation.go
#	test/e2e-test/application_test.go
yangsoon pushed a commit to yangsoon/kubevela that referenced this pull request May 17, 2021
* add webhook for app and avoid controller panic

neat imports

* add test for rollout verify
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.

[Bug]vela-core will crash when rolloutBatches is empty
2 participants