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

Feature/windows support #35

Closed
wants to merge 6 commits into from
Closed

Feature/windows support #35

wants to merge 6 commits into from

Conversation

rtluckie
Copy link

  • revert back to debian:9.5 image
  • add user friendly outputs to init command
  • add verbose flag
  • use docker mounts and volumes instead of binds
  • misc fixes for to support windows
  • refactor provision-user script
  • bump version number

Ryan Luckie added 2 commits August 22, 2018 18:52
- revert back to debian:9.5 image
- add user friendly outputs to init command
- add verbose flag
- use docker mounts and volumes instead of binds
- misc fixes for to support windows
- refactor provision-user script
- bump version number
README.md Outdated
@@ -123,18 +125,21 @@ cd ~/
OSX: mkdir ~/Dev; cd ~/Dev
Windows: <Ignore This>

# Start ssh-agent and load your key
Copy link
Contributor

@dcwangmit01 dcwangmit01 Aug 23, 2018

Choose a reason for hiding this comment

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

MUST:

So this clearly is not necessary for the KDK, but unfortunately most people in our company don't have the ssh skills to be able to access github and bitbucket via ssh within the KDK. For this they need ssh-agent, and they need it either spelled out or automated.

Can you figure out a way to either automate this or document it in an Appendix section?

Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps we can build it into the kdk

Copy link
Contributor

Choose a reason for hiding this comment

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

In a different PR.

@@ -42,6 +46,12 @@ func InitKdkConfig(logger logrus.Entry) error {

currentUser, _ := user.Current()

username := currentUser.Username

Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a comment. I assume that the username has \ in it because of Windows?

Copy link
Author

Choose a reason for hiding this comment

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

comment added


for _, bind := range viper.Get("docker.binds").([]interface{}) {
configBind := make(map[string]string)
for key, value := range bind.(map[interface{}]interface{}) {
configBind[key.(string)] = value.(string)
}
binds = append(binds, configBind["source"]+":"+configBind["target"])
mounts = append(mounts, mount.Mount{Type: mount.TypeBind, Source: configBind["source"], Target: configBind["target"]})
volumes[configBind["target"]] = struct{}{}
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 this sent in as empty?

Copy link
Author

Choose a reason for hiding this comment

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

Copy link

Choose a reason for hiding this comment

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

One of these is a type struct{} and one of these is an instantiation of an empty struct struct{}{}

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

🥇

if Verbose {
io.Copy(os.Stdout, out)
} else {
io.Copy(ioutil.Discard, out)
Copy link

Choose a reason for hiding this comment

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

I don't understand why you might do this. Maybe this is something I should know. My understanding is that you are discarding data from a connection that is going to be closed by the defer statement above anyway. Is this useful in some way?

Copy link

Choose a reason for hiding this comment

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

Copy link

Choose a reason for hiding this comment

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

Still interested:
google/go-github#317

Copy link
Contributor

Choose a reason for hiding this comment

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

@drekle Apparently, without the ioutil.Discard, the code would finish before the command causing the defer statement to trigger and kill the command early. We specifically debugged this mystery. If you're interested, comment out the io.Copy, and try running it. The pull will fail every time.

"github.com/docker/docker/client"
"github.com/docker/go-connections/nat"
"github.com/spf13/viper"
)

func Up(ctx context.Context, dockerClient *client.Client, imageCoordinates string, logger logrus.Entry) error {
var binds []string
var volumes map[string]struct{}
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Curious why it shouldn't be:

        volumes := map[string]volume.Volume{}

Instead of

	var volumes map[string]struct{}

@drekle

@dcwangmit01
Copy link
Contributor

Please Close this PR. It has been rebased in #37

@dcwangmit01
Copy link
Contributor

CLosing

@rtluckie rtluckie deleted the feature/windows_support branch August 24, 2018 19:36
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