-
Notifications
You must be signed in to change notification settings - Fork 41
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
Add up enterprise
commands and refactor helm installer
#116
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Moves the UXP installer to an agnostic install package and does some minor refactoring to refer to the Installer interface as a Manager. This is more reflective of the purpose, as the install.Manager is actually responsible for installing, uninstalling, and managing installations. Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
Updates all UXP commands to consume the refactored and moved install package. All changes are cosmetic -- import paths are updated and install.Manager is used instead of of install.Installer. Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
These install parameters will be used across multiple commands moving forward and so they are moved to the package which knows how to handle them. Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
Adds a helm pull client that is capable of fetching a helm chart in an OCI artifact from a registry. Other components of the Helm install manager are agnostic to the fact that the registry puller replaces the default helm pull client. Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
Updates the helm install manager to be less coupled to installing UXP. This is accomplished by allowing a caller to specify an alternate chart rather an assuming Crossplane is the alternate. It also adds new options for providing user / pass authentication and ability to specify chart is hosted in an OCI registry. Instead of switching on an unstable flag, caller is now required to pass the repoURL, meaning that using the stable or unstable chart URL is now decided outside of the helm install manager. This decouples the unstable behavior from helm's --devel flag, which we always set given that we do not want to restrict the versions a user can pull by tag, but rather by channel (url). Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
Updates helm installer tests to accomodate for the fact that the alternate chart that can be used is now configurable. Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
Updates uxp commands to manually provide the appropriate repo URL and the alternate chart that is to be used. Alternate chart is always Crossplane, and the repo URL is decided by setting the --unstable flag. Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
Adds the up enterprise install command, which prompts a user for license ID and token then uses the new helm manager to download enterprise chart from OCI registry, save it in the cache, then install it in the cluster. Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
Adds the up enterprise upgrade command, which behaves similarly to up enterprise install, but it requires that the enterprise chart is already installed before attempting upgrade. Users are also prompted for license ID and token in this command, though if the chart is already present in the cache then they could be supplied as empty. Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
up enterprise uninstall uninstalls the enterprise chart from the currently pointed to cluster. Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
Adds the enterprise subcommands to the root command. Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
Switches to using a nolint directive instead of an anonymous function when closing the compressed image layer reader. The nolint directive is more verbose about the decision not to check the error. Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
nullable-eth
approved these changes
Sep 9, 2021
Removes unused errBoom variable in parser tests. Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
Allows for the accepted media type to be set in the registry puller to make testing using go-containerregistry random.Image easier. Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
Fixes registry puller to use the configured filesystem abstraction rather than a hardcoded OS filesystem. Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
Adds unit tests for the helm registry puller. Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
tnthornton
approved these changes
Sep 9, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of your changes
From a user-facing perspective, this PR adds support for
up enterprise ...
commands, but in order to enable that, it refactors the helm installer to be more general and adds a drop-in helm pull client that can pull charts from an OCI registry. The more flexible helm installer means that we can continue to use it for other charts we may want to install in the future, and we can add features for our existing installation targets (uxp
andenterprise
) without needing to special case them. There are likely some additional ergonomic improvements that can be made to the installer, and I imagine there will be some additional tweaks over time.I am finishing up writing some unit tests for
registryPuller
, but this PR is otherwise good to go. See testing steps below.Fixes #112
I have:
make reviewable
to ensure this PR is ready for review.backport release-x.y
labels to auto-backport this PR, as appropriate.How has this code been tested
I have extensively tested each of the following scenarios: