X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/231a86fd3f7e30e9f66d71d92ad7c26578637e37..49a89ce984eb69ef4316882e91dec652dc353e39:/lib/cloud/cloudtest/cmd.go diff --git a/lib/cloud/cloudtest/cmd.go b/lib/cloud/cloudtest/cmd.go index 1f94ea6da2..4816f20ee7 100644 --- a/lib/cloud/cloudtest/cmd.go +++ b/lib/cloud/cloudtest/cmd.go @@ -11,13 +11,12 @@ import ( "fmt" "io" "os" - "os/user" - "git.curoverse.com/arvados.git/lib/cloud" - "git.curoverse.com/arvados.git/lib/config" - "git.curoverse.com/arvados.git/lib/dispatchcloud" - "git.curoverse.com/arvados.git/sdk/go/arvados" - "git.curoverse.com/arvados.git/sdk/go/ctxlog" + "git.arvados.org/arvados.git/lib/cloud" + "git.arvados.org/arvados.git/lib/config" + "git.arvados.org/arvados.git/lib/dispatchcloud" + "git.arvados.org/arvados.git/sdk/go/arvados" + "git.arvados.org/arvados.git/sdk/go/ctxlog" "golang.org/x/crypto/ssh" ) @@ -36,7 +35,7 @@ func (command) RunCommand(prog string, args []string, stdin io.Reader, stdout, s flags := flag.NewFlagSet("", flag.ContinueOnError) flags.SetOutput(stderr) configFile := flags.String("config", arvados.DefaultConfigFile, "Site configuration `file`") - instanceSetID := flags.String("instance-set-id", defaultInstanceSetID(), "InstanceSetID tag `value` to use on the test instance") + instanceSetID := flags.String("instance-set-id", "zzzzz-zzzzz-zzzzzzcloudtest", "InstanceSetID tag `value` to use on the test instance") imageID := flags.String("image-id", "", "Image ID to use when creating the test instance (if empty, use cluster config)") instanceType := flags.String("instance-type", "", "Instance type to create (if empty, use cheapest type in config)") destroyExisting := flags.Bool("destroy-existing", false, "Destroy any existing instances tagged with our InstanceSetID, instead of erroring out") @@ -64,7 +63,9 @@ func (command) RunCommand(prog string, args []string, stdin io.Reader, stdout, s logger.Info("exiting") }() - cfg, err := config.LoadFile(*configFile, logger) + loader := config.NewLoader(stdin, logger) + loader.Path = *configFile + cfg, err := loader.Load() if err != nil { return 1 } @@ -122,15 +123,6 @@ func (command) RunCommand(prog string, args []string, stdin io.Reader, stdout, s return 0 } -func defaultInstanceSetID() string { - username := "" - if u, err := user.Current(); err == nil { - username = u.Username - } - hostname, _ := os.Hostname() - return fmt.Sprintf("cloudtest-%s@%s", username, hostname) -} - // Return the named instance type, or the cheapest type if name=="". func chooseInstanceType(cluster *arvados.Cluster, name string) (arvados.InstanceType, error) { if len(cluster.InstanceTypes) == 0 {