-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
21 changed files
with
557 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package cli | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func init() { | ||
clusterCmd.AddCommand(clusterEnvCmd) | ||
} | ||
|
||
var clusterEnvCmd = &cobra.Command{ | ||
Use: "env", | ||
Short: "Show environment", | ||
Long: `Show cluster environment. | ||
Finds a cluster as per the root "cluster" command, and prints exclusively that | ||
cluster's environment, formats the environment with formatting as per the root | ||
"env" command.`, | ||
Args: cobra.NoArgs, | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
cluster, err := lookupCluster(cmd) | ||
if err != nil { | ||
return err | ||
} | ||
showEnvironment(cluster.Environment) | ||
return nil | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package cli | ||
|
||
import ( | ||
"github.com/deref/exo/internal/api" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func init() { | ||
clusterCmd.AddCommand(clusterRefreshCmd) | ||
} | ||
|
||
var clusterRefreshCmd = &cobra.Command{ | ||
Hidden: true, | ||
Use: "refresh", | ||
Short: "Refresh cluster model", | ||
Long: `Forces a refreshes of a cluster's model. | ||
Targets a cluster as per the root "cluster" command. | ||
It is not normally necessary to call this command, since cluster models are | ||
automatically refreshed at some periodic frequency.`, | ||
Args: cobra.NoArgs, | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
ctx := cmd.Context() | ||
cluster, err := lookupCluster(cmd) | ||
if err != nil { | ||
return err | ||
} | ||
var m struct { | ||
Cluster *clusterFragment `graphql:"refreshCluster(ref: $cluster)"` | ||
} | ||
if err := api.Mutate(ctx, svc, &m, map[string]interface{}{ | ||
"cluster": cluster.ID, | ||
}); err != nil { | ||
return err | ||
} | ||
showCluster(m.Cluster) | ||
return nil | ||
}, | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.