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

agnhost image: use actual DNS domain instead of hardcoded cluster.local #92964

Merged
merged 1 commit into from Sep 24, 2020

Conversation

vponomaryov
Copy link
Contributor

@vponomaryov vponomaryov commented Jul 10, 2020

'agnhost' image uses hardcoded 'cluster.local' value for DNS domain.
It leads to failure of a bunch of HPA tests when test cluster is
configured to use custom DNS domain and there is no alias for
default 'cluster.local' one.
So, fix it by reusing it's own function for reading DNS domain suffixes.

Bumps 'agnhost' image version to 2.24

Signed-off-by: Valerii Ponomarov kiparis.kh@gmail.com

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 api-change
/kind bug
/kind cleanup
/kind deprecation
/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake

What this PR does / why we need it:

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 10, 2020
@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


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. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 10, 2020
@k8s-ci-robot
Copy link
Contributor

Welcome @vponomaryov!

It looks like this is your first PR to kubernetes/kubernetes 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kubernetes has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @vponomaryov. Thanks for your PR.

I'm waiting for a kubernetes 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.

@k8s-ci-robot k8s-ci-robot added area/test sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jul 10, 2020
@vponomaryov
Copy link
Contributor Author

This PR fixes following issue: #88752

@vponomaryov
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jul 10, 2020
@k8s-ci-robot
Copy link
Contributor

@vponomaryov: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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.

@vponomaryov
Copy link
Contributor Author

Fixes #88752

@gjtempleton
Copy link
Member

/sig autoscaling

@k8s-ci-robot k8s-ci-robot added the sig/autoscaling Categorizes an issue or PR as relevant to SIG Autoscaling. label Jul 10, 2020
@vponomaryov
Copy link
Contributor Author

/assign @claudiubelu @luxas

@listx
Copy link

listx commented Jul 15, 2020

/ok-to-test

@k8s-ci-robot k8s-ci-robot 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 Jul 15, 2020
@claudiubelu
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 3, 2020
@jtslear
Copy link

jtslear commented Sep 4, 2020

/milestone v1.20

@k8s-ci-robot
Copy link
Contributor

@jtslear: You must be a member of the kubernetes/milestone-maintainers GitHub team to set the milestone. If you believe you should be able to issue the /milestone command, please contact your and have them propose you as an additional delegate for this responsibility.

In response to this:

/milestone v1.20

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.

@vponomaryov
Copy link
Contributor Author

/assign @fejta

@justaugustus
Copy link
Member

/milestone v1.20

@k8s-ci-robot k8s-ci-robot added this to the v1.20 milestone Sep 8, 2020
@vponomaryov
Copy link
Contributor Author

@justaugustus thanks for adding milestone label!
@claudiubelu , as I understood, this PR requires your "/approve" first, as owner at [1], and only then "/approve" from someone at [2].

[1] https://github.com/kubernetes/kubernetes/blob/master/test/images/agnhost/OWNERS
[2] https://github.com/kubernetes/kubernetes/blob/master/build/OWNERS

@claudiubelu
Copy link
Contributor

Indeed, I didn't approve it since it also has changes outside of the agnhost image, so my approval wouldn't make this go in anyways.

/approve

@liggitt
Copy link
Member

liggitt commented Sep 9, 2020

cc @kubernetes/sig-network-pr-reviews

@k8s-ci-robot k8s-ci-robot added the sig/network Categorizes an issue or PR as relevant to SIG Network. label Sep 9, 2020
@liggitt
Copy link
Member

liggitt commented Sep 9, 2020

/assign @thockin

would like your $0.02 on the DNS changes here, especially w.r.t. #92964 (comment) and scraping/parsing search paths out of the resolv.conf file like this

Copy link
Member

@thockin thockin left a comment

Choose a reason for hiding this comment

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

LGTM, I just want this self-documenting

func getDNSSuffixList() []string {

// GetDNSSuffixList reads DNS config file and returns the list of configured DNS suffixes
func GetDNSSuffixList() []string {
Copy link
Member

Choose a reason for hiding this comment

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

FWIW using strings.Fields() would be safer WRT repeated whitespace

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The only thing that is changed here is that function becomes exported having uppercase first letter. So, I do not understand the point of the comment.

Copy link
Member

Choose a reason for hiding this comment

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

exporting it and starting to use it as a utility method for other packages expands the scope of the code and increases the importance that it be robust/correct

Copy link
Member

Choose a reason for hiding this comment

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

Strictly speaking this function gets a list of "search paths" and if I were to find "" in that list (which you would if there was a double-space) I would be very surprised.

Is there a test-case for this function? I'm not going to demand you go write one, unless you want to, but it probably should have a test including values with duplicate whitespace

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@liggitt , @thockin I agree that it would be good to fix this thing, but I disagree that it must be part of this particular change that has one concrete goal - fixing concrete bug. And the change you propose me doing is not related to the bugfix at all.

Then, about unit tests, the fact that I changed the name of the function and unit tests passed means that there are either no tests or they were not run. In anyway, it doesn't get tested on regular basis. So, it has much more TODOs which must be done, but definitely not as part of this change, IMHO.

)

func getDNSDomain() string {
Copy link
Member

Choose a reason for hiding this comment

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

Can we please get a comment explaining how this is operating and why? It's PROBABLY safe, all things considered, but it's a heuristic.

This has come up in other places, and we really ought to expose it through downward API or something like that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe it is good to have comments, but even this module has more complex functions without comments.
According to the activity on the bug-report which gets fixed here, no one really cared about it. So, I wonder exactly where it has come up?

Copy link
Member

Choose a reason for hiding this comment

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

Past mistakes do not mean we shouldn't do better. The function is sufficiently subtle that having an explanation of what it is supposed to be doing and why is justified. I'm not asking for a book, just a couple sentences. Less than this comment, probably.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added comment in the code here and in the place of it's call.

@@ -214,7 +240,7 @@ func (c *controller) sendConsumeCustomMetric(w http.ResponseWriter, metric strin
}

func createConsumerURL(suffix string) string {
return fmt.Sprintf("http://%s.%s.svc.cluster.local:%d%s", consumerServiceName, consumerServiceNamespace, consumerPort, suffix)
Copy link
Member

Choose a reason for hiding this comment

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

WRT Windows, this is one of a long list of things that don't work right in Windows which were deemed "acceptable because no Windows user would expect them to work", even if a Kube user would. Sigh.

@@ -51,7 +51,7 @@ import (
func main() {
rootCmd := &cobra.Command{
Use: "app",
Version: "2.22",
Version: "2.23",
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need to update the version in 3 places? Can't we inject it at build time via linker?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree that it is not ok to have such kind of duplication, but I do not implement it here. I just do minimal changes needed to fix the issue.

Copy link
Member

Choose a reason for hiding this comment

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

sure, that's fine - I don't know who owns this sub-component now, so I guess I hope they see this and agree.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 10, 2020
@johngmyers
Copy link
Member

I've always wondered why the cluster domain isn't available through the downward API.

@vponomaryov
Copy link
Contributor Author

vponomaryov commented Sep 10, 2020

/unassign @mkumatag
/unassign @listx
/unassign @luxas

@vponomaryov
Copy link
Contributor Author

vponomaryov commented Sep 22, 2020

@thockin are the added description comments look good for you?
@claudiubelu can you please revisit this PR?

Copy link
Contributor

@fejta fejta left a comment

Choose a reason for hiding this comment

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

/approve
the build changes

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: claudiubelu, fejta, vponomaryov

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 22, 2020
'agnhost' image uses hardcoded 'cluster.local' value for DNS domain.
It leads to failure of a bunch of HPA tests when test cluster is
configured to use custom DNS domain and there is no alias for
default 'cluster.local' one.
So, fix it by reusing it's own function for reading DNS domain suffixes.

Signed-off-by: Valerii Ponomarov <kiparis.kh@gmail.com>
@claudiubelu
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 24, 2020
@k8s-ci-robot k8s-ci-robot merged commit b58777e into kubernetes:master Sep 24, 2020
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. area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. sig/autoscaling Categorizes an issue or PR as relevant to SIG Autoscaling. sig/network Categorizes an issue or PR as relevant to SIG Network. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet