Chapter 16. Managing IDE extensions
Manage IDE extensions in OpenShift Dev Spaces workspaces to control which extensions are available, trusted, and pre-installed for users across different IDE types. Extension management is essential for air-gapped environments, security-conscious organizations, and teams that need consistent developer tooling.
16.1. Extensions for Microsoft Visual Studio Code - Open Source Copy linkLink copied to clipboard!
OpenShift Dev Spaces uses an Open VSX registry instance to manage extensions for Microsoft Visual Studio Code - Open Source.
To manage extensions, this IDE uses one of the Open VSX registry instances:
-
The embedded instance of the Open VSX registry that runs in the
plugin-registrypod of OpenShift Dev Spaces to support air-gapped, offline, and proxy-restricted environments. The embedded Open VSX registry contains only a subset of the extensions published on the public open-vsx.org registry. This subset is customizable. - The public open-vsx.org registry that is accessed over the internet.
- A standalone Open VSX registry instance that is deployed on a network accessible from OpenShift Dev Spaces workspace pods.
The default is the embedded instance of the Open VSX registry.
16.2. Configure the Open VSX registry URL Copy linkLink copied to clipboard!
Configure OpenShift Dev Spaces to use an alternative Open VSX registry instance instead of the default embedded registry. Switch to the public open-vsx.org registry for internet-connected environments, or to a standalone on-premises instance for full control over available extensions.
The default is the embedded instance of the Open VSX registry.
If the default Open VSX registry instance does not meet your requirements, you can select one of the following instances:
-
The Open VSX registry instance at
https://open-vsx.orgthat requires access to the internet. - A standalone Open VSX registry instance that is deployed on a network accessible from OpenShift Dev Spaces workspace pods.
Prerequisites
- You have administrator access to the OpenShift cluster where OpenShift Dev Spaces is deployed.
-
You have an active
ocsession with administrative permissions. See Getting started with the CLI.
Procedure
Edit the
CheClustercustom resource to update theopenVSXURLvalue:spec: components: pluginRegistry: openVSXURL: "<url_of_an_open_vsx_registry_instance>"where:
<url_of_an_open_vsx_registry_instance>The URL of the Open VSX registry instance. For example:
openVSXURL: "https://open-vsx.org".-
To select the embedded Open VSX registry instance in the
plugin-registrypod, useopenVSXURL: ''. You can customize the list of included extensions. See Section 16.3, “Add or remove extensions in an OpenShift Dev Spaces workspace” or Section 16.4, “Add or remove extensions from the Linux command line”. -
You can also point
openVSXURLat the URL of a standalone Open VSX registry instance. The URL must be accessible from within your organization’s cluster and not blocked by a proxy.
NoteTo ensure the stability and performance of the community-supported Open VSX Registry, API usage is organized into defined tiers. The Eclipse Foundation implements these limits to protect infrastructure from high-frequency automated traffic and to provide consistent service quality for all users. For more information, see Rate Limits and Usage Tiers and the open-vsx.org wiki.
ImportantUsing https://open-vsx.org is not recommended in an air-gapped environment, isolated from the internet. To reduce the risk of malware infections and unauthorized access to your code, use the embedded or self-hosted Open VSX registry with a curated set of extensions.
WarningDue to the dedicated Microsoft Terms of Use, Visual Studio Code Marketplace is not supported by Red Hat OpenShift Dev Spaces.
-
To select the embedded Open VSX registry instance in the
Verification
-
Confirm that the
plugin-registrypod has restarted and is running. - Open a workspace and verify that extensions are available from the selected registry instance in the Extensions view.
16.3. Add or remove extensions in an OpenShift Dev Spaces workspace Copy linkLink copied to clipboard!
Customize the embedded Open VSX registry instance by adding or removing extensions directly within an OpenShift Dev Spaces workspace to create a custom extension catalog for your organization.
The embedded plugin registry is deprecated; the Open VSX Registry is its successor. Setting up an internal, on-premises Open VSX Registry provides full control over the extension lifecycle, enables offline use, and improves compliance. See Section 16.5, “Deploy Open VSX with a pre-built image” or Section 16.6, “Deploy Open VSX from source” for detailed setup instructions.
Prerequisites
- You are logged in to your OpenShift Dev Spaces instance as an administrator.
- You have started a workspace using the plugin registry repository.
- You have created a Red Hat Registry Service Account and have the username and token available.
-
You have the custom plugin registry built locally on the corresponding hardware for IBM Power (
ppc64le) and IBM Z (s390x) architectures. - You have a container image based on the latest tag or SHA to include the latest security fixes.
Procedure
Identify the publisher and extension name for each extension you want to add:
- Find the extension on the Open VSX registry website.
- Copy the URL of the extension’s listing page.
Extract the <publisher> and <name> from the URL:
https://open-vsx.org/extension/<publisher>/<name>TipIf the extension is only available from Microsoft Visual Studio Marketplace and not Open VSX, ask the extension publisher to publish it on open-vsx.org. See the publishing instructions and the GitHub action.
If the publisher is unavailable or unwilling, and no Open VSX equivalent exists, consider reporting an issue to the Open VSX team.
-
Open the
openvsx-sync.jsonfile in the workspace. Add or remove extensions using the following JSON syntax:
{ "id": "<publisher>.<name>", "version": "<extension_version>" }TipIf you have a closed-source or internal-only extension, you can add it directly from a
.vsixfile. Use a URL accessible to your custom plugin registry container:{ "id": "<publisher>.<name>", "download": "<url_to_download_vsix_file>", "version": "<extension_version>" }Read the Terms of Use for the Microsoft Visual Studio Marketplace before using its resources.
Log in to the Red Hat registry:
-
Navigate to Terminal
Run Task… devfile. - Run the 1. Login to registry.redhat.io task.
- Enter your Red Hat Registry Service Account credentials when prompted.
-
Navigate to Terminal
Build and publish the custom plugin registry:
-
Navigate to Terminal
Run Task… devfile. Run the 2. Build and Publish a Custom Plugin Registry task.
NoteVerify that the
CHE_CODE_VERSIONin thebuild-config.jsonfile matches the version of the editor currently used with OpenShift Dev Spaces. Update it if necessary.
-
Navigate to Terminal
Configure OpenShift Dev Spaces to use the custom plugin registry:
-
Navigate to Terminal
Run Task… devfile. - Run the 3. Configure Che to use the Custom Plugin Registry task.
-
Navigate to Terminal
Verification
-
Check that the
plugin-registrypod has restarted and is running. - Restart your workspace.
- Open the Extensions view in the IDE and verify that your added extensions are available.
16.4. Add or remove extensions from the Linux command line Copy linkLink copied to clipboard!
Build and publish a custom plugin registry from the Linux command line to create a tailored Open VSX registry with the specific extensions your organization needs.
Prerequisites
- You have podman installed.
- You have Node.js version 18.20.3 or higher installed.
- You have created a Red Hat Registry Service Account and have the username and token available.
- You have a container image based on the latest tag or SHA to include the latest security fixes.
Procedure
Clone the plugin registry repository:
$ git clone https://github.com/redhat-developer/che-plugin-registry.gitChange to the plugin registry directory:
$ cd che-plugin-registry/Log in to the Red Hat registry:
$ podman login registry.redhat.ioIdentify the publisher and extension name for each extension you want to add:
- Find the extension on the Open VSX registry website.
- Copy the URL of the extension’s listing page.
Extract the <publisher> and <name> from the URL:
https://open-vsx.org/extension/<publisher>/<name>TipIf the extension is only available from Microsoft Visual Studio Marketplace and not Open VSX, ask the extension publisher to publish it on open-vsx.org. See the publishing instructions and the GitHub action.
If the publisher is unavailable or unwilling, and no Open VSX equivalent exists, consider reporting an issue to the Open VSX team.
-
Open the
openvsx-sync.jsonfile. Add or remove extensions using the following JSON syntax:
{ "id": "<publisher>.<name>", "version": "<extension_version>" }TipIf you have a closed-source or internal-only extension, you can add it directly from a
.vsixfile. Use a URL accessible to your custom plugin registry container:{ "id": "<publisher>.<name>", "download": "<url_to_download_vsix_file>", "version": "<extension_version>" }Read the Terms of Use for the Microsoft Visual Studio Marketplace before using its resources.
Build the plugin registry container image:
$ ./build.sh -o <username> -r quay.io -t customNoteVerify that the
CHE_CODE_VERSIONin thebuild-config.jsonfile matches the version of the editor currently used with OpenShift Dev Spaces. Update it if necessary.Push the image to a container registry such as quay.io:
$ podman push quay.io/<username/plugin_registry:custom>Edit the
CheClustercustom resource in your organization’s cluster to point to the image and save the changes:spec: components: pluginRegistry: deployment: containers: - image: quay.io/<username/plugin_registry:custom> openVSXURL: ''
Verification
-
Check that the
plugin-registrypod has restarted and is running. - Restart your workspace.
- Open the Extensions view in the IDE and verify that your added extensions are available.
16.5. Deploy Open VSX with a pre-built image Copy linkLink copied to clipboard!
Deploy a standalone Open VSX extension registry by using an existing container image. Use a private, on-premises registry to control which extensions are available in your OpenShift Dev Spaces workspaces without building from source.
Prerequisites
-
You have the
octool installed. You are logged in to the OpenShift cluster where OpenShift Dev Spaces is deployed as a cluster administrator.
Tip$ oc login https://<openshift_dev_spaces_fqdn> --username=<my_user>-
You have
jqinstalled.
Procedure
Create a new OpenShift project for Open VSX:
oc new-project openvsx- Save the openvsx-deployment-no-es.yml deployment template file on your file system.
Deploy Open VSX from the directory where you saved the file:
oc process -f openvsx-deployment-no-es.yml \ -p OPENVSX_SERVER_IMAGE=registry.redhat.io/devspaces/openvsx-rhel9:3.28 \ | oc apply -f -Verify that all pods in the
openvsxproject are running and ready:{orch-cli} get pods -n openvsx \ -o jsonpath='\{range .items[]}\{@.metadata.name}\{"\t"}\{@.status.phase}\{"\t"}\{.status.containerStatuses[].ready}\{"\n"}{end}'Add an Open VSX user with a Personal Access Token (PAT) to the database.
Find the PostgreSQL pod:
export POSTGRESQL_POD_NAME=$({orch-cli} get pods -n openvsx \ -o jsonpath="\{.items[*].metadata.name}" | tr ' ' '\n' | grep '^postgresql' | head -n 1)Insert the username into the Open VSX database:
oc exec -n openvsx "${POSTGRESQL_POD_NAME}" -- bash -c \ "psql -d openvsx -c \"INSERT INTO user_data (id, login_name, role) VALUES (1001, 'eclipse-che', 'privileged');\""Insert the user PAT into the Open VSX database:
oc exec -n openvsx "${POSTGRESQL_POD_NAME}" -- bash -c \ "psql -d openvsx -c \"INSERT INTO personal_access_token (id, user_data, value, active, created_timestamp, accessed_timestamp, description, notified) VALUES (1001, 1001, 'eclipse_che_token', true, current_timestamp, current_timestamp, 'extensions publisher', false);\""ImportantThe user PAT must match the decoded value of
OVSX_PAT_BASE64specified in the deployment file. If you updateOVSX_PAT_BASE64, use the new decoded value as the user PAT.
Configure OpenShift Dev Spaces to use the internal Open VSX registry:
export CHECLUSTER_NAME="$({orch-cli} get checluster --all-namespaces -o json | jq -r '.items[0].metadata.name')" && export CHECLUSTER_NAMESPACE="$({orch-cli} get checluster --all-namespaces -o json | jq -r '.items[0].metadata.namespace')" && export OPENVSX_ROUTE_URL="$({orch-cli} get route internal -n openvsx -o jsonpath='\{.spec.host}')" && export PATCH='\{"spec":\{"components":\{"pluginRegistry":\{"openVSXURL":"https://'"$OPENVSX_ROUTE_URL"'"\}\}\}\}' && {orch-cli} patch checluster "${CHECLUSTER_NAME}" --type=merge --patch "${PATCH}" -n "${CHECLUSTER_NAMESPACE}"TipFor detailed instructions on configuring the Open VSX registry URL, see Section 16.2, “Configure the Open VSX registry URL”.
Publish a Visual Studio Code extension from a
.vsixfile. The Open VSX registry does not provide any extension by default. You need the extension publisher name and the download URL of the.vsixpackage.Retrieve the name of the pod running the Open VSX server:
export OVSX_POD_NAME=$({orch-cli} get pods -n openvsx -o jsonpath="\{.items[*].metadata.name}" | tr ' ' '\n' | grep ^openvsx-server)Download the
.vsixextension:oc exec -n openvsx "${OVSX_POD_NAME}" -- bash -c "wget -O /tmp/extension.vsix <EXTENSION_DOWNLOAD_URL>"Create an extension publisher:
oc exec -n openvsx "${OVSX_POD_NAME}" -- bash -c "ovsx create-namespace <EXTENSION_PUBLISHER_NAME>" || truePublish the extension:
oc exec -n openvsx "${OVSX_POD_NAME}" -- bash -c "ovsx publish /tmp/extension.vsix"Delete the downloaded extension file:
oc exec -n openvsx "${OVSX_POD_NAME}" -- bash -c "rm /tmp/extension.vsix"
Optional: Publish multiple extensions from a list. Update the
deploy/openshift/extensions.txtfile with the download URLs of each.vsixfile, then publish all listed extensions:while IFS= read -r url; do oc exec -n openvsx "${OVSX_POD_NAME}" -- bash -c "wget -O /tmp/extension.vsix '$url' && ovsx publish /tmp/extension.vsix && rm /tmp/extension.vsix" done < deploy/openshift/extensions.txt
Verification
- Start any workspace and verify the published extensions are available in the Extensions view of the workspace IDE.
- Navigate to the Open VSX route URL to verify the registry UI displays the published extensions.
16.6. Deploy Open VSX from source Copy linkLink copied to clipboard!
Build custom Open VSX server and CLI images from source and deploy them to your cluster. Use this method when you need a specific Open VSX version or custom modifications to the registry.
Prerequisites
-
You have the
octool installed. You are logged in to the OpenShift cluster where OpenShift Dev Spaces is deployed as a cluster administrator.
Tip$ oc login https://<openshift_dev_spaces_fqdn> --username=<my_user>- You have Podman installed.
- You have access to a container registry where you can push images.
-
You have
jqinstalled.
Procedure
Create a new OpenShift project for Open VSX:
oc new-project openvsxClone the Open VSX repository and navigate to the deployment directory:
git clone https://github.com/eclipse-openvsx/openvsx.git && cd openvsx/deploy/openshiftBuild and push the Open VSX server image:
export REGISTRY=<registry_hostname> export NAMESPACE=<registry_namespace> export OPENVSX_VERSION=<openvsx_version> export OPENVSX_SERVER_IMAGE=$\{REGISTRY}/$\{NAMESPACE}/openvsx-server:$\{OPENVSX_VERSION} podman build -t "$\{OPENVSX_SERVER_IMAGE}" \ --build-arg "OPENVSX_VERSION=$\{OPENVSX_VERSION}" -f openvsx.Dockerfile . && podman login "$\{REGISTRY}" && podman push "$\{OPENVSX_SERVER_IMAGE}"where:
<registry_hostname>-
The container registry hostname. For example:
quay.io. <registry_namespace>-
Your organization or account in the registry. For example:
myuser. <openvsx_version>The Open VSX version tag to build. For example:
v0.33.0. Available versions are listed on the Open VSX releases page.ImportantEnsure that the image is publicly accessible or that the cluster can pull from the registry with appropriate credentials.
Build and push the Open VSX CLI image:
export OPENVSX_CLI_VERSION=<cli_version> export OPENVSX_CLI_IMAGE=$\{REGISTRY}/$\{NAMESPACE}/openvsx-cli:$\{OPENVSX_CLI_VERSION} podman build -t "$\{OPENVSX_CLI_IMAGE}" \ --build-arg "OVSX_VERSION=$\{OPENVSX_CLI_VERSION}" -f cli.Dockerfile . && podman push "$\{OPENVSX_CLI_IMAGE}"where:
<cli_version>-
The Open VSX CLI version. For example:
0.10.9.
Deploy Open VSX with the custom images:
{orch-cli} process -f openvsx-deployment.yml \ -p OPENVSX_SERVER_IMAGE="${OPENVSX_SERVER_IMAGE}" \ -p OPENVSX_CLI_IMAGE="${OPENVSX_CLI_IMAGE}" \ | {orch-cli} apply -f -Verify that all pods in the
openvsxproject are running and ready:{orch-cli} get pods -n openvsx \ -o jsonpath='\{range .items[]}\{@.metadata.name}\{"\t"}\{@.status.phase}\{"\t"}\{.status.containerStatuses[].ready}\{"\n"}{end}'Add an Open VSX user with a Personal Access Token (PAT) to the database.
Find the PostgreSQL pod:
export POSTGRESQL_POD_NAME=$({orch-cli} get pods -n openvsx \ -o jsonpath="\{.items[*].metadata.name}" | tr ' ' '\n' | grep '^postgresql' | head -n 1)Insert the username into the Open VSX database:
oc exec -n openvsx "${POSTGRESQL_POD_NAME}" -- bash -c \ "psql -d openvsx -c \"INSERT INTO user_data (id, login_name, role) VALUES (1001, 'eclipse-che', 'privileged');\""Insert the user PAT into the Open VSX database:
oc exec -n openvsx "${POSTGRESQL_POD_NAME}" -- bash -c \ "psql -d openvsx -c \"INSERT INTO personal_access_token (id, user_data, value, active, created_timestamp, accessed_timestamp, description, notified) VALUES (1001, 1001, 'eclipse_che_token', true, current_timestamp, current_timestamp, 'extensions publisher', false);\""ImportantThe user PAT must match the decoded value of
OVSX_PAT_BASE64specified in the deployment file. If you updateOVSX_PAT_BASE64, use the new decoded value as the user PAT.
Configure OpenShift Dev Spaces to use the internal Open VSX registry:
export CHECLUSTER_NAME="$({orch-cli} get checluster --all-namespaces -o json | jq -r '.items[0].metadata.name')" && export CHECLUSTER_NAMESPACE="$({orch-cli} get checluster --all-namespaces -o json | jq -r '.items[0].metadata.namespace')" && export OPENVSX_ROUTE_URL="$({orch-cli} get route internal -n openvsx -o jsonpath='\{.spec.host}')" && export PATCH='\{"spec":\{"components":\{"pluginRegistry":\{"openVSXURL":"https://'"$OPENVSX_ROUTE_URL"'"\}\}\}\}' && {orch-cli} patch checluster "${CHECLUSTER_NAME}" --type=merge --patch "${PATCH}" -n "${CHECLUSTER_NAMESPACE}"Publish a Visual Studio Code extension from a
.vsixfile. The Open VSX registry does not provide any extension by default.Retrieve the name of the pod running the Open VSX server:
export OVSX_POD_NAME=$({orch-cli} get pods -n openvsx -o jsonpath="\{.items[*].metadata.name}" | tr ' ' '\n' | grep ^openvsx-server)Download the
.vsixextension:oc exec -n openvsx "${OVSX_POD_NAME}" -- bash -c "wget -O /tmp/extension.vsix <EXTENSION_DOWNLOAD_URL>"Create an extension publisher:
oc exec -n openvsx "${OVSX_POD_NAME}" -- bash -c "ovsx create-namespace <EXTENSION_PUBLISHER_NAME>" || truePublish the extension:
oc exec -n openvsx "${OVSX_POD_NAME}" -- bash -c "ovsx publish /tmp/extension.vsix"Delete the downloaded extension file:
oc exec -n openvsx "${OVSX_POD_NAME}" -- bash -c "rm /tmp/extension.vsix"
Optional: Publish multiple extensions from a list. Update the
deploy/openshift/extensions.txtfile with the download URLs of each.vsixfile, then publish all listed extensions:while IFS= read -r url; do oc exec -n openvsx "${OVSX_POD_NAME}" -- bash -c "wget -O /tmp/extension.vsix '$url' && ovsx publish /tmp/extension.vsix && rm /tmp/extension.vsix" done < deploy/openshift/extensions.txt
Verification
- Start any workspace and verify the published extensions are available in the Extensions view of the workspace IDE.
- Navigate to the Open VSX route URL to verify the registry UI displays the published extensions.
16.7. Deploy Open VSX from an OpenShift Dev Spaces workspace Copy linkLink copied to clipboard!
Deploy an on-premises Open VSX extension registry by using predefined devfile tasks in an OpenShift Dev Spaces workspace. The workspace environment includes all necessary tools and commands defined in the .devfile.yaml file of the Open VSX repository.
Prerequisites
- You are logged in to the OpenShift cluster as a cluster administrator.
- You have a running OpenShift Dev Spaces instance.
Procedure
Start a workspace by using the Eclipse Open VSX repository.
WarningThe .devfile.yaml includes an
elasticsearchcomponent that does not support IBM Power (ppc64le) or IBM Z (s390x) architectures. To start the workspace on these architectures, remove theelasticsearchcomponent from the devfile. Alternatively, use the Section 16.5, “Deploy Open VSX with a pre-built image” procedure to deploy Open VSX without starting a workspace.TipThe environment, including all necessary commands, is defined in the
.devfile.yamlfile. The numbered task names (such as2.1.,2.4.1.) are labels defined in the devfile. Use these exact names to locate each task in theTerminal>Run Task…menu.Create a new project for Open VSX.
Select
Terminal>Run Task…>devfileand run the2.1. Create Namespace for OpenVSXtask. A new project namedopenvsxis created on the cluster.Deploy Open VSX with the OpenShift Dev Spaces pre-built image.
Select
Terminal>Run Task…>devfileand run the2.4.1. Deploy Custom OpenVSXtask. When the task prompts for the Open VSX server image, enterregistry.redhat.io/devspaces/openvsx-rhel9:3.28.After the deployment completes, the
openvsxproject has two components: PostgreSQL database and Open VSX server. The Open VSX UI is accessible through an exposed route in the OpenShift cluster.TipAll deployment parameters are described in the
deploy/openshift/openvsx-deployment-no-es.ymlfile. The template includes default values such asOVSX_PAT_BASE64.Add an Open VSX user with a PAT to the database.
Select
Terminal>Run Task…>devfileand run the2.5. Add OpenVSX user with PAT to the DBtask. The task prompts you for the Open VSX username and user PAT. Press Enter to use the default values.ImportantThe user PAT must match the decoded value of
OVSX_PAT_BASE64specified in the deployment file. If you updateOVSX_PAT_BASE64, use the new decoded value as the user PAT.Configure OpenShift Dev Spaces to use the internal Open VSX registry.
Select
Terminal>Run Task…>devfileand run the2.6. Configure Che to use the internal OpenVSX registrytask. This task patches theCheClustercustom resource to use the deployed Open VSX registry URL.Publish a Visual Studio Code extension from a
.vsixfile.Select
Terminal>Run Task…>devfileand run the2.8. Publish a VS Code Extension from a VSIX filetask. The task prompts you to provide the extension publisher name and the path to the.vsixfile.Optional: Publish a predefined list of extensions.
Update the
deploy/openshift/extensions.txtfile with the download URLs of each.vsixfile, then selectTerminal>Run Task…>devfileand run the2.9. Publish list of VS Code Extensionstask.
Verification
- Start any workspace and verify the published extensions are available in the Extensions view of the workspace IDE.
-
Open the
internalroute in theopenvsxproject to verify the registry UI displays the published extensions.
16.8. Configure internal access to the Open VSX registry Copy linkLink copied to clipboard!
Restrict your Open VSX registry to internal cluster traffic by removing the public route and configuring OpenShift Dev Spaces to use the internal service URL. Internal routing keeps extension registry traffic within the cluster and avoids public exposure.
Prerequisites
-
You have Open VSX deployed in the
openvsxproject. -
You have the
octool installed. - You are logged in to the OpenShift cluster as a cluster administrator.
-
You have
jqinstalled.
Procedure
Delete the public route for the Open VSX registry:
oc delete route internal -n openvsxUpdate the CheCluster custom resource to use the internal service DNS URL:
export CHECLUSTER_NAME="$({orch-cli} get checluster --all-namespaces -o json | jq -r '.items[0].metadata.name')" && export CHECLUSTER_NAMESPACE="$({orch-cli} get checluster --all-namespaces -o json | jq -r '.items[0].metadata.namespace')" && export PATCH='{"spec":{"components":{"pluginRegistry":{"openVSXURL":"http://openvsx-server.openvsx.svc:8080"}}}}' && {orch-cli} patch checluster "${CHECLUSTER_NAME}" --type=merge --patch "${PATCH}" -n "${CHECLUSTER_NAMESPACE}"- Restart any running workspaces to apply the new registry URL.
Verification
- Start a workspace and verify that extensions are available in the Extensions view using the internal registry.
16.9. Delete an extension by using the Open VSX administrator API Copy linkLink copied to clipboard!
Delete an extension from your private Open VSX registry by calling the administrator API with an administrator user and a Personal Access Token (PAT).
Prerequisites
-
You have access to the OpenShift cluster where the Open VSX registry is deployed in the
openvsxproject. -
You have the
octool installed.
Procedure
Add the Open VSX administrator user and PAT to the database:
export POSTGRESQL_POD_NAME=$(oc get pods -n openvsx \ -o jsonpath="{.items[*].metadata.name}" | tr ' ' '\n' | grep '^postgresql' | head -n 1)oc exec -n openvsx "$POSTGRESQL_POD_NAME" -- bash -c \ "psql -d openvsx -c \"INSERT INTO user_data (id, login_name, role) VALUES (1002, 'openvsx-admin', 'admin');\""oc exec -n openvsx "$POSTGRESQL_POD_NAME" -- bash -c \ "psql -d openvsx -c \"INSERT INTO personal_access_token (id, user_data, value, active, created_timestamp, accessed_timestamp, description, notified) VALUES (1002, 1002, '<your_admin_token>', true, current_timestamp, current_timestamp, 'Admin API Token', false);\""NoteUse a strong, unique value for
<your_admin_token>in production environments.Delete an extension and all its versions:
curl -X POST \ "https://<your_openvsx_server_url>/admin/api/extension/<publisher>/<extension>/delete?token=<your_admin_token>"where:
<your_openvsx_server_url>- The URL of the Open VSX server.
<publisher>- The extension publisher name.
<extension>- The extension name.
<your_admin_token>- The PAT value created in step 1.
Optional: Delete a specific version of an extension:
curl -X POST \ -H "Content-Type: application/json" \ -d '[{"version": "<version>", "targetPlatform": "<platform>"}]' \ "https://<your_openvsx_server_url>/admin/api/extension/<publisher>/<extension>/delete?token=<your_admin_token>"You can list multiple version and platform pairs in the JSON array.
Verification
- Refresh the Open VSX registry and verify that the extension no longer appears.
16.10. Delete an extension from the PostgreSQL database Copy linkLink copied to clipboard!
Remove extension records and related data directly from the PostgreSQL database when the administrator API is not available or when you need to clean up specific data. If the extension uses local storage, you must also remove its files from the Open VSX server pod.
Prerequisites
-
You have access to the OpenShift cluster where the Open VSX registry is deployed in the
openvsxproject. -
You have the
octool installed. - You know the publisher name and extension name that you want to delete.
Procedure
Open a command prompt in the PostgreSQL pod and connect to the database:
export POSTGRESQL_POD_NAME=$(oc get pods -n openvsx \ -o jsonpath="{.items[*].metadata.name}" | tr ' ' '\n' | grep '^postgresql' | head -n 1) oc exec -it $POSTGRESQL_POD_NAME -n openvsx -- /bin/bashInside the pod, run
psql:psqlAt the
postgres=#prompt, connect to the database:\c openvsxYou are now connected to the
openvsxdatabase as thepostgresuser.Find the publisher ID and extension ID:
Identify the extension publisher. Replace
<publisher_name>with the actual publisher name:SELECT id, name FROM namespace WHERE name = '<publisher_name>';Identify the extension ID. Replace
<publisher_id>and<extension_name>with the values from the previous query:SELECT id, name, namespace_id FROM extension WHERE namespace_id = <publisher_id> AND name = '<extension_name>';Note the ID of the extension to use as
<extension_id>in the next steps.Optional: Preview extension versions and file resources:
Preview the versions:
SELECT id, version, pre_release, semver_pre_release, semver_is_pre_release FROM extension_version WHERE extension_id = <extension_id> ORDER BY timestamp DESC;Preview the file resources:
SELECT id, name, type, storage_type FROM file_resource WHERE extension_id = <extension_id> ORDER BY id;If the
storage_typevalue islocal, you must also remove the extension files from the file system on the Open VSX server pod.Delete the extension from the database:
Run the following commands in a single transaction. Replace
<extension_id>with the extension ID from step 2.BEGIN; -- 1. Delete all file resources for the extension DELETE FROM file_resource WHERE extension_id = <extension_id>; -- 2. Delete all extension reviews DELETE FROM extension_review WHERE extension_id = <extension_id>; -- 3. Delete all versions of the extension DELETE FROM extension_version WHERE extension_id = <extension_id>; -- 4. Delete the extension entry itself DELETE FROM extension WHERE id = <extension_id>; COMMIT;ImportantRun these commands in order within one transaction. Do not skip the
COMMITcommand, or the system does not apply the changes.If the extension used local storage, remove the extension files from the Open VSX server pod:
Get the Open VSX server pod name:
export OPENVSX_POD_NAME=$(oc get pods -n openvsx -o jsonpath="{.items[*].metadata.name}" | tr ' ' '\n' | grep '^openvsx-server' | head -n 1)Delete the extension folder:
oc exec -it $OPENVSX_POD_NAME -n openvsx -- /bin/bash -c "rm -rf /tmp/extensions/<publisher>/<extension>"
Verification
- Refresh your Open VSX registry and verify that the extension no longer appears in the gallery.