2 files changed,
+6
−3
instances_cli.go
+3 −3
instances_restore_test.go
+3 −0
| index fcf48a568..510a2dbf1 100644 |
| --- a/instances_cli.go |
| +++ b/instances_cli.go |
| @@ -337,15 +337,15 @@ func runInstancesCreate(args []string) { |
| fs.Visit(func(f *flag.Flag) { set[f.Name] = true }) |
| addrs := parseAddrList(*addr, set["addr"]) |
| probe := parseProbeFlags(*healthPath, *healthStatus, set["health-path"], set["health-status"]) |
| + if *restore && (*from != "" || *kind != "" || set["addr"] || *role != "") { |
| + log.Fatalf("instances create: %s", "a restore is a plain instance. Drop --from, --kind, --addr and --role.") |
| + } |
| if set["at"] && (*at <= 0 || *from == "") { |
| log.Fatalf("instances create: %s", "at must be a transaction id, a whole number above 0") |
| } |
| if *from != "" && (*kind != "" || set["addr"] || *role != "" || *replicas != "") { |
| log.Fatalf("instances create: %s", "a seeded instance is an ordinary instance. Drop --kind, --addr and --role.") |
| } |
| - if *restore && (*from != "" || *kind != "" || set["addr"] || *role != "") { |
| - log.Fatalf("instances create: %s", "a restore is a plain instance. Drop --from, --kind, --addr and --role.") |
| - } |
| sess := requireAPISession("create", *consoleFlag) |
| printUsing(stdout, sess) |
| acct := resolvedAccount(sess, acctRaw, acctIDRaw) |
| index b812573e7..e43834def 100644 |
| --- a/instances_restore_test.go |
| +++ b/instances_restore_test.go |
| @@ -108,6 +108,9 @@ func TestInstancesCreateRestoreRefusesTheOtherShapes(t *testing.T) { |
| {"--kind", "service"}, |
| {"--addr", "10.0.0.1:8090"}, |
| {"--role", "replica"}, |
| + {"--from", "other.jam.bab.oncarlos.com", "--kind", "service"}, |
| + {"--from", "other.jam.bab.oncarlos.com", "--addr", "10.0.0.1:8090"}, |
| + {"--from", "other.jam.bab.oncarlos.com", "--role", "replica"}, |
| } { |
| c := &restoreConsole{answer: restoreAnswerOn} |
| ts := c.serve(t) |