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

Only build rkt driver on linux #3295

Merged
merged 1 commit into from
Sep 27, 2017
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
4 changes: 3 additions & 1 deletion client/driver/rkt.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//+build linux

package driver

import (
Expand Down Expand Up @@ -225,7 +227,7 @@ func rktManifestMakePortMap(manifest *appcschema.PodManifest, configPortMap map[
return portMap, nil
}

// NewRktDriver is used to create a new exec driver
// NewRktDriver is used to create a new rkt driver
func NewRktDriver(ctx *DriverContext) Driver {
return &RktDriver{DriverContext: *ctx}
}
Expand Down
55 changes: 55 additions & 0 deletions client/driver/rkt_nonlinux.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
//+build !linux

package driver

import (
"time"

"github.com/hashicorp/nomad/client/config"
cstructs "github.com/hashicorp/nomad/client/structs"
"github.com/hashicorp/nomad/nomad/structs"
)

// NewRktDriver returns an unimplemented driver that returns false during
// fingerprinting.
func NewRktDriver(*DriverContext) Driver {
return RktDriver{}
}

type RktDriver struct{}

func (RktDriver) Prestart(*ExecContext, *structs.Task) (*PrestartResponse, error) {
panic("not implemented")
}

func (RktDriver) Start(ctx *ExecContext, task *structs.Task) (*StartResponse, error) {
panic("not implemented")
}

func (RktDriver) Open(ctx *ExecContext, handleID string) (DriverHandle, error) {
panic("not implemented")
}

func (RktDriver) Cleanup(*ExecContext, *CreatedResources) error {
panic("not implemented")
}

func (RktDriver) Validate(map[string]interface{}) error {
panic("not implemented")
}

func (RktDriver) Abilities() DriverAbilities {
panic("not implemented")
}

func (RktDriver) FSIsolation() cstructs.FSIsolation {
panic("not implemented")
}

func (RktDriver) Fingerprint(cfg *config.Config, node *structs.Node) (bool, error) {
return false, nil
}

func (RktDriver) Periodic() (bool, time.Duration) {
return false, 0
}