Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display more installation information with show #1605

Merged
merged 3 commits into from
Jun 4, 2021

Conversation

carolynvs
Copy link
Member

@carolynvs carolynvs commented May 24, 2021

What does this change

Add the following fields to the porter show output:

  • Bundle Repository, e.g. getporter/porter-hello
  • Bundle Version
  • Parameters used last

All of this data comes from the last claim associated with the installation.

There was a CNAB Spec bug that tripped up my testing. Porter was not setting the bundle reference on the claim. It's not required by the spec, but since we have the data and now we want to show it, we should set it whenever it's available.

I have also consolidated the print logic for parameters and outputs so that they both truncate and mask sensitive values the same way. If someone wants the full unmasked values, right now they need to use --ouput json|yaml instead.

$ porter show mysql
Name: mysql
Bundle: getporter/mysql
Version: 0.1.3
Created: 7 minutes ago
Modified: 39 seconds ago

Parameters:
------------------------------------------
  Name           Type    Value
------------------------------------------
  mysql-name     string  porter-ci-mysql
  mysql-user     string  mysql-admin
  namespace      string
  database-name  string  mydb

Outputs:
---------------------------------------
  Name                 Type    Value
---------------------------------------
  mysql-password       string  ******
  mysql-root-password  string  ******

History:
-------------------------------------------------------------------------
  Run ID                      Action   Timestamp       Status  Has Logs
-------------------------------------------------------------------------
  01F6FZD5Z0NMSM4TZ9SGDF6Z6G  install  7 minutes ago   failed  true

What issue does it fix

Fixes #1585
Part of #1446 (just changes show, doesn't add the --version flag to the other command)

Notes for the reviewer

Checklist

  • Unit Tests
  • Documentation TODO
  • Schema (porter.yaml) N/A

@carolynvs carolynvs force-pushed the show-more-installation-info branch 7 times, most recently from a0e37b1 to eb3ff8f Compare May 28, 2021 15:31
@carolynvs
Copy link
Member Author

/azp run porter

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@carolynvs carolynvs marked this pull request as ready for review June 1, 2021 21:01
@carolynvs
Copy link
Member Author

@vdice Right now this shows the parameters on the last claim. Based on what we talked about today, when I implement the installation document, we would show the parameters associated with the installation when that's implemented. I think showing this data right now though is still useful?

Add the following fields to the porter show output:

* Bundle Repository, e.g. getporter/porter-hello
* Bundle Version
* Parameters used last

All of this data comes from the last claim associated with the
installation.

I have also consolidated the print logic for parameters and outputs so
that they both truncate and mask sensitive values the same way.
If someone wants the full unmasked values, right now they need to use
--ouput json|yaml instead. In some places we had not defined json/yaml
marshal tags so I added them.

$ porter show mysql
Name: mysql
Bundle: getporter/mysql
Version: 0.1.3
Created: 7 minutes ago
Modified: 39 seconds ago

Parameters:
--------------------------------------------
  Name           Type    Value
--------------------------------------------
  database-name  string  "mydb"
  mysql-name     string  "porter-ci-mysql"
  mysql-user     string  "mysql-admin"
  namespace      string  ""

Outputs:
---------------------------------------
  Name                 Type    Value
---------------------------------------
  mysql-password       string  ******
  mysql-root-password  string  ******

History:
-------------------------------------------------------------------------
  Run ID                      Action   Timestamp       Status  Has Logs
-------------------------------------------------------------------------
  01F6FZD5Z0NMSM4TZ9SGDF6Z6G  install  7 minutes ago   failed  true

Signed-off-by: Carolyn Van Slyck <[email protected]>
@carolynvs carolynvs force-pushed the show-more-installation-info branch from eb3ff8f to d0fc8e7 Compare June 2, 2021 16:35
@@ -49,15 +49,17 @@ ID** uniquely identifies a run, or execution of a bundle.
```console
$ porter show whalegap
Name: whalegap
Bundle:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the bundle name missing here? Or is this how it looks when we don't know it for some reason?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me change the output here to use a bundle that was installed using --reference. When that flag isn't used, i.e. we installed it from source, then we won't have this bundle value.

We could display (installed from source) instead of an empty string?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could display (installed from source) instead of an empty string?

Oh maybe so, that could be a good option. In any case, sounds like a candidate for a follow-up.

"hasLogs": "false"
},
{
"claimID": "3",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just found this curious: a jump from 1 to 3 for claimID... A quirk of the CreateClaim helper?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a quirk of how the test generates repeated id's for claims and results. I was lazy and the number didn't really matter, it just had to be consistent between tests. 😀

Copy link
Member

@vdice vdice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@carolynvs carolynvs merged commit 8f10568 into getporter:v1 Jun 4, 2021
@carolynvs carolynvs deleted the show-more-installation-info branch June 4, 2021 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants