Delete extensions from the managed Open VSX registry
Delete individual extensions or specific extension versions from the managed Open VSX registry by using the Open VSX admin API or the ovsx command-line tool, which is included in the Open VSX server image.
|
Deleting an extension version removes the files of that version, but the version number remains reserved: you cannot publish the same version again. To free the version number, purge the version by using the admin API. |
Delete extensions by using the ovsx command-line tool
The ovsx tool deletes extensions through the regular Open VSX API. With the publisher personal access token, you can delete the extensions that the managed registry published.
-
An active
kubectlsession with administrative permissions to the destination Kubernetes cluster. See Overview of kubectl. -
The managed Open VSX registry is enabled and running.
-
The managed Open VSX registry runs Open VSX 1.2.0 or later. Che 7.123 and later deploy Open VSX 1.2.0 or later, so no action is required. Earlier Che versions deploy Open VSX 1.1.1 or earlier, which cannot delete extensions. On those versions, use the admin API instead.
The
ovsx unpublishcommand queries the registry version before it deletes anything. Against an earlier registry, the command reports that deleting extensions requires version 1.2.0 or later, and deletes nothing.
-
Get the Open VSX server pod name:
kubectl get pods --namespace eclipse-che -l app.kubernetes.io/component=openvsx-server -o name -
Determine the scope that you want to delete, and run only one of the following commands. Each command deletes a different scope, and deleting is irreversible:
-
To delete the entire extension with all its versions:
kubectl exec <openvsx_server_pod> \ --namespace eclipse-che -- \ sh -c 'OVSX_REGISTRY_URL=http://openvsx-server:8080/openvsx OVSX_PAT=$OPENVSX_USER_PAT \ ovsx unpublish <extension_namespace>.<extension_name> --force' -
To delete only specific versions, add the
--versionsoption. Separate multiple versions with spaces:kubectl exec <openvsx_server_pod> \ --namespace eclipse-che -- \ sh -c 'OVSX_REGISTRY_URL=http://openvsx-server:8080/openvsx OVSX_PAT=$OPENVSX_USER_PAT \ ovsx unpublish <extension_namespace>.<extension_name> --versions <extension_version> --force' -
To delete only specific target platforms of a version, add the
--targetoption. This option requires the--versionsoption:kubectl exec <openvsx_server_pod> \ --namespace eclipse-che -- \ sh -c 'OVSX_REGISTRY_URL=http://openvsx-server:8080/openvsx OVSX_PAT=$OPENVSX_USER_PAT \ ovsx unpublish <extension_namespace>.<extension_name> \ --versions <extension_version> --target <target_platform> --force'
where:
<openvsx_server_pod>-
The pod name from the previous step.
<extension_namespace>-
The namespace (publisher) of the extension. For example:
redhat. <extension_name>-
The name of the extension. For example:
java. <extension_version>-
The version to delete. For example:
1.2.3. <target_platform>-
The target platform to delete. For example:
linux-x64.
Omitting the
--versionsoption deletes every version of the extension. To delete a single version, you must pass--versions.The
--forceoption skips the confirmation prompt. Because the command runs in a noninteractive shell, it fails without this option, and no prompt warns you before the deletion. -
-
Open the Open VSX registry UI and verify the result for the scope that you deleted:
- Entire extension
-
The extension is no longer listed in the registry.
- Specific versions
-
The deleted versions are no longer available in the Version list on the extension page.
- Specific target platforms
-
In the extension version table, the Target platforms column no longer lists the deleted platforms for that version.
Delete extensions by using the Open VSX admin API
The admin personal access token has the admin role and can therefore delete any extension, including extensions that a different user published, and purge extension versions to free their version numbers.
-
An active
kubectlsession with administrative permissions to the destination Kubernetes cluster. See Overview of kubectl. -
The managed Open VSX registry is enabled and running.
-
Get the Open VSX server pod name:
kubectl get pods --namespace eclipse-che -l app.kubernetes.io/component=openvsx-server -o name -
List the versions of the extension:
kubectl exec <openvsx_server_pod> \ --namespace eclipse-che -- \ curl -s "http://openvsx-server:8080/openvsx/api/<extension_namespace>/<extension_name>/versions"where:
<openvsx_server_pod>-
The pod name from the previous step.
<extension_namespace>-
The namespace (publisher) of the extension. For example:
redhat. <extension_name>-
The name of the extension. For example:
java.
-
Get the target platform of the version that you want to delete. The admin API requires the target platform to identify a version:
kubectl exec <openvsx_server_pod> \ --namespace eclipse-che -- \ curl -s "http://openvsx-server:8080/openvsx/api/<extension_namespace>/<extension_name>/<extension_version>"where
<extension_version>is the version to delete. For example:1.2.3.Read the value of the
targetPlatformfield from the output. Extensions that are not platform-specific useuniversal. Platform-specific extensions use a value such aslinux-x64. -
Delete the version:
kubectl exec <openvsx_server_pod> \ --namespace eclipse-che -- \ sh -c 'curl -X POST -H "Content-Type: application/json" \ -d '"'"'[{"targetPlatform": "<target_platform>", "version": "<extension_version>"}]'"'"' \ "http://openvsx-server:8080/openvsx/admin/api/extension/<extension_namespace>/<extension_name>/delete?token=$OPENVSX_ADMIN_PAT"'where
<target_platform>is the target platform from the previous step. For example:universal.On success, the registry returns
{"success": "Deleted <extension_namespace>.<extension_name> <extension_version>"}.To delete several versions in one request, add an object for each version to the JSON array. The registry returns one
Deletedline for each version.The request body must include the
targetPlatformfield for every version. A request body that omits this field fails with404and the errorExtension not found, even when the version exists.The registry validates the whole request body before it deletes anything. If any version in the array does not exist, the request fails with
404and no version is deleted.A request with no body at all returns
200with an empty{}response and deletes nothing. Always check that the response contains asuccessmessage. -
To delete an entire extension, repeat the target platform and delete steps for every version that the version list returned.
-
Optional: Purge a version to remove it from the database and storage and free its version number for reuse. The request body is the same as for deleting a version:
kubectl exec <openvsx_server_pod> \ --namespace eclipse-che -- \ sh -c 'curl -X POST -H "Content-Type: application/json" \ -d '"'"'[{"targetPlatform": "<target_platform>", "version": "<extension_version>"}]'"'"' \ "http://openvsx-server:8080/openvsx/admin/api/extension/<extension_namespace>/<extension_name>/purge?token=$OPENVSX_ADMIN_PAT"'On success, the registry returns
{"success": "Purged <extension_namespace>.<extension_name>"}.
-
List the versions that the registry still serves:
kubectl exec <openvsx_server_pod> \ --namespace eclipse-che -- \ curl -s "http://openvsx-server:8080/openvsx/api/<extension_namespace>/<extension_name>/versions"The versions that you deleted are no longer listed, and the versions that you kept remain available. When you delete every version of the extension, the request returns
404and the output contains"error": "Extension not found: <extension_namespace>.<extension_name>".Do not verify a partial deletion with the
/api/<extension_namespace>/<extension_name>endpoint. That endpoint returns the metadata of the latest remaining version, so it still succeeds while any version of the extension remains. -
Open the Open VSX registry UI and verify the result for the scope that you deleted.