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: webhook overwrite deployment owned by yad/yas #1851

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

luc99hen
Copy link
Member

@luc99hen luc99hen commented Dec 11, 2023

What type of PR is this?

/kind bug

What this PR does / why we need it:

Currently, deployment overrider webhook will override the deployment spec owned by a yad(yurtappdaemon) with the yad template. However, the nodeselector field in the deployment spec will be set to null because it's not set in the yad template but set by the yad controller. This leads to issue.

We need to use the applyTemplate in the yad controller to get the complete deployment spec.

Which issue(s) this PR fixes:

Fixes # #1841

Special notes for your reviewer:

@rambohe-ch @vie-serendipity

Does this PR introduce a user-facing change?


other Note

@openyurt-bot
Copy link
Collaborator

@luc99hen: GitHub didn't allow me to assign the following users: your_reviewer.

Note that only openyurtio members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

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

What this PR does / why we need it:

Currently, deployment overrider webhook will override the deployment spec owned by a yad(yurtappdaemon) with the yad template. However, the nodeselector field in the deployment spec will be set to null because it's not set in the yad template but set by the yad controller. This leads to issue.

We may not need this rewrite logic in the webhook. Just let the deployment be the original version is fine.

Which issue(s) this PR fixes:

Fixes # #1841

Special notes for your reviewer:

@rambohe-ch @vie-serendipity

Does this PR introduce a user-facing change?


other Note

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openyurt-bot
Copy link
Collaborator

@luc99hen: The label(s) kind/bug., kind/ cannot be applied, because the repository doesn't have them

In response to this:

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

What this PR does / why we need it:

Currently, deployment overrider webhook will override the deployment spec owned by a yad(yurtappdaemon) with the yad template. However, the nodeselector field in the deployment spec will be set to null because it's not set in the yad template but set by the yad controller. This leads to issue.

We may not need this rewrite logic in the webhook. Just let the deployment be the original version is fine.

Which issue(s) this PR fixes:

Fixes # #1841

Special notes for your reviewer:

@rambohe-ch @vie-serendipity

Does this PR introduce a user-facing change?


other Note

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openyurt-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: luc99hen
To complete the pull request process, please assign rambohe-ch
You can assign the PR to them by writing /assign @rambohe-ch in a comment when ready.

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

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openyurt-bot openyurt-bot added the size/S size/S 10-29 label Dec 11, 2023
@luc99hen luc99hen changed the title Fix: webhook override deployment owned by yad/yas Fix: webhook overwrite deployment owned by yad/yas Dec 11, 2023
@openyurt-bot
Copy link
Collaborator

@luc99hen: The label(s) kind/bug., kind/ cannot be applied, because the repository doesn't have them

In response to this:

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

What this PR does / why we need it:

Currently, deployment overrider webhook will override the deployment spec owned by a yad(yurtappdaemon) with the yad template. However, the nodeselector field in the deployment spec will be set to null because it's not set in the yad template but set by the yad controller. This leads to issue.

We may not need this rewrite logic in the webhook. Just let the deployment be the original version is fine.

Which issue(s) this PR fixes:

Fixes # #1841

Special notes for your reviewer:

@rambohe-ch @vie-serendipity

Does this PR introduce a user-facing change?


other Note

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openyurt-bot
Copy link
Collaborator

@luc99hen: The label(s) kind/bug., kind/ cannot be applied, because the repository doesn't have them

In response to this:

What type of PR is this?

/kind bug.

What this PR does / why we need it:

Currently, deployment overrider webhook will override the deployment spec owned by a yad(yurtappdaemon) with the yad template. However, the nodeselector field in the deployment spec will be set to null because it's not set in the yad template but set by the yad controller. This leads to issue.

We may not need this rewrite logic in the webhook. Just let the deployment be the original version is fine.

Which issue(s) this PR fixes:

Fixes # #1841

Special notes for your reviewer:

@rambohe-ch @vie-serendipity

Does this PR introduce a user-facing change?


other Note

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openyurt-bot openyurt-bot added the kind/bug kind/bug label Dec 11, 2023
@openyurt-bot openyurt-bot added size/M size/M: 30-99 and removed size/S size/S 10-29 labels Dec 11, 2023
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.3% 0.3% Duplication

Copy link

codecov bot commented Dec 11, 2023

Codecov Report

Attention: 10 lines in your changes are missing coverage. Please review.

Comparison is base (0558530) 52.20% compared to head (acaa5fd) 52.19%.
Report is 1 commits behind head on master.

Files Patch % Lines
...loymentrender/v1alpha1/deploymentrender_default.go 61.90% 4 Missing and 4 partials ⚠️
...daemon/workloadcontroller/deployment_controller.go 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1851      +/-   ##
==========================================
- Coverage   52.20%   52.19%   -0.02%     
==========================================
  Files         172      172              
  Lines       20828    20839      +11     
==========================================
+ Hits        10874    10877       +3     
- Misses       8993     8998       +5     
- Partials      961      964       +3     
Flag Coverage Δ
unittests 52.19% <58.33%> (-0.02%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rambohe-ch
Copy link
Member

/lgtm

@rambohe-ch
Copy link
Member

/approve

@rambohe-ch rambohe-ch merged commit 77a66ba into openyurtio:master Dec 12, 2023
14 of 15 checks passed
@luc99hen luc99hen deleted the fix-yad branch December 13, 2023 03:54
zyjhtangtang pushed a commit to zyjhtangtang/openyurt that referenced this pull request Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug kind/bug lgtm lgtm size/M size/M: 30-99
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants