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

CRI: An empty DNSConfig != unspecified #7764

Merged
merged 1 commit into from
Feb 12, 2024

Conversation

roman-kiselenko
Copy link
Member

if DnsConfig empty, it should copy the host's resolv.conf

What type of PR is this?

/kind other

What this PR does / why we need it:

This PR coordinates the behavior with the containerd. containerd/containerd#9730

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

Reference kubernetes/kubernetes#120748

Does this PR introduce a user-facing change?

I guess some users will find this behavior a breaking change.

In case of an empty struct of DSNConfig /etc/resolv.conf be copied.

@openshift-ci openshift-ci bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/other Categorizes issue or PR as not clearly related to any existing kind/* category labels Feb 9, 2024
@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 9, 2024
Copy link
Contributor

openshift-ci bot commented Feb 9, 2024

Hi @roman-kiselenko. Thanks for your PR.

I'm waiting for a cri-o member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@roman-kiselenko
Copy link
Member Author

Copy link

codecov bot commented Feb 9, 2024

Codecov Report

Merging #7764 (abf3885) into main (59ea87d) will increase coverage by 0.00%.
Report is 6 commits behind head on main.
The diff coverage is 0.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7764   +/-   ##
=======================================
  Coverage   48.04%   48.05%           
=======================================
  Files         148      148           
  Lines       16339    16374   +35     
=======================================
+ Hits         7850     7868   +18     
- Misses       7533     7546   +13     
- Partials      956      960    +4     

@haircommander
Copy link
Member

/ok-to-test

this is interesting. It's listed explicitly in https://github.com/containerd/containerd/pull/9730/files#diff-960bde24e7e0ac9df6b2556d747f483f0f3e6938d092e2b69bdb6750b7374be9R282-R285 that copying the host resolvConf on nil is potentially not the correct way, but containerd needs to do it for backwards compatibility. It almost feels like we shouldn't introduce this behavior if we don't have that reason? the alternative would be treating a nil object like an empty one and creating an empty s.config.DnsServer if it isn't defined.

WDYT @cri-o/cri-o-maintainers

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 9, 2024
@roman-kiselenko
Copy link
Member Author

roman-kiselenko commented Feb 9, 2024

I also have doubts about this since copying the host resolve.conf potentially may lead to problems.

The alternative would be treating a nil object like an empty one and creating an empty s.config.DnsServer if it isn't defined.

Something like this 🤔 :

if s.config.DnsConfig == nil {
   s.config.DnsConfig = &types.DnsConfig{}
}

@haircommander
Copy link
Member

yeah exactly!

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 12, 2024
Copy link
Contributor

openshift-ci bot commented Feb 12, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: roman-kiselenko, saschagrunert

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

The pull request process is described 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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 12, 2024
@saschagrunert
Copy link
Member

/retest

@roman-kiselenko
Copy link
Member Author

roman-kiselenko commented Feb 12, 2024

Not sure why tests are failed, will take a look closer 👀
/retest

@sohankunkerkar
Copy link
Member

Something like this 🤔 :

if s.config.DnsConfig == nil {
s.config.DnsConfig = &types.DnsConfig{}
}

@roman-kiselenko are you planning to add this code?

@roman-kiselenko
Copy link
Member Author

Something like this 🤔 :

if s.config.DnsConfig == nil {
s.config.DnsConfig = &types.DnsConfig{}
}

@roman-kiselenko are you planning to add this code?

yep 👍

@sohankunkerkar
Copy link
Member

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 12, 2024
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Feb 12, 2024
if config.DnsConfig empty assign empty DNSConfig struct

Signed-off-by: roman-kiselenko <roman.kiselenko.dev@gmail.com>
@sohankunkerkar
Copy link
Member

/retest
/lgtm
/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 12, 2024
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 12, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 9493a08 into cri-o:main Feb 12, 2024
57 of 64 checks passed
@roman-kiselenko roman-kiselenko deleted the cri-empty-dnsconfig branch February 14, 2024 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/other Categorizes issue or PR as not clearly related to any existing kind/* category lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants