openyurtio / openyurt

OpenYurt - Extending your native Kubernetes to edge(project under CNCF)
https://openyurt.io
Apache License 2.0
1.69k stars 398 forks source link

fix: deployment render should only mutate workloads created by yurtap… #1974

Closed vie-serendipity closed 5 months ago

vie-serendipity commented 5 months ago

…pset v1alpha1

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line: /kind bug /kind documentation /kind enhancement /kind good-first-issue /kind feature /kind question /kind design /sig ai /sig iot /sig network /sig storage

/kind bug

What this PR does / why we need it:

Yurtappset is updated to v1beta1. Now deployment render will mutate all workloads created by yurtappset. Actually, yurtappoverrider should only manage workloads created by yurtappset v1alpha1. Otherwise, it will cause unexpected errors. So we should add some restrictions to deployment webhook of yurtappoverrider.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

None

other Note

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 52.41%. Comparing base (34b14cc) to head (fd4ba7e). Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1974 +/- ## ======================================= Coverage 52.41% 52.41% ======================================= Files 173 173 Lines 21015 21018 +3 ======================================= + Hits 11014 11017 +3 Misses 9051 9051 Partials 950 950 ``` | [Flag](https://app.codecov.io/gh/openyurtio/openyurt/pull/1974/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openyurtio) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/openyurtio/openyurt/pull/1974/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openyurtio) | `52.41% <100.00%> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openyurtio#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sonarcloud[bot] commented 5 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

rambohe-ch commented 5 months ago

@vie-serendipity Thank you for posting the pull request to improve YurtAppSet workload. I agree with you that deployment render webhook should effect v1alpha1.YurtAppSet only.

rambohe-ch commented 5 months ago

/lgtm