https://github.com/redhat-actions/oc-installer
GitHub Action to install the OpenShift Client 'oc' into an action runner.
https://github.com/redhat-actions/oc-installer
action cloud k8s kubernetes oc openshift redhat
Last synced: 7 months ago
JSON representation
GitHub Action to install the OpenShift Client 'oc' into an action runner.
- Host: GitHub
- URL: https://github.com/redhat-actions/oc-installer
- Owner: redhat-actions
- License: mit
- Created: 2020-11-09T14:39:58.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-03-16T18:34:10.000Z (about 2 years ago)
- Last Synced: 2024-10-06T19:33:21.013Z (over 1 year ago)
- Topics: action, cloud, k8s, kubernetes, oc, openshift, redhat
- Language: TypeScript
- Homepage: https://github.com/marketplace/actions/openshift-client-installer
- Size: 2.04 MB
- Stars: 34
- Watchers: 7
- Forks: 19
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# oc-installer
[](https://github.com/redhat-actions/oc-installer/actions?query=workflow%3A%22CI+checks%22)
[](https://github.com/redhat-actions/oc-installer/actions/workflows/tests.yml)
[](https://github.com/redhat-actions/oc-installer/actions?query=workflow%3A%22Link+checker%22)
[](https://github.com/redhat-actions/oc-installer/tags)
[](./LICENSE)
[](./dist)
`oc-installer` installs the OpenShift Client CLI [`oc`](https://github.com/openshift/oc) onto your GitHub Action runner.
Note that GitHub's [Ubuntu Environments](https://github.com/actions/virtual-environments#available-environments) come with `oc 4.6` installed. So, if you are using one of those environments and do not require a different `oc` version, this action is not necessary for your workflow.
Once `oc` is present, use [**oc-login**](https://github.com/redhat-actions/oc-login) to log into the cluster and set up a Kubernetes context.
### ⚠ Note
This action has been superseded by [**openshift-tools-installer**](https://github.com/redhat-actions/openshift-tools-installer), which can install `oc` as well as other CLIs. It has support for caching across multiple workflows, and allows inputting semantic version ranges.
This action can still be used, but points to an old download directory which is no longer updated as of December 2020.
## Inputs:
The action has one input: `oc_version`. If not specified, it defaults to `latest`.
The `oc_version` can be:
- `latest` (the default) to use the latest stable release.
- An existing `oc` version. For example, `4.6` or `3.11.173`.
- The version must exist on our public download site. Refer to the download sites for [v3](https://mirror.openshift.com/pub/openshift-v3/clients/) and [v4](https://mirror.openshift.com/pub/openshift-v4/clients/oc/).
- This type of version is required to use the [caching feature](#how-the-cache-works).
- A URL from which to download `oc`.
### Example
Also see [this repository's workflows](./.github/workflows/).
```yaml
steps:
- name: Install oc
uses: redhat-actions/oc-installer@v1
with:
oc_version: '4.6'
# Now, oc is available for the rest of these steps.
```
## Proxy Support
If you need a self-hosted runner to communicate via a proxy server, you can use one of the following methods as described in the [GitHub Actions documentation](https://help.github.com/en/actions/hosting-your-own-runners/using-a-proxy-server-with-self-hosted-runners).
- Configuring a proxy server using environment variables (*HTTPS_PROXY*, *HTTP_PROXY*)
- Using an `.env` file to set the proxy configuration
oc-installer caches the `oc` executable to avoid downloading the same executable multiple times when running different jobs.
The cache is only enabled when the `version` input is specified as a semantic version in the task. If the version is `latest`, or a URL, the cache is not used.
The oc executable will be cached inside the `_work/_tool/oc` folder.