Skip to content

Commit

Permalink
remove unused method
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Vlasic committed Oct 15, 2021
1 parent ca4a6df commit 9e54233
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 25 deletions.
6 changes: 3 additions & 3 deletions api/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ func (d *Deploy) applyInfrastructure() error {
return err
}
// collect terraform output
d.rsp.Rest, err = tf.GetOutput("url")
d.rsp.Rest, err = tf.Output("url")
if err != nil {
return err
}
d.rsp.Ws, err = tf.GetOutput("ws_url")
d.rsp.Ws, err = tf.Output("ws_url")
if err != nil {
return err
}
d.rsp.PublicBucket, err = tf.GetOutput("public_site_bucket")
d.rsp.PublicBucket, err = tf.Output("public_site_bucket")
if err != nil {
return err
}
Expand Down
23 changes: 1 addition & 22 deletions terraform/terraform.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,27 +86,6 @@ func (t *Terraform) Destroy() error {
return t.initPlanApply(true)
}

// Output reads terrraform output variable value
func (t *Terraform) Output(key string, raw bool) (string, error) {
if err := t.init(); err != nil {
return "", err
}
var args []string
if raw {
args = []string{"terraform", "output", "-raw", key}
} else {
args = []string{"terraform", "output", "-json", key}
}
val, err := shell.Output(t.shellExecOpts("", args))
if err != nil {
return "", err
}
if strings.Contains(val, "No outputs found") {
return "", fmt.Errorf("no outputs found")
}
return val, nil
}

// path to create/main.tf
func (t *Terraform) CreateTf() string {
return path.Join(t.createPath, mainTf)
Expand Down Expand Up @@ -295,7 +274,7 @@ func (t *Terraform) render(name string, pth string, data interface{}) ([]byte, e
return buf.Bytes(), nil
}

func (t *Terraform) GetOutput(key string) (string, error) {
func (t *Terraform) Output(key string) (string, error) {
val, ok := t.Outputs[key]
if !ok {
return "", fmt.Errorf("output variable %s not found", key)
Expand Down

0 comments on commit 9e54233

Please sign in to comment.