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

Ship unfork #735

Merged
merged 1 commit into from
Dec 1, 2018
Merged

Ship unfork #735

merged 1 commit into from
Dec 1, 2018

Conversation

marccampbell
Copy link
Member

What I Did

Add a new "unfork" command to Ship. This takes two parameters: a URL to a forked/copied Helm chart, and a URL to an upstream Helm chart. Ship will run (in headless mode) to create Kustomize patches from the fork, so that the upstream helm chart can be used directly again. The values.yaml from the fork will be used when running Helm template against both charts.

How I Did it

Modified Ship to support a new, default Unfork lifecycle. The "ship unfork" command always invokes this. This only works with 2 a forked Helm chart today. Used the existing CreateTwoWayStrategicMergePatch functionality.

How to verify it

Run the integration tests. Or:

ship unfork --upstream https://github.com/helm/charts/tree/353ba5ef6467fd64035b7d5446df426f86d60153/stable/grafana https://github.com/replicatedhq/test-charts/tree/2687f40789200c03c80df4831a56e9af77b2e701/grafana-forked

Description for the Changelog

Add ship unfork command to create patches from an existing fork.

Picture of a Boat (not required but encouraged)

clipart20572

@marccampbell marccampbell requested a review from Rob0h November 30, 2018 23:36
@@ -121,3 +136,64 @@ func CompareDir(expected, actual string, replacements map[string]string) (bool,

return true, nil
}

func prettyAndCleanJSON(data []byte, keysToIgnore []string) []byte {
Copy link
Contributor

Choose a reason for hiding this comment

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

do we still want this and modifyField ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed modifyField. Left this pulled out of the CompareDir for now, it was repeated, so /shrug. It's probably better to be out?

Logger: logger,
FS: fs,
State: state,
Patcher: patch.ShipPatcher{
Copy link
Contributor

Choose a reason for hiding this comment

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

this can also be DI'd v.s. creating another instance

@marccampbell marccampbell merged commit f9f4f8d into replicatedhq:master Dec 1, 2018
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