Skip to content

Conversation

@zikra-iqbal
Copy link
Contributor

@zikra-iqbal zikra-iqbal commented Nov 13, 2025

Description

Added support for openshift-ai-addon versions:

openshift-ai 416
Supported OpenShift cluster versions: >=4.16.0 <4.18.0

openshift-ai 417
Supported OpenShift cluster versions: >=4.17.0 <4.19.0

Documentation link

Release required?

  • No release
  • Patch release (x.x.X)
  • Minor release (x.X.x)
  • Major release (X.x.x)
Release notes content

Added support for openshift-ai-addon versions 416 and 417.

Run the pipeline

If the CI pipeline doesn't run when you create the PR, the PR requires a user with GitHub collaborators access to run the pipeline.

Run the CI pipeline when the PR is ready for review and you expect tests to pass. Add a comment to the PR with the following text:

/run pipeline

Checklist for reviewers

  • If relevant, a test for the change is included or updated with this PR.
  • If relevant, documentation for the change is included or updated with this PR.

For mergers

  • Use a conventional commit message to set the release level. Follow the guidelines.
  • Include information that users need to know about the PR in the commit message. The commit message becomes part of the GitHub release notes.
  • Use the Squash and merge option.

@zikra-iqbal
Copy link
Contributor Author

Scenario-1:

openshift_version = "4.18"
"openshift-ai" = {
      version = "416"
    } 
Screenshot 2025-11-13 at 1 49 43 PM Screenshot 2025-11-13 at 11 29 51 PM

Scenario-2:

openshift_version = "4.16"
"openshift-ai" = {
      version = "417"
    } 
Screenshot 2025-11-13 at 1 57 29 PM

Scenario-3:

openshift_version = "4.19"
"openshift-ai" = {
      version = "417"
    } 
Screenshot 2025-11-13 at 11 39 43 PM

@zikra-iqbal
Copy link
Contributor Author

Scenario-4:

openshift_version = "4.17"
"openshift-ai" = {
      version = "416"
    } 
Screenshot 2025-11-13 at 9 53 12 PM

Scenario-5:

openshift_version = "4.17"
"openshift-ai" = {
      version = "417"
    } 
Screenshot 2025-11-13 at 9 51 33 PM

@zikra-iqbal zikra-iqbal marked this pull request as ready for review November 14, 2025 03:56
@imprateeksh
Copy link
Member

imprateeksh commented Nov 14, 2025

@zikra-iqbal - Have you tested all these combinations? Can see some cases in above screenshots. It would good to update the table with the result outcomes. Thanks.

openshift-ai 416 - Supported OpenShift cluster versions: >=4.16.0 <4.18.0

openshift-ai 417 - Supported OpenShift cluster versions: >=4.17.0 <4.19.0
S.No OCP-AI version OCP Version Results
1 openshift-ai 416 4.16.0 #99 (comment) [PASSED]
2 openshift-ai 416 4.17.0 #99 (comment) (Scenario-4) [PASSED]
3 openshift-ai 416 4.18.0 (border case) #99 (comment) (Scenario-1) [FAILED]
4 openshift-ai 417 4.17.0 #99 (comment) (Scenario-5) [PASSED]
5 openshift-ai 417 4.18.0 #99 (comment) [PASSED]
6 openshift-ai 417 4.19.0 (out of supported range, for negative testing) #99 (comment) (Scenario-3) [FAILED]
7 openshift-ai 416 < 4.16.0 (-ve testing) #99 (comment) [FAILED]
8 openshift-ai 416 4.19.0 (-ve testing) #99 (comment) [FAILED]
9 openshift-ai 417 4.16.0 (-ve testing) #99 (comment) (Scenario-2) [FAILED]
10 No addon (for null/default addon value) Any OCP Version #99 (comment) [PASSED]

@imprateeksh
Copy link
Member

imprateeksh commented Nov 14, 2025

The dependency value present here can cause issues if the selected OCP version does not matches the constraints defined as OCP version is given as a choice to user here

@imprateeksh
Copy link
Member

imprateeksh commented Nov 14, 2025

There should not be any provision to show OCP versions less than 4.16, present here.

If using 4.15, it should be clearly mentioned that this will only provision openshift cluster but no openshift-ai addon.

image

@imprateeksh
Copy link
Member

Also, as the addons variable is now having more than one value, we can make this as a drop down value in the configuration with the two options.

@imprateeksh
Copy link
Member

imprateeksh commented Nov 14, 2025

Please include a validation here to allow only 416 and 417 openshift-ai versions.

@imprateeksh
Copy link
Member

Did you tried setting the value of addon to 418 on OCP 4.18 or 4.19?

The documentation mentions about openshift ai version 418 but it is currently not present on the openshift-ai page. We need to keep a track of this as well if it is not working now. If working, we can include this as well.

image image

@zikra-iqbal
Copy link
Contributor Author

Screenshot 2025-11-14 at 12 43 12 PM

@zikra-iqbal
Copy link
Contributor Author

Screenshot 2025-11-14 at 12 02 52 PM

@zikra-iqbal
Copy link
Contributor Author

Screenshot 2025-11-14 at 11 54 30 AM

@zikra-iqbal
Copy link
Contributor Author

zikra-iqbal commented Nov 14, 2025

Screenshot 2025-11-14 at 1 01 21 PM

@zikra-iqbal
Copy link
Contributor Author

Screenshot 2025-11-14 at 1 00 01 PM

@zikra-iqbal
Copy link
Contributor Author

@imprateeksh, tested this combination as well.

openshift_version = "4.19"
"openshift-ai" = {
      version = "418"
    } 

It's supporting addon versions 416 and 417

╷
│ Error: Request failed with status code: 400, ServerErrorResponse: {"incidentID":"e15bda59-55ef-afb6-9edb-1e67734a6664","code":"Ebc23","description":"Version '418' is an invalid version for add-on 'openshift-ai' supported version(s) are 416,417.","type":"BadRequest"}
│ 
│   with module.ocp_base.ibm_container_addons.addons,
│   on ../../main.tf line 529, in resource "ibm_container_addons" "addons":
│  529: resource "ibm_container_addons" "addons" {
│ 
│ ---
│ id: terraform-1c1694c6
│ summary: 'Request failed with status code: 400, ServerErrorResponse: {"incidentID":"e15bda59-55ef-afb6-9edb-1e67734a6664","code":"Ebc23","description":"Version
│   ''418'' is an invalid version for add-on ''openshift-ai'' supported version(s) are
│   416,417.","type":"BadRequest"}'
│ severity: error
│ resource: ibm_container_addons
│ operation: create
│ component:
│   name: github.com/IBM-Cloud/terraform-provider-ibm
│   version: 1.79.2
│ ---

@zikra-iqbal
Copy link
Contributor Author

Please include a validation here to allow only 416 and 417 openshift-ai versions.

I added the validation: https://github.com/terraform-ibm-modules/terraform-ibm-ocp-ai/pull/99/files#diff-e437423e7929a42cec4915226ae17f2e2c07bb2abec8f081c6243a1e9c983b77R162

Copy link
Member

@imprateeksh imprateeksh left a comment

Choose a reason for hiding this comment

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

I have two suggestions here. Please check once.

}
}

validation {
Copy link
Member

@imprateeksh imprateeksh Nov 14, 2025

Choose a reason for hiding this comment

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

I do not see any issues with the validations but I have a suggestion to future proof the validation logic.

This can be achieved by having a local map of ocp-ai version associated with openshift version and use one validation block.
This way we can address future versions of ocp-ai by simply adding them to the map.

Here is what I am suggesting -

locals {
   ocp_ai_addons = {
    "416" = { min_ocp_ver = 16, max_ocp_ver = 18 } # i.e >=4.16.x and <4.18 as per constraints given.
    "417" = { min_ocp_ver = 17, max_ocp_ver = 19 } # i.e. >=4.17.x and <4.19
 
    # "418" = { min_ocp_ver = 18, max_ocp_ver = 20 } # For other versions, just add an entry here.
  }
}

# Now use one validation block to handle this - 

validation { 
  condition  = ( 
var.addons.openshift-ai == null || !contains(keys(local.ocp_ai_addons), var.addons.openshift-ai.version) || 
(
     can(regex("^\\d+\\.\\d+(\\.\\d+)?$", var.openshift_version)) && tonumber(split(".", var.openshift_version)[0]) == 4 && 
tonumber(split(".", var.openshift_version)[1]) >=local.ocp_ai_addons[var.addons.openshift-ai.version].min_ocp_ver && 
tonumber(split(".", var.openshift_version)[1]) <  local.ocp_ai_addons[var.addons.openshift-ai.version].max_ocp_ver
    )
  )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated. Thank you!

}
}

validation {
Copy link
Member

Choose a reason for hiding this comment

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

Also, noticed there is a possibility if user has not given version inside openshift-ai map, something like -

  default = {
    openshift-ai = {
      version = ""
    }
  }

So another simple validation can be added to ignore it same way we ignore if openshift-ai == null i.e. below can be appended to above condition

var.addons.openshift-ai.version == null 

Please check for this as well -

  default = {
    openshift-ai = {}
  }

@imprateeksh
Copy link
Member

Please note - The tests should also be updated to check both openshift-ai addon versions.

@zikra-iqbal
Copy link
Contributor Author

Also, as the addons variable is now having more than one value, we can make this as a drop down value in the configuration with the two options.

As discussed, it's not required. The addons take the JSON value and validation will handle it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants