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

Build macos oc binary with CGO_ENABLED=1 so that it honours /etc/resolver? #23266

Closed
praveenkumar opened this issue Jun 25, 2019 · 21 comments
Closed
Labels
lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.

Comments

@praveenkumar
Copy link
Contributor

Version
$ oc version
oc v4.0.0-0.171.0
kubernetes v1.12.4+a532756e37
Steps To Reproduce
  1. Create a cluster locally which doesn't have public dns lookup (you can use crc for it).
  2. Don't append the dns details to /etc/resolve.conf but use /etc/resolver/<whatever_dns> , in our case we use /etc/resolver/testing.
  3. Try to open the web console on the browser which works and it honour the resolver file.
  4. Try to use oc cli to login to cluster, it doesn't work until you add that dns to /etc/resolv.conf
Current Result

User need to add the dns details to /etc/resolv.conf, where most of the app on the Mac does honour the resolver file and works.

Expected Result

Openshift client binary should also honour the resolver directory files.

Additional Information

[try to run $ oc adm diagnostics (or oadm diagnostics) command if possible]
[if you are reporting issue related to builds, provide build logs with BUILD_LOGLEVEL=5]
[consider attaching output of the $ oc get all -o json -n <namespace> command to the issue]
[visit https://docs.openshift.org/latest/welcome/index.html]

praveenkumar added a commit to crc-org/crc that referenced this issue Jun 25, 2019
This will allow us to add instance IP on fly so user doesn't
need to do it manually.

As preflight check we are also changing the permission for
host /etc/resolv.conf file to provide RW access to current user.

Upstream side issue to make sure oc should honour the resolver file.
- openshift/origin#23266
@praveenkumar
Copy link
Contributor Author

golang/go#12524

@gbraad
Copy link
Contributor

gbraad commented Jul 4, 2019

especially: golang/go#12524 (comment) Enabling CGO would seem to allow DNS lookups to happen using /etc/resolver.

@cfergeau
Copy link

cfergeau commented Jul 5, 2019

After building oc with CGO_ENABLED=1, I can confirm it will use /etc/resolver/ content for DNS resolution

$ cat /etc/resolv.conf
search cdg.redhat.com redhat.com win.redhat.com
nameserver 10.x...
nameserver 10.y...

$ cat /etc/resolver/testing 
port 53
nameserver 192.168.64.8

$ oc config view
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: DATA+OMITTED
    server: https://api.crc.testing:6443
  name: crc

$ ~/go/bin/oc get nodes
NAME                 STATUS   ROLES           AGE   VERSION
crc-fsjcf-master-0   Ready    master,worker   11d   v1.13.4+9252851b0

The binary from https://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/macosx/oc.tar.gz fails to resolve the DNS name:

$ oc get nodes
Unable to connect to the server: dial tcp: lookup api.crc.testing on 10.38.5.26:53: no such host

@praveenkumar praveenkumar changed the title Openshift client binary oc doesn't honour /etc/resolver for mac. Build macos oc binary with CGO_ENABLED=1 so that it honours /etc/resolver? Jul 5, 2019
@praveenkumar
Copy link
Contributor Author

kubernetes/kubernetes#23130 upstream issue from kubernetes side.

@jankleinert
Copy link

This seems to impact odo as well - does that need to be raised as a separate issue in their tracker?

@sspeiche
Copy link
Contributor

Note this affects openshift-installer and other binaries

@gbraad
Copy link
Contributor

gbraad commented Oct 10, 2019

@derekwaynecarr how to handle this? So far we haven't gotten anywhere with this and it affects us on macOS, and we find out the workaround with /etc/hosts we have is a rat's nest, as it is not guaranteed to work due to permissions being modified outside of our control.

@sspeiche
Copy link
Contributor

Does kubectl have this same problem too?

@cfergeau
Copy link

I just tried it, and yes it behaves the same, it needs an entry in /etc/hosts and is not making use of /etc/resolver/

@sspeiche
Copy link
Contributor

@cfergeau Should this be raised upstream? Seems like odo should follow what kubectl does.

Curious what @soltysh thinks

@gbraad
Copy link
Contributor

gbraad commented Oct 11, 2019

There is no impact to the software delivered, but rather inthe build process as Apple-branded hardware needs to be involved, although this can be solved by using CircleCI.

@soltysh
Copy link
Member

soltysh commented Oct 14, 2019

Curious what @soltysh thinks

If we want that fixed, this has to be fixed upstream first, imo.

@openshift-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci-robot openshift-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 12, 2020
@cfergeau
Copy link

/remove-lifecycle stale

@openshift-ci-robot openshift-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 13, 2020
@openshift-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci-robot openshift-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 12, 2020
@cfergeau
Copy link

/remove-lifecycle stale

@openshift-ci-robot openshift-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 14, 2020
@openshift-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci-robot openshift-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 13, 2020
@cfergeau
Copy link

cfergeau commented Aug 4, 2020

/lifecycle frozen

@openshift-ci-robot openshift-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 4, 2020
@openshift-ci-robot openshift-ci-robot added the lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. label Aug 4, 2020
@daliborfilus
Copy link

This issue is solved in openshift/oc#315

@praveenkumar
Copy link
Contributor Author

/close

Copy link
Contributor

openshift-ci bot commented May 1, 2024

@praveenkumar: Closing this issue.

In response to this:

/close

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.

@openshift-ci openshift-ci bot closed this as completed May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.
Projects
None yet
Development

No branches or pull requests

9 participants