Skip to content
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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ require (
github.com/shirou/gopsutil v2.19.11+incompatible
github.com/stretchr/testify v1.5.1
github.com/termie/go-shutil v0.0.0-20140729215957-bcacb06fecae
github.com/threefoldtech/tfexplorer v0.2.6
github.com/threefoldtech/tfexplorer v0.2.7-0.20200429090008-f462f9a8d76c
github.com/threefoldtech/zbus v0.1.3
github.com/urfave/cli v1.22.3
github.com/vishvananda/netlink v1.0.0
Expand Down
5 changes: 2 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,8 @@ github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG
github.com/termie/go-shutil v0.0.0-20140729215957-bcacb06fecae h1:vgGSvdW5Lqg+I1aZOlG32uyE6xHpLdKhZzcTEktz5wM=
github.com/termie/go-shutil v0.0.0-20140729215957-bcacb06fecae/go.mod h1:quDq6Se6jlGwiIKia/itDZxqC5rj6/8OdFyMMAwTxCs=
github.com/threefoldtech/tfexplorer v0.2.5/go.mod h1:TugylEDgMNKk4ZIzee9PpVmIcLNLaRLdiXuhHTt/AR0=
github.com/threefoldtech/tfexplorer v0.2.6 h1:Jk8qA5dMVMX9YWZ8IC7zkXiOxClGy2M//OVPmwWe4Cc=
github.com/threefoldtech/tfexplorer v0.2.6/go.mod h1:ozAe2OYR4ALp2PtyKT1A6UiTI+0ZcFU2UfUaRd1P5eE=
github.com/threefoldtech/tfexplorer v0.2.7-0.20200429090008-f462f9a8d76c h1:5tx6tw6P2uzQCCAAsjubA7p4ozKJXV0TMedIPCbGDgk=
github.com/threefoldtech/tfexplorer v0.2.7-0.20200429090008-f462f9a8d76c/go.mod h1:ozAe2OYR4ALp2PtyKT1A6UiTI+0ZcFU2UfUaRd1P5eE=
github.com/threefoldtech/zbus v0.1.3 h1:18DnIzximRbATle5ZdZz0i84n/bCYB8k/gkhr2dXayc=
github.com/threefoldtech/zbus v0.1.3/go.mod h1:ZtiRpcqzEBJetVQDsEbw0p48h/AF3O1kf0tvd30I0BU=
github.com/threefoldtech/zos v0.2.4-rc2/go.mod h1:7A2oflcmSVsHFC4slOcydWgJyFBMFMH9wsaTRv+CnTA=
Expand Down Expand Up @@ -784,5 +784,4 @@ gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc h1:/hemPrYIhOhy8zYrNj+069zDB68us2sMGsfkFJO0iZs=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
2 changes: 2 additions & 0 deletions pkg/provision/primitives/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ func WorkloadToProvisionType(w workloads.ReservationWorkload) (*provision.Reserv
if err != nil {
return nil, err
}
case nil:
// no content, no conversion
default:
return nil, fmt.Errorf("unknown workload type (%s) (%T)", w.Type.String(), tmp)
}
Expand Down
5 changes: 5 additions & 0 deletions pkg/provision/reservation.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ import (
// ReservationType type
type ReservationType string

const (
//NOOPReservation type
NOOPReservation ReservationType = "noop"
)

// Reservation struct
type Reservation struct {
// ID of the reservation
Expand Down
7 changes: 7 additions & 0 deletions pkg/provision/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ func (s *pollSource) Reservations(ctx context.Context) <-chan *Reservation {
if current >= next {
next = current + 1
}

if r.Type == NOOPReservation {
// special type of reservation that does nothing
// we just ignore it here.
continue
}

ch <- r
}
}
Expand Down