Skip to content

Commit

Permalink
fixed path errors on windows, replaced filepath w/ path
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron-prindle committed Sep 13, 2017
1 parent e6da47f commit d613618
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/provision/buildroot.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func setRemoteAuthOptions(p provision.Provisioner) auth.Options {
dockerDir := p.GetDockerOptionsDir()
authOptions := p.GetAuthOptions()

// due to windows clients, we cannot use filepath.Join as the paths
// due to windows clients, we cannot use path.Join as the paths
// will be mucked on the linux hosts
authOptions.CaCertRemotePath = path.Join(dockerDir, "ca.pem")
authOptions.ServerCertRemotePath = path.Join(dockerDir, "server.pem")
Expand All @@ -193,13 +193,13 @@ func configureAuth(p *BuildrootProvisioner) error {

execRunner := &bootstrapper.ExecRunner{}
hostCerts := map[string]string{
authOptions.CaCertPath: filepath.Join(authOptions.StorePath, "ca.pem"),
authOptions.ClientCertPath: filepath.Join(authOptions.StorePath, "cert.pem"),
authOptions.ClientKeyPath: filepath.Join(authOptions.StorePath, "key.pem"),
authOptions.CaCertPath: path.Join(authOptions.StorePath, "ca.pem"),
authOptions.ClientCertPath: path.Join(authOptions.StorePath, "cert.pem"),
authOptions.ClientKeyPath: path.Join(authOptions.StorePath, "key.pem"),
}

for src, dst := range hostCerts {
f, err := assets.NewFileAsset(src, filepath.Dir(dst), filepath.Base(dst), "0777")
f, err := assets.NewFileAsset(src, path.Dir(dst), filepath.Base(dst), "0777")
if err != nil {
return errors.Wrapf(err, "open cert file: %s", src)
}
Expand Down Expand Up @@ -244,7 +244,7 @@ func configureAuth(p *BuildrootProvisioner) error {
}
sshRunner := bootstrapper.NewSSHRunner(sshClient)
for src, dst := range remoteCerts {
f, err := assets.NewFileAsset(src, filepath.Dir(dst), filepath.Base(dst), "0640")
f, err := assets.NewFileAsset(src, path.Dir(dst), filepath.Base(dst), "0640")
if err != nil {
return errors.Wrapf(err, "error copying %s to %s", src, dst)
}
Expand Down

0 comments on commit d613618

Please sign in to comment.