Skip to content

Linux DNS install#112

Merged
febbraro merged 7 commits intodevelopfrom
feature/linux-dns-install
Nov 2, 2017
Merged

Linux DNS install#112
febbraro merged 7 commits intodevelopfrom
feature/linux-dns-install

Conversation

@febbraro
Copy link
Member

No description provided.

@febbraro febbraro requested review from grayside and tekante October 31, 2017 22:41
}

// Is libnss-resolver in use
if _, err := os.Stat("/etc/resolver"); err == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

To be clear, we will set up *.vm support via both these mechanisms if both happen to be present? I believe we discussed that being safe and the approach, but wanted to confirm.

* Start Docker in Docker
* `docker run --privileged -it --name dind -d docker:dind`
* Start the container for the distro you want, mounting a linux targeted `rig` into it and linking it to the Docker in Docker image.
* `docker run -it -v $PWD/build/linux/rig:/usr/bin/rig --link dind:docker test-centos bash`
Copy link
Contributor

Choose a reason for hiding this comment

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

Does travis support dind?

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe it does

Copy link
Contributor

@grayside grayside left a comment

Choose a reason for hiding this comment

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

First pass with minor points. I think I'll need to review this again.

commands/dns.go Outdated

// ConfigureMac configures DNS resolution and network routing
func (cmd *DNS) configureMacRoutes(machine Machine) {
cmd.out.Verbose.Print("Configuring network routing for macOS")
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this log valuable, as it directly follows this info log

Setting up local networking (may require your admin password)

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe not I can remove those.

cmd.removeHostFilter(machineIP)
}
exec.Command("sudo", "route", "-n", "delete", "-net", "172.17.0.0").Run()
util.StreamCommand(exec.Command("sudo", "route", "-n", "add", "172.17.0.0/16", machineIP))
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is delete Run() and add StreamCommand()?

Copy link
Member Author

Choose a reason for hiding this comment

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

So, it has been Stream for a while, I think Stream was used to get the output to the console

"-l", "com.dnsdock.image=outrigger",
"--name", "dnsdock",
"-p", bridgeIP + ":53:53/udp",
"-p", fmt.Sprintf("%s:53:53/udp", bridgeIP),
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

resolverReturn = cmd.configureMacResolver(machine)
} else if util.IsLinux() {
resolverReturn = cmd.configureLinuxResolver()
} else if util.IsWindows() {
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems odd to have Linux in the middle, especially since it has a different signature.

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried to put them in order of use, meaning linux is 2nd most used.


bip := strings.Trim(string(output), "\n")
if bip == "" {
bip = "172.17.0.1"
Copy link
Contributor

Choose a reason for hiding this comment

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

How do we know this bip is a safe fallback?

Copy link
Member Author

Choose a reason for hiding this comment

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

172.17.0.1 is the default for Docker as configured by Docker. A user can change their default bridge IP.

Copy link
Member

@tekante tekante left a comment

Choose a reason for hiding this comment

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

I didn't run any tests to confirm everything is working but I didn't see anything in the code that raised red flags for me. Presuming it's safe to leave in the DNS config for Linux even after things are stopped similar to Mac. If not a need to do the appropriate cleanup was the only thing that came to mind.

@febbraro
Copy link
Member Author

febbraro commented Nov 2, 2017

Since all of these configs target the .vm Ltd directly, I don’t see any harm in leaving them. We could do a quick blanket remove with an uninstall command or as part of the remove command or flag on the dns command but not sure it is worth it. Maybe as a follow up at some point later?

@febbraro
Copy link
Member Author

febbraro commented Nov 2, 2017

Worth noting that currently we dont remove the mac settings either

@grayside
Copy link
Contributor

grayside commented Nov 2, 2017

I'm not worried about uninstallation of this. I'd rather direct the time to #5 so we can more effectively help people understand the changes we are making.

Copy link
Contributor

@grayside grayside left a comment

Choose a reason for hiding this comment

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

I have some trouble keeping routes & resolvers clear in my head as dictionary terms, and the read flow is a bit rough, but overall the granularity of functions looks right and it's an improvement.

@febbraro febbraro merged commit 65c1c70 into develop Nov 2, 2017
@febbraro febbraro deleted the feature/linux-dns-install branch November 2, 2017 21:22
grayside pushed a commit that referenced this pull request Nov 10, 2017
…ogging

* origin/develop:
  Fixed bug in libnss-resolver DNS resolution (#116)
  Added rpm to build, well, rpms
  Transitioned to different go base to try to head off problems with dynamically linked go binaries
  tweaking some build flags
  tweaking CGO
  messing with ldflags
  tweaked goreleaser config
  fixed BaseCommand initialization in delegated commands (#114)
  Addeed .DS_Store to .gitignore
  Linux DNS install (#112)
@grayside grayside added this to the v2.0 milestone Nov 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants