Skip to content

Commit

Permalink
Show value instead of paths for sensitve outputs (#867)
Browse files Browse the repository at this point in the history
* show actual output instead of path, edit outputs.go,show_test.go

* make edits in docs

* remove commented code

* replace path in readme with a placeholder
  • Loading branch information
scriptonist authored and carolynvs-msft committed Jan 28, 2020
1 parent ad06cce commit 5e3e015
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docs/content/slides/pack-your-bags-msp/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ $ porter bundle show

Outputs:
-------------------------------------------------------------------------------------------
Name Type Value (Path if sensitive)
Name Type Value
-------------------------------------------------------------------------------------------
STORAGE_ACCOUNT_KEY string JKb9C+J+nFtGrDyBW4Y0zaIK5hzIvi2gW3SfnmnkcunyXSYV3HucQGNIo...
```
Expand Down
4 changes: 0 additions & 4 deletions pkg/porter/outputs.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,6 @@ func (p *Porter) ListBundleOutputs(c claim.Claim, format printer.Format) []Displ
}
do.Definition = *def

if def.WriteOnly != nil && *def.WriteOnly {
valueStr = output.Path
}

outputType, _, err := def.GetType()
if err != nil {
// Do not have the entire listing fail because of one output type error
Expand Down
11 changes: 5 additions & 6 deletions pkg/porter/show_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,12 @@ Last Action: install
Last Status: success
Outputs:
------------------------------
Name Type Value
------------------------------
bar string bar-output
foo string /path/to/foo
----------------------------
Name Type Value
----------------------------
bar string bar-output
foo string foo-output
`

gotOutput := p.TestConfig.TestContext.GetOutput()
require.Equal(t, wantOutput, gotOutput)
}
12 changes: 6 additions & 6 deletions workshop/porter-tf-aci/azure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ Copy these values and move on to setting up your environment variables.

You'll need the following Service Principal information, along with an Azure Subscription ID:

* Client ID (also called AppId)
* Client Secret (also called Password)
* Tenant Id (also called Tenant)
- Client ID (also called AppId)
- Client Secret (also called Password)
- Tenant Id (also called Tenant)

These will need to be in a set of environment variables for use in generating a CNAB credential set. Set them like this:

Expand Down Expand Up @@ -120,10 +120,10 @@ Last Status: success
Outputs:
-----------------------------------------------
Name Type Value (Path if sensitive)
Name Type Value
-----------------------------------------------
IP_ADDRESS string 40.88.49.175
STORAGE_ACCOUNT_KEY string /cnab/app/outputs/STORAGE_ACCOUNT_KEY
STORAGE_ACCOUNT_KEY string <your storage account key>
```

Note that sensitive outputs (`STORAGE_ACCOUNT_KEY` in this example) are replaced by their runtime path
Expand All @@ -136,4 +136,4 @@ $ curl http://20.42.26.66:8080
Hello, I'm a webserver that connects to jrrserver981.mysql.database.azure.com
```

You'll want to replace that IP address with what is shown in the output.
You'll want to replace that IP address with what is shown in the output.

0 comments on commit 5e3e015

Please sign in to comment.