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

Porter explain to display custom section when output is JSON #2764

Closed
StrayDogge opened this issue May 17, 2023 · 0 comments · Fixed by #2767
Closed

Porter explain to display custom section when output is JSON #2764

StrayDogge opened this issue May 17, 2023 · 0 comments · Fixed by #2767
Labels
suggestion Idea for maintainers to consider. Do not take this issue until triaged.

Comments

@StrayDogge
Copy link

Automating porter installations would greatly benefit of having this feature. An automation system will have additional requirements that the custom section data in the Porter manifest can satisfy. However, at the moment it is very difficult to extract the information.

It is undestandable that the format porter explain command produces by default is not suited to manage arbitrary custom section data. However, when using --output json flag this is certainly possible since the data ends up in JSON format in the generated bundle.json file anyways.

So, given the following custom section in porter.yaml:

custom:
  dependencies:
    bundles:
      - name: "bundle-one"
        version: 0.1.0
      - name: "bundle-two"
        version: 0.2.0
        outputs:
          - "output1"
          - "output2"

Note: I am aware of the dependency management supported by Porter, but we may not always want the install action to invoke the dependency installation. Just consider any custom data - don't get hung up on the sample.

What I would hope to find in the output of porter explain --output json is:

{
  "dependencies": {
    "bundles": [
      {
        "name": "bundle-one",
        "version": "0.1.0"
      },
      {
        "name": "bundle-two",
        "outputs": [
          "output1",
          "output2"
        ],
        "version": "0.2.0"
      }
    ]
  }
}

I have managed to create a suboptimal workaround by creating a custom action that will format the custom section into JSON, but the action invocation requires an existing installation of the bundle, which is not acceptable in my case. Extracting the bundle.json file from image is another option, but again, having porter explain do the work would be best.

@StrayDogge StrayDogge added the suggestion Idea for maintainers to consider. Do not take this issue until triaged. label May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion Idea for maintainers to consider. Do not take this issue until triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant