Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

support for passing readme in values yaml #880

Merged
merged 2 commits into from
Mar 25, 2019

Conversation

dexhorthy
Copy link
Member

What I Did

Allow app maintainers to override the readme shown in a helmValues step.

lifeycle:
  v1:
    - render: {}
    - helmValues:
        path: installer/chart/valyes.yaml
        readme:
          contents: |
            ## Configuration guide for Some-Chart

            ...

Right now the UI reads this from the /metadata endpoint, but now a mantainer can override this.

How I Did it

  • add readme.contents as an optional field to lifecycle.v1.helmValues
  • if readme is non null on the step, set the values of daemontypes.HelmValues.Readme when returning it down to the frontend.
  • Frontend checks for a readme field on the step, otherwise uses a readme from the chart meta if present.

How to verify it

Use a lifecycle like the following, and navigate to helm values step:

lifeycle:
  v1:
    - render: {}
    - helmValues:
        path: installer/chart/valyes.yaml
        readme:
          contents: |
            ## Configuration guide for Some-Chart

            ...

Description for the Changelog

Allow app maintainers to override the readme shown in a helmValues step.

🚢

@@ -18,6 +18,9 @@ lifecycle:
strip_path: true
- helmValues:
path: installer/consul/values.yaml
readme:
contents: |
# Fake readme :)
Copy link
Member Author

Choose a reason for hiding this comment

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

modified these tests so we have integration coverage on that field being supported in the YAML unmarshal.

// if there's a readme, default to readme tab. Else default to linter results.
const showHelp = !this.props.readme;
const showPreview = !showHelp;
this.state = { showHelp, showPreview };
Copy link
Member Author

Choose a reason for hiding this comment

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

This was not directly related but I don't think it makes sense to default to the readme tab if its empty (which happens in non init-chart workflows).

@dexhorthy dexhorthy merged commit fdd3be3 into replicatedhq:master Mar 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants