forked from liamjbennett/sous
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sous_query_gdm.go
40 lines (31 loc) · 1.03 KB
/
sous_query_gdm.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package cli
import (
"os"
"github.com/opentable/sous/graph"
"github.com/opentable/sous/lib"
"github.com/opentable/sous/util/cmdr"
)
// SousQueryGDM is the description of the `sous query gdm` command
type SousQueryGDM struct {
GDM graph.CurrentGDM
flags struct {
singularity string
registry string
}
}
func init() { QuerySubcommands["gdm"] = &SousQueryGDM{} }
const sousQueryGDMHelp = `The intended state of deployment for every project and every cluster known to Sous.
The results of 'sous query gdm' and 'sous query ads' will not be identical if
a problem is preventing sous from modifying the current state of Singularity.
`
// Help prints the help
func (*SousQueryGDM) Help() string { return sousQueryGDMHelp }
func (*SousQueryGDM) RegisterOn(psy Addable) {
psy.Add(graph.DryrunNeither)
}
// Execute defines the behavior of `sous query gdm`
func (sb *SousQueryGDM) Execute(args []string) cmdr.Result {
sous.Log.Vomit.Printf("%v", sb.GDM.Snapshot())
sous.DumpDeployments(os.Stdout, sb.GDM.Deployments)
return cmdr.Success()
}