Skip to main content

Openshift cluster login on command line

Project description

OCL (OpenShift Login)

PyPI PyPI platforms PyPI - License

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)

Enviroment Variables

Variable Name Description Default
OCL_GITHUB_USERNAME Your GitHub username
OCL_GITHUB_USERNAME_COMMAND Command to retrieve your GitHub username
OCL_GITHUB_PASSWORD Your GitHub password
OCL_GITHUB_PASSWORD_COMMAND Command to retrieve your GitHub password (e.g. op read op://Private/Github/password)
OCL_GITHUB_TOTP Your GitHub two factor token
OCL_GITHUB_TOTP_COMMAND Command to retrieve your GitHub two factor token (e.g. op item get Github --otp)
OCL_WAIT Selenium webdriver wait timeout 2
OCL_WAIT_COMMAND Command to retrieve Selenium webdriver wait timeout
OCL_APP_INTERFACE_URL App-Interface URL
OCL_APP_INTERFACE_URL_COMMAND Command to retrieve App-Interface URL
OCL_APP_INT_TOKEN App-Interface authentication token
OCL_APP_INT_TOKEN_COMMAND Command to retrieve App-Interface authentication token
USER_CLUSTERS User defined clusters (e.g. [{"name": "local-kind", "serverUrl": "https://localhost:6443", "consoleUrl": "not available}])
USER_CLUSTERS_COMMAND Command to retrieve User defined clusters

Limitations

  • MacOS only
  • Only Selenium webdriver.Chrome is supported and must be installed manually
    $ brew install --cask chromedriver
    

Development

Code style: black Checked with mypy

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!:, or fix!:, 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openshift-cluster-login-0.1.1.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

openshift_cluster_login-0.1.1-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file openshift-cluster-login-0.1.1.tar.gz.

File metadata

  • Download URL: openshift-cluster-login-0.1.1.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.8.10 Linux/5.15.0-1017-azure

File hashes

Hashes for openshift-cluster-login-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2f1998693c259db486639c1d14008de8677c61373b114ee27caea069f1c72ae0
MD5 e4ab9f1b6b9445876e6fa38acdfbf759
BLAKE2b-256 7c04edd39ccbdab98a08342e6ff8f379cd991c13ea2d10fb518a316aba635b39

See more details on using hashes here.

File details

Details for the file openshift_cluster_login-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for openshift_cluster_login-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 67dd47808d1f30b03917206a3e845c72fa701b412d643552bff99bcf780af7ab
MD5 359aa2839d8590d9f741b83417e27f31
BLAKE2b-256 b107dc0cd2470885886070720546d3c00b5a9b67377bc562ccdc5108546611e1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page