Openshift cluster login on command line
Project description
OCL (OpenShift Login)
OCL does an automatic login to an OpenShift cluster. It fetches cluster information from app-interface and performs a login via Selenium.
Installation
You can install this library from PyPI with pip
:
$ python3 -m pip install openshift-cluster-login
or install it with pipx
:
$ pipx install openshift-cluster-login
You can also use pipx
to run the library without installing it:
$ pipx run openshift-cluster-login
Usage
$ ocl
Features
OCL currently provides the following features (get help with -h
or --help
):
- OpenShift console login (oc login) via GitHub authentication
- Get cluster information from app-interface or user-defined (`OCL_USER_CLUSTERS``)
- Open OpenShift console in browser (
--open-in-browser
) - Shell completion (
--install-completion
,--show-completion
) - Credentials via environment variables or shell command (e.g. 1password CLI)
Environment Variables
Variable Name | Description | Required | Default |
---|---|---|---|
OCL_GITHUB_USERNAME OCL_GITHUB_USERNAME_COMMAND | Your GitHub username | :heavy_check_mark: | |
OCL_GITHUB_PASSWORD OCL_GITHUB_PASSWORD_COMMAND | Your GitHub password (e.g. command op read op://Private/Github/password ) |
:heavy_check_mark: | |
OCL_GITHUB_TOTP OCL_GITHUB_TOTP_COMMAND | Your GitHub two factor token (e.g. command op item get Github --otp ) |
:heavy_check_mark: | |
OCL_WAIT OCL_WAIT_COMMAND | Selenium webdriver wait timeout | 2 | |
OCL_APP_INTERFACE_URL OCL_APP_INTERFACE_URL_COMMAND | App-Interface URL | :heavy_check_mark: | |
OCL_APP_INT_TOKEN OCL_APP_INT_TOKEN_COMMAND | App-Interface authentication token | :heavy_check_mark: | |
USER_CLUSTERS USER_CLUSTERS_COMMAND | User defined clusters as json format (e.g. [{"name": "local-kind", "serverUrl": "https://localhost:6443", "consoleUrl": "not available}] ) |
"[]" |
You can either set a variable, e.g. export OCL_GITHUB_USERNAME="mail@example.com"
or retrieve it via a command, e.g. export OCL_GITHUB_USERNAME_COMMAND="op read op://Private/Github/username"
Limitations
- MacOS only
- Only Selenium
webdriver.Chrome
is supported and must be installed manually$ brew install --cask chromedriver
Development
Use Conventional Commit messages. The most important prefixes you should have in mind are:
fix:
which represents bug fixes, and correlates to a SemVer patch.feat:
which represents a new feature, and correlates to a SemVer minor.feat!:
, orfix!:
,refactor!:
, etc., which represent a breaking change (indicated by the!
) and will result in a SemVer major.chore: release
to create a new release
Consider using an empty commit:
git commit --allow-empty -m "chore: release"
When a commit to the main branch has Release-As: x.x.x
(case insensitive) in the commit body, Release Please will open a new pull request for the specified version.
git commit --allow-empty -m "chore: release 2.0.0" -m "Release-As: 2.0.0"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for openshift-cluster-login-0.3.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 968dbdf0d72ee8ff844e1ffb7af9b46544107b740e43faa3d9eec07696b6ed6c |
|
MD5 | 47dc0a08a81bf74c2018652a6a7b3b4f |
|
BLAKE2b-256 | e1fe76595a19ef94add882c877f59d7ee39201904441efa0e7e6a6602def0374 |
Hashes for openshift_cluster_login-0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7ebad7e5163206a8c6aeecf616edb84ef0ef4d4825a236b8baee07e27fb23e3 |
|
MD5 | 8d5b161ec27be919056cf55d32254851 |
|
BLAKE2b-256 | 54bac8a42daad96b23f652c56718f80b9b3cc45757413809361234b0a0fe91b3 |