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 podhttpchaos: check observedGeneration to avoid duplicated applying #2839

Merged
merged 2 commits into from
Feb 8, 2022

Conversation

Hexilee
Copy link
Member

@Hexilee Hexilee commented Jan 27, 2022

Signed-off-by: xixi i@hexilee.me

What problem does this PR solve?

Now, the controller of PodHttpChaos applies rules in each time reconciling. We should check the observedGeneration to avoid duplicated applying.

What's changed and how it works?

Add checking block:

	if obj.ObjectMeta.Generation <= obj.Status.ObservedGeneration && obj.Status.FailedMessage == "" {
		r.Log.Info("the target pod has been up to date", "pod", obj.Namespace+"/"+obj.Name)
		return ctrl.Result{}, nil
	}

Related changes

  • Need to update chaos-mesh/website
  • Need to update Dashboard UI
  • Need to cheery-pick to release branches
    • release-2.1
    • release-2.0

Checklist

Tests

  • Unit test
  • E2E test
  • No code
  • Manual test (add steps below)

Side effects

  • Breaking backward compatibility

Release note

Please add a release note.

You can safely ignore this section if you don't think this PR needs a release note.

DCO

If you find the DCO check fails, please run commands like below (Depends on the actual situations. For example, if the failed commit isn't the most recent) to fix it:

git commit --amend --signoff
git push --force

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jan 27, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • YangKeao
  • fewdan

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

Copy link
Member

@YangKeao YangKeao left a comment

Choose a reason for hiding this comment

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

LGTM

controllers/podhttpchaos/controller.go Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jan 27, 2022

Codecov Report

Merging #2839 (d75cf3d) into master (4a85452) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2839   +/-   ##
=======================================
  Coverage   40.83%   40.83%           
=======================================
  Files         147      147           
  Lines       11985    11985           
=======================================
  Hits         4894     4894           
  Misses       6721     6721           
  Partials      370      370           
Impacted Files Coverage Δ
api/v1alpha1/zz_generated.chaosmesh.go 57.64% <0.00%> (-0.35%) ⬇️
.../workflow/controllers/workflow_entry_reconciler.go 48.14% <0.00%> (+2.11%) ⬆️

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 80c4d00...d75cf3d. Read the comment docs.

Signed-off-by: xixi <i@hexilee.me>
Copy link
Member

@fewdan fewdan left a comment

Choose a reason for hiding this comment

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

LGTM

@cwen0
Copy link
Member

cwen0 commented Feb 7, 2022

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: ecde103

@ti-srebot
Copy link
Contributor

cherry pick to release-2.0 in PR #2851

@ti-srebot
Copy link
Contributor

cherry pick to release-2.1 in PR #2852

ti-chi-bot added a commit that referenced this pull request Feb 9, 2022
…ng (#2839) (#2852)

Signed-off-by: xixi <i@hexilee.me>

Co-authored-by: xixi <i@hexilee.me>
Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
ti-chi-bot added a commit that referenced this pull request Feb 9, 2022
…ng (#2839) (#2851)

Signed-off-by: xixi <i@hexilee.me>

Co-authored-by: xixi <i@hexilee.me>
Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
zhqqqy pushed a commit to zhqqqy/chaos-mesh that referenced this pull request Apr 10, 2022
…ng (chaos-mesh#2839)

Signed-off-by: xixi <i@hexilee.me>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Signed-off-by: zhqqqy <zhqqqy@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants