openshift-rest-client is a Node.js library designed to interact with the OpenShift REST API. It provides a client that translates OpenShift API Path Item Objects (like `/apis/project.openshift.io/v1/projects`) into idiomatic JavaScript object chains, allowing developers to interact with resources using methods such as `.get()`, `.post()`, `.delete()`, `.patch()`, and `.put()`. The library is currently stable at version 10.0.0 and follows a release cadence tied to Node.js LTS versions, introducing breaking changes primarily for dropping support for End-of-Life Node.js runtimes. A key differentiator is its integration with the kubernetes-client module for configuration, enabling flexible authentication and cluster context management, similar to the Fabric8 Maven Plugin but tailored for Node.js environments. It simplifies API interaction by providing aliases for common API groups and supports query parameters and path templating, making it a robust tool for programmatic OpenShift management from Node.js applications.
npm install openshift-rest-clientVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to initialize the OpenShift client, connect to an API endpoint (projects), and fetch resources. It includes basic error handling and uses environment variables for flexible configuration.
Upgrade your Node.js runtime to version 20 or higher. Refer to the package's `engines` field for exact supported versions.
Upgrade your Node.js runtime to version 18 or higher.
Upgrade your Node.js runtime to version 16 or higher.
Review any custom HTTP client configurations or options previously passed to `request`. Adapt them to `undici`'s API or the `kubernetes-client`'s options for underlying HTTP client configuration.
Replace `strictSSL: false` with `rejectUnauthorized: false` in your client configuration when dealing with self-signed certificates or untrusted CAs.
Double-check the OpenShift API documentation for the exact path and method. Ensure the API version (e.g., `v1`) and resource names (e.g., `projects`) are correct and in the correct order.
Verify your OpenShift cluster URL and network connectivity. If using self-signed certificates, ensure `rejectUnauthorized: false` is set in your client configuration. Also check for proxy issues.
Upgrade your Node.js runtime to one of the supported versions (20, 22, or 24) using a Node.js version manager like `nvm` or `volta`.