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

Using cgo dependencies to look up users #591

Merged
merged 1 commit into from
Dec 15, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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