Skip to content

asdf version manager plugin for odo, the developer-focused CLI for fast and iterative application development on Podman, Kubernetes and OpenShift

License

Notifications You must be signed in to change notification settings

asdf-community/asdf-odo

Repository files navigation

asdf-odo Build Lint

asdf plugin for managing runtime versions of odo, the developer-focused CLI for fast & iterative container-based application development on Podman, OpenShift and Kubernetes.

Contents

Dependencies

  • Required: bash, awk, curl, shasum
  • Optional: unzip and Golang if you want to install unreleased development branches or specific commits. You may want to install Golang using this other asdf plugin: asdf-golang ;)

Install

You first need to install and configure asdf.

After that, you can install this plugin:

# The command below works because this plugin is referenced
# in the central plugins repository: https://github.com/asdf-vm/asdf-plugins
asdf plugin add odo

or using the full repo URL:

asdf plugin add odo https://github.com/asdf-community/asdf-odo.git

To check that the plugin is installed correctly and to manage versions of odo:

# Show all installable versions
asdf list-all odo

# Install latest version
asdf install odo latest

# Set a version globally (on your ~/.tool-versions file)
asdf global odo latest

# Set a version depending on the project directory.
# Note that this creates a file named '.tool-versions' in the current directory.
# You may want to put that file under version control.
asdf local odo latest

# Now odo commands are available
odo version
odo help
# You can also run: asdf exec odo -- [odo_options]

Check asdf README for more instructions on how to install & manage versions.

Additional commands

This plugin defines additional asdf commands with helpers that extend odo.

Settings management

This is availabe via the asdf odo settings command:

asdf odo settings COMMAND

COMMANDS
   which    -   Shows the path to the file where the current odo stores its settings.
   reset    -   Resets the odo settings to their default values.
                This essentially removes the current settings file,
                so subsequent odo commands can recreate it.
   help     -   Shows this help.

NOTE: odo already comes bundled with a preference command, but the additional commands defined here aim at extending it a little bit.

FAQ

How do I install specific releases of odo?

You can first list all installable versions (actually, all Git tags from the upstream repository) with:

asdf list-all odo

Now you can pick and install any version from the list above:

asdf install odo <version>

How do I install nightly releases of odo?

Run the command below:

asdf install odo ref:nightly

How do I install odo from specific (unreleased) Git commits or branches?

NOTE: This will download and build odo on your machine. Make sure you installed these optional dependencies, besides the mandatory ones: unzip, git, Golang and make. You may want to install Golang using this other plugin for asdf: asdf-golang

Using the upstream odo repo

asdf install odo ref:<commit_or_branch>

Using a different fork repo on GitHub

You need to set the ASDF_GITHUB_REPO_FOR_ODO environment variable beforehand. It can either be a complete GitHub HTTPS URL, or formatted as follows: <org_or_user>/<repo>.

ASDF_GITHUB_REPO_FOR_ODO=<org_or_user>/<repo> \
  asdf install odo ref:<commit_or_branch>

Or:

ASDF_GITHUB_REPO_FOR_ODO=https://github.com/<org_or_user>/<repo> \
  asdf install odo ref:<commit_or_branch>

Can I override the binary architecture?

The following environment variables can be used to override the odo binary that will get downloaded by this plugin. Please refer to the artifacts listing page for more info about the supported platforms and architectures.

  • ASDF_ODO_BINARY_OS_ARCH. Defines both the operating system and architecture for the binary. Must follow this pattern: <platform>-<architecture>. Examples: darwin-amd64, linux-s390x
  • ASDF_ODO_BINARY_OS. Defines the operating system for the binary. In this case, the plugin will attempt to determine the right architecture. Examples: darwin, windows, linux
  • ASDF_ODO_BINARY_ARCH. Defines the architecture for the binary. In this case, the plugin will attempt to determine the right operating system. Examples: arm64, s390x, amd64, ...

Note that, if defined, ASDF_ODO_BINARY_OS_ARCH always take precedence over the other two environment variables.

Examples:

# ASDF_ODO_BINARY_OS_ARCH allows to override both the operation system and architecture to use
ASDF_ODO_BINARY_OS_ARCH=darwin-amd64 asdf install odo latest

or

# The architecture will be determined automatically
ASDF_ODO_BINARY_OS=windows asdf install odo latest

or

# The operating system will be determined automatically
ASDF_ODO_BINARY_ARCH=arm64 asdf install odo latest

How do I uninstall a given version of odo?

First of all, you can list all installed versions of odo, like so:

asdf list odo

You can now uninstall any version listed above, like so:

asdf uninstall odo <version>

How do I reinstall an already installed version of odo?

Because of the way asdf works (by enforcing exact versions), if you installed odo from a development branch (or a nightly release) and wish to update it, you need to reinstall that specific version. To reinstall an already installed version of odo, first uninstall it, and then install it again.

latest is a special version number that asdf dynamically resolves to the latest known version at the time of execution. So running asdf install odo latest might install a newer version of odo, if a newer version is available at the time the command is executed.

Can I use this plugin on Windows?

Not officially supported :)

asdf itself does not support Windows officially, per their FAQ. Running it on Windows Subsystem for Linux (WSL) 2 should work however, as written in this blog. But this is not tested/supported.

So if you already have asdf running on WSL 2, you should be able to use this plugin as well.

How do I know what this plugin really does?

Set the ASDF_ODO_VERBOSE environment variable to true prior to running this plugin, and you will be able to get more detailed information. For example:

ASDF_ODO_VERBOSE=true asdf install odo 3.0.0

Contributing

Contributions of any kind are welcome! See the contributing guide.

Thanks to these contributors!

License

See MIT License © Armel Soro

About

asdf version manager plugin for odo, the developer-focused CLI for fast and iterative application development on Podman, Kubernetes and OpenShift

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Languages