Skip to content

Commit

Permalink
Merge pull request #591 from hashicorp/cgo
Browse files Browse the repository at this point in the history
Using cgo dependencies to look up users
  • Loading branch information
diptanu committed Dec 15, 2015
2 parents d8b39f1 + 06443a6 commit badcdd2
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 39 deletions.
3 changes: 1 addition & 2 deletions client/allocdir/alloc_dir_posix.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package allocdir

import (
"fmt"
"github.com/hashicorp/nomad/helper/user-lookup"
"os"
"os/user"
"strconv"
Expand All @@ -27,7 +26,7 @@ func (d *AllocDir) dropDirPermissions(path string) error {
return nil
}

u, err := userlookup.Lookup("nobody")
u, err := user.Lookup("nobody")
if err != nil {
return err
}
Expand Down
3 changes: 1 addition & 2 deletions client/driver/executor/exec_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"github.com/hashicorp/nomad/client/driver/spawn"
cstructs "github.com/hashicorp/nomad/client/driver/structs"
"github.com/hashicorp/nomad/helper/args"
"github.com/hashicorp/nomad/helper/user-lookup"
"github.com/hashicorp/nomad/nomad/structs"
)

Expand Down Expand Up @@ -124,7 +123,7 @@ func (e *LinuxExecutor) ID() (string, error) {
// runAs takes a user id as a string and looks up the user, and sets the command
// to execute as that user.
func (e *LinuxExecutor) runAs(userid string) error {
u, err := userlookup.Lookup(userid)
u, err := user.Lookup(userid)
if err != nil {
return fmt.Errorf("Failed to identify user %v: %v", userid, err)
}
Expand Down
35 changes: 0 additions & 35 deletions helper/user-lookup/user-lookup.go

This file was deleted.

1 change: 1 addition & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ gox \
-arch="${XC_ARCH}" \
-osarch="!linux/arm !darwin/386" \
-ldflags "-X main.GitCommit ${GIT_COMMIT}${GIT_DIRTY}" \
-cgo \
-output "pkg/{{.OS}}_{{.Arch}}/nomad" \
.

Expand Down

0 comments on commit badcdd2

Please sign in to comment.