Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Support import of repositories for Helm v2 _and_ v3 #141

Merged
merged 4 commits into from
Dec 11, 2019

Conversation

hiddeco
Copy link
Member

@hiddeco hiddeco commented Dec 10, 2019

This PR adds the missing bits in the helm/v2 package, removes the hardcoded import that was temporary put into place in #124, and replaces it with a dedicated --helm-repository-import flag which accepts a string slice of [helm version]:[path] pairs.

This commit is a follow up on #124 which added the same type of
functionalities to the `helm/v3` package. Given all methods are
now supported by both version implementations, the generic client
interface has been updated to include the methods.
This was causing issues for airgapped or restricted instances of the
operator as adding a repository causes Helm to attempt to connect with
it, which may not be possible due to the earlier mentioned restrictions.
@hiddeco hiddeco added the helm v3 Issue or PR related to Helm v3 label Dec 10, 2019
Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

LGTM

With this flag it is possible to import repositories from an index
file to a specific Helm client version.

Example:

`--helm-repository-import=v2:/var/v2.yaml,v3:/var/v3.yaml` causes
the operator to import the `v2.yaml` repositories in the Helm v2
client, and the `v3.yaml` repositories in the Helm v3 client.
@hiddeco hiddeco merged commit 9752271 into helm-v3-dev Dec 11, 2019
@hiddeco hiddeco deleted the helm-v3/repo-management branch December 11, 2019 11:23
)

var (
repositoryConfigLock sync.RWMutex
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a good reason to have this as a global variable? Can't it be part of Helm2?

Copy link
Member Author

@hiddeco hiddeco Dec 11, 2019

Choose a reason for hiding this comment

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

There can theoretically be multiple versions of Helm2 while they all speak with the same repository index file (this is not completely true, as they can have different HELM_HOMEs and are thus working with a different file, but this is the simplest secure option).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
helm v3 Issue or PR related to Helm v3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants