Skip to content

oc url-updater misses all versions since OpenShift 4.10 (version regex only allows single digit minor) #2714

Open

Description

@quando632

Actual behavior

The url-updater has not added any oc version since OpenShift 4.10 (2022). The latest version in ide-urls is 4.9.59, while the OpenShift mirror offers up to 4.22.19. So ide install oc gives a client that does not match current clusters.

Cause: OcUrlUpdater uses the version pattern (\d\.\d\.\d*), which only allows a single digit minor version. 4.10.0 and everything after it never matches.

I ran both patterns with java.util.regex against the current mirror index:

Pattern 4.9.59 4.10.0 4.22.19 5.0.0
(\d\.\d\.\d*) (current) found not found not found found (taken from 5.0.0-rc.0/)
href="(\d+\.\d+\.\d+)/" found found found not found

The download URLs built by addVersion still work for new versions, e.g. openshift-client-windows-4.22.19.zip, openshift-client-linux-4.22.19.tar.gz and openshift-client-mac-4.22.19.tar.gz all return HTTP 200.

Reproduce

  1. ide list-versions oc
  2. The newest listed version is 4.9.59.

Expected behavior

The url-updater picks up current oc versions (4.10 and later), and ide install oc installs the latest client.

IDEasy status

IDE_ROOT is set to C:/projects
IDE_HOME is set to C:/projects/project
Your version of IDEasy is 2026.10.001-09_29_08-SNAPSHOT.
Your operating system is windows(10.0)@x64 [Windows 11@amd64]
You are online.
Your settings are up-to-date.

Related/Dependent issues

#32 (original oc commandlet), #2712 (same pattern: url-updater silently stuck on an old version)

Comments/Hints

Suggested fix:

  • Change the version pattern to href="(\d+\.\d+\.\d+)/". Anchoring on the directory link also skips the -rc.N folders instead of extracting a bogus 5.0.0. Note that WebsiteUrlUpdater uses matcher.group(), so it needs to read the capture group (or use lookarounds instead).
  • Optional: the mirror also has ARM64 builds (openshift-client-mac-arm64-<version>.tar.gz, openshift-client-linux-arm64-<version>.tar.gz), which addVersion does not register yet.
  • Add a url-updater test with a mocked mirror index containing a two digit minor version, so this is covered.
  • The first run will find many missing versions (about 1180 on the mirror). The updater timeout should spread them over several runs; alternatively a minimum version could limit the backfill.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ocOpenShift CLIurlside-urls repo and related processes and features

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions