Skip to content

Commit e9ba86f

Browse files
author
Matthew Fisher
committed
ref(client): move control plane stuff to backend
In preparation for writing tests for `deisctl`, I have abstracted the concept of the `deisctl` client and the underlying backend clients which deisctl talks to. In our case, we only have one, which is the fleet backend. However, in order to properly test `deisctl`, we need to create a new backend which we can use locally. This is a first pass at refactoring the client in order to better flesh out these requirements. Note that `deisctl config` and `deisctl update` call docopt again, therefore eliminating the need for additional parameters. This is bad, as we cannot tell `deisctl config` to use the client's corresponding backend. This will be addressed in another PR. I've also removed the commands `list-units` and `list-unit-files` as they were redundantly calling `list-units`, were undocumented, and were not used.
1 parent 21a5b97 commit e9ba86f

26 files changed

Lines changed: 213 additions & 121 deletions

client/api.go renamed to backend/backend.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
package client
1+
package backend
22

3-
// Client interface used to interact with the cluster control plane
4-
type Client interface {
3+
// Backend interface is used to interact with the cluster control plane
4+
type Backend interface {
55
Create([]string) error
66
Destroy([]string) error
77
Start([]string) error
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package client
1+
package fleet
22

33
import (
44
"fmt"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package client
1+
package fleet
22

33
import (
44
"fmt"

client/fleet.go renamed to backend/fleet/fleet.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package client
1+
package fleet
22

33
import "github.com/coreos/fleet/client"
44

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package client
1+
package fleet
22

33
import "testing"
44

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package client
1+
package fleet
22

33
import (
44
"fmt"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package client
1+
package fleet
22

33
import (
44
"fmt"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package client
1+
package fleet
22

33
import (
44
"fmt"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package client
1+
package fleet
22

33
import (
44
"fmt"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package client
1+
package fleet
22

33
import (
44
"strings"

0 commit comments

Comments
 (0)