Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rosa-ocp-version endpoint #11379

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dahorak
Copy link
Contributor

@dahorak dahorak commented Feb 12, 2025

This endpoint will allow us to get list of all available OCP versions from ROSA and also check if particular OCP version is available there (and get the latest z-stream version for that OCP version).

This is the help for the new endpoint:

$ rosa-ocp-version -h
usage: rosa-ocp-version [-h] [--debug] [--get-available-versions] [--check-available-version OCP_VERSION] --ocsci-conf OCSCI_CONF

Get information about available OCP versions from ROSA

options:
  -h, --help            show this help message and exit
  --debug, -d           Print logging messages (mainly useful for debugging).
  --get-available-versions, -a
                        Get all available OCP versions from ROSA
  --check-available-version OCP_VERSION, -c OCP_VERSION
                        Check if provided OCP version is available in ROSA, if available, returns latest z-stream version
  --ocsci-conf OCSCI_CONF
                        OCM Credentials configuration file in yaml format. Example file: --- AUTH: openshiftdedicated: token: '<TOKEN>'

There are two ways how to use rosa-ocp-version command:

  • to get list of all available OCP versions in ROSA:
$ rosa-ocp-version --ocsci-conf path/to/credentials-file.yaml --get-available-versions
4.17.14
4.17.12
4.17.11
4.17.10
4.17.9
4.17.8
4.17.7
4.17.6
4.17.5
4.17.4
...
  • and to check if provided OCP version is available in ROSA:
$ rosa-ocp-version --ocsci-conf path/to/credentials-file.yaml --check-available-version 4.17
4.17.14
$ echo $?
0

$ rosa-ocp-version --ocsci-conf path/to/credentials-file.yaml --check-available-version 4.18
Version 4.18 not available in ROSA.
$ echo $?
255

Additionally there is -d / --debug parameter which enables printing of logging messages useful for debugging.

- using yaml format for rosa command output will help us with parsing
  and processing the output

Signed-off-by: Daniel Horak <[email protected]>
- this endpoint will allow us to get list of OCP versions from
  ROSA and check if provided OCP version is available there

Signed-off-by: Daniel Horak <[email protected]>
@pull-request-size pull-request-size bot added the size/L PR that changes 100-499 lines label Feb 12, 2025
@dahorak dahorak marked this pull request as ready for review February 12, 2025 10:03
@dahorak dahorak requested a review from a team as a code owner February 12, 2025 10:03
@dahorak dahorak self-assigned this Feb 12, 2025
@dahorak dahorak added the Verified Mark when PR was verified and log provided label Feb 12, 2025
@dahorak
Copy link
Contributor Author

dahorak commented Feb 12, 2025

Verified locally (see the output in the Description).

DanielOsypenko
DanielOsypenko previously approved these changes Feb 12, 2025
Signed-off-by: Daniel Horak <[email protected]>
@openshift-ci openshift-ci bot added the lgtm label Feb 12, 2025
Copy link

openshift-ci bot commented Feb 12, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dahorak, DanielOsypenko

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@dahorak
Copy link
Contributor Author

dahorak commented Feb 12, 2025

Link to updated documentation: https://ocs-ci--11379.org.readthedocs.build/en/11379/usage.html

Comment on lines +103 to +106
# Usage for ocs-ci tool

For full usage run: `run-ci --help`

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you move this section to the beginning ( above # Usage for rosa-ocp-version tool )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm size/L PR that changes 100-499 lines Verified Mark when PR was verified and log provided
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants