Fixing all files to conform with goimports.
This commit is contained in:
parent
99af97736c
commit
cea39ddd88
4 changed files with 17 additions and 20 deletions
|
@ -42,4 +42,3 @@ In MacOS this directory is $(brew --prefix)/etc/bash_completion.d if auto comple
|
||||||
rootCmd.GenBashCompletionFile(filename)
|
rootCmd.GenBashCompletionFile(filename)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,34 +15,33 @@
|
||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/aurora-scheduler/gorealis/v2/gen-go/apache/aurora"
|
"github.com/aurora-scheduler/gorealis/v2/gen-go/apache/aurora"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
rootCmd.AddCommand(restartCmd)
|
rootCmd.AddCommand(restartCmd)
|
||||||
|
|
||||||
|
restartCmd.AddCommand(restartJobCmd)
|
||||||
restartCmd.AddCommand(restartJobCmd)
|
restartJobCmd.Flags().StringVarP(env, "environment", "e", "", "Aurora Environment")
|
||||||
restartJobCmd.Flags().StringVarP(env, "environment", "e", "", "Aurora Environment")
|
restartJobCmd.Flags().StringVarP(role, "role", "r", "", "Aurora Role")
|
||||||
restartJobCmd.Flags().StringVarP(role, "role", "r", "", "Aurora Role")
|
restartJobCmd.Flags().StringVarP(name, "name", "n", "", "Aurora Name")
|
||||||
restartJobCmd.Flags().StringVarP(name, "name", "n", "", "Aurora Name")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var restartCmd = &cobra.Command{
|
var restartCmd = &cobra.Command{
|
||||||
Use: "restart",
|
Use: "restart",
|
||||||
Short: "Restart an Aurora Job.",
|
Short: "Restart an Aurora Job.",
|
||||||
}
|
}
|
||||||
|
|
||||||
var restartJobCmd = &cobra.Command{
|
var restartJobCmd = &cobra.Command{
|
||||||
Use: "job",
|
Use: "job",
|
||||||
Short: "Restart a Job.",
|
Short: "Restart a Job.",
|
||||||
Run: restartJob,
|
Run: restartJob,
|
||||||
}
|
}
|
||||||
|
|
||||||
func restartJob(cmd *cobra.Command, args []string) {
|
func restartJob(cmd *cobra.Command, args []string) {
|
||||||
key := aurora.JobKey{Environment: *env, Role: *role, Name: *name}
|
key := aurora.JobKey{Environment: *env, Role: *role, Name: *name}
|
||||||
if err := client.RestartJob(key); err != nil {
|
if err := client.RestartJob(key); err != nil {
|
||||||
log.Fatal("unable to create Aurora job: ", err)
|
log.Fatal("unable to create Aurora job: ", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,7 @@ func init() {
|
||||||
rootCmd.PersistentFlags().StringVar(&configFile, "config", "/etc/aurora/australis.yml", "Config file to use.")
|
rootCmd.PersistentFlags().StringVar(&configFile, "config", "/etc/aurora/australis.yml", "Config file to use.")
|
||||||
rootCmd.PersistentFlags().BoolVar(&toJson, "toJSON", false, "Print output in JSON format.")
|
rootCmd.PersistentFlags().BoolVar(&toJson, "toJSON", false, "Print output in JSON format.")
|
||||||
rootCmd.PersistentFlags().StringVarP(&logLevel, "logLevel", "l", "info", "Set logging level ["+internal.GetLoggingLevels()+"].")
|
rootCmd.PersistentFlags().StringVarP(&logLevel, "logLevel", "l", "info", "Set logging level ["+internal.GetLoggingLevels()+"].")
|
||||||
rootCmd.PersistentFlags().DurationVarP(&timeout, "timeout", "t", 20 * time.Second, "Gorealis timeout.")
|
rootCmd.PersistentFlags().DurationVarP(&timeout, "timeout", "t", 20*time.Second, "Gorealis timeout.")
|
||||||
}
|
}
|
||||||
|
|
||||||
var rootCmd = &cobra.Command{
|
var rootCmd = &cobra.Command{
|
||||||
|
|
|
@ -35,4 +35,3 @@ func TestUnmarshalUpdate(t *testing.T) {
|
||||||
_, err := UnmarshalUpdate("../test/update_hello_world.yaml")
|
_, err := UnmarshalUpdate("../test/update_hello_world.yaml")
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue