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

make helmValues work in non init-chart workflows #858

Merged
merged 2 commits into from
Mar 12, 2019

Conversation

dexhorthy
Copy link
Member

@dexhorthy dexhorthy commented Mar 11, 2019

What I Did

I made HelmValues work in non init-chart workflows.

full POC (also in integration test):

---
assets:
  v1: []

config: {}

lifecycle:
  v1:
    - render:
        root: ./
        assets:
          v1:
            - github:
                dest: ./installer/consul
                repo: helm/charts
                path: stable/consul
                ref: master
                strip_path: true
    - helmValues:
        path: installer/consul/values.yaml
    - render:
        root: ./
        assets:
          v1:
            - helm:
                dest: ./installer/base
                local:
                  chart_root: ./installer/consul
                values_from:
                  # haaaack, helmValues still needs a configurable dest path for us to store the output
                  path: .ship/tmp
    - kustomize:
        base: installer/base
        dest: installer/consul-rendered.yaml

How I Did it

  • add path field to daemontypes.Step.HelmValues, copy it over from existing api.Step.HelmValues
  • read this HelmValues.Path field in GET /navcycle/step/helm-values and the POST /helm-values, falling back to the old way of .ship/tmp/values.yaml
  • When linting chart, use filepath.Dir(step.HelmValues.path) as the base directory for linting, defaulting to the old .ship/tmp/chart
  • tried to remove constants/global-state-in-the-filesystem where possible

How to verify it

Description for the Changelog

Make some changes around path handling that allow a lifecycle.v1.helmValues step to be used outside of the core ship init <chart> workflow.

What I Did
------------

I made HelmValues work in non init-chart workflows.

full POC (also in integration test):

```yaml
---
assets:
  v1: []

config: {}

lifecycle:
  v1:
    - render:
        root: ./
        assets:
          v1:
            - github:
                dest: ./installer/consul
                repo: helm/charts
                path: stable/consul
                ref: master
                strip_path: true
    - helmValues:
        path: installer/consul/values.yaml
    - render:
        root: ./
        assets:
          v1:
            - helm:
                dest: ./installer/base
                local:
                  chart_root: ./installer/consul
                values_from:
                  # haaaack, helmValues still needs a configurable dest path for us to store the output
                  path: .ship/tmp
    - kustomize:
        base: installer/base
        dest: installer/consul-rendered.yaml
```

How I Did it
------------

- add path field to `daemontypes.Step.HelmValues`, copy it over from existing `api.Step.HelmValues`
- read this `HelmValues.Path` field in `GET /navcycle/step/helm-values` and the `POST /helm-values`, falling back to the old way of `.ship/tmp/values.yaml`
- When linting chart, use `filepath.Dir(step.HelmValues.path)` as the base directory for linting, defaulting to the old `.ship/tmp/chart`
- tried to remove constants/global-state-in-the-filesystem where possible

How to verify it
------------

- `ship init` the ship.yml in [integration/base/shipapp-helm-values/input/.ship/ship.yaml](integration/base/shipapp-helm-values/input/.ship/ship.yaml)
- touched some newer unfork code that I'm not as familiar with--still need to test unfork

Description for the Changelog
------------

Make some changes around path handling that allow a `lifecycle.v1.helmValues` step to be used outside of the core `ship init <chart>` workflow.

![](https://image.shutterstock.com/image-photo/september-5-2015-balclutha-san-260nw-541540471.jpg)
@dexhorthy
Copy link
Member Author

I don't know what's going on with Circle but the test build finished here https://circleci.com/gh/dexhorthy/ship/2115?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link, for some reason it got a different name.

@dexhorthy dexhorthy merged commit 3ed9393 into replicatedhq:master Mar 12, 2019
@dexhorthy dexhorthy deleted the helm-values branch March 13, 2019 14:47
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