implement read ifd from file

This commit is contained in:
William Banfield
2022-10-18 15:18:55 -04:00
parent 59b28e71a0
commit 5b98095ac3
2 changed files with 22 additions and 0 deletions
+10
View File
@@ -2,6 +2,7 @@ package main
import (
"context"
"errors"
"fmt"
"math/rand"
"os"
@@ -59,6 +60,15 @@ func NewCLI() *CLI {
if err != nil {
return err
}
case "digital-ocean":
p, err := cmd.Flags().GetString("infrastructure-data")
if err != nil {
return err
}
if p == "" {
return errors.New("'--infrastructure-data' must be set when using the 'digital-ocean' infrastructure-type")
}
ifd, err = e2e.InfrastructureDataFromFile(p)
// TODO(williambanfield): add a section that implements the 'digital-ocean' infrastructure-type
default:
return fmt.Errorf("unknown infrastructure type '%s'", t)