forked from Azure/acs-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli.go
22 lines (19 loc) · 783 Bytes
/
cli.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package engine
import (
"log"
"os/exec"
"github.com/Azure/acs-engine/test/e2e/kubernetes/util"
)
// Generate will run acs-engine generate on a given cluster definition
func (e *Engine) Generate() error {
cmd := exec.Command("./bin/acs-engine", "generate", e.Config.ClusterDefinitionTemplate, "--output-directory", e.Config.GeneratedDefinitionPath)
util.PrintCommand(cmd)
out, err := cmd.CombinedOutput()
if err != nil {
log.Printf("Error while trying to generate acs-engine template with cluster definition - %s: %s\n", e.Config.ClusterDefinitionTemplate, err)
log.Printf("Command:./bin/acs-engine generate %s --output-directory %s\n", e.Config.ClusterDefinitionTemplate, e.Config.GeneratedDefinitionPath)
log.Printf("Output:%s\n", out)
return err
}
return nil
}