-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[##182651749](https://www.pivotaltracker.com/story/show/182651749)
- Loading branch information
1 parent
101d24f
commit 55e41e4
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package local | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
) | ||
|
||
func Service(name, cachePath string) { | ||
instance, err := store().GetServiceInstanceDetails(nameToID(name)) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
pakDir, cleanup := pack(cachePath) | ||
defer cleanup() | ||
|
||
broker := startBroker(pakDir) | ||
defer broker.Stop() | ||
|
||
lastOperationFinalValue, _ := broker.LastOperationFinalValue(instance.GUID) | ||
|
||
tp := newTablePrinter("") | ||
serviceName, planName := lookupServiceNamesByID(broker.Client, instance.ServiceGUID, instance.PlanGUID) | ||
tp.row("name:", name) | ||
tp.row("guid:", instance.GUID) | ||
tp.row("offering:", serviceName) | ||
|
||
tp.row("plan:", planName) | ||
tp.row("") | ||
tp.row("Showing status of last operation:") | ||
tp.row("status:", string(lastOperationFinalValue.State)) | ||
tp.row("message:", lastOperationFinalValue.Description) | ||
|
||
tp.row("") | ||
tp.row("Showing bindings: not implemented") | ||
|
||
deployment, _ := store().GetTerraformDeployment(fmt.Sprintf("tf:%s:", instance.GUID)) | ||
tfVersion, _ := deployment.TFWorkspace().StateTFVersion() | ||
|
||
tp.row("") | ||
tp.row("Showing upgrade status: Terraform version in state is ", tfVersion.String()) | ||
|
||
tp.print() | ||
} |