Skip to content

Commit

Permalink
Merge pull request #3295 from hashicorp/b-rkt-is-linux-only
Browse files Browse the repository at this point in the history
Only build rkt driver on linux
  • Loading branch information
schmichael authored Sep 27, 2017
2 parents 6d8bd9a + 08f8411 commit 4f23e9e
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 1 deletion.
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
}

0 comments on commit 4f23e9e

Please sign in to comment.