Skip to content

[minor] Add --aiservice-install-plan-approval CLI parameter support#2233

Open
Sakshi-Singhroha1 wants to merge 22 commits intomasterfrom
mascore12745
Open

[minor] Add --aiservice-install-plan-approval CLI parameter support#2233
Sakshi-Singhroha1 wants to merge 22 commits intomasterfrom
mascore12745

Conversation

@Sakshi-Singhroha1
Copy link
Copy Markdown

@Sakshi-Singhroha1 Sakshi-Singhroha1 commented Apr 30, 2026

JIRA:

MASCORE-12745 https://jsw.ibm.com/browse/MASCORE-12745
MASCORE-13410 https://jsw.ibm.com/browse/MASCORE-13410
MASCORE-13462 https://jsw.ibm.com/browse/MASCORE-13462

Problem: The AIService operator subscription's installPlanApproval field was hardcoded as "Automatic" in the GitOps templates. This prevented users from controlling whether operator updates require manual approval or install automatically.

Requirement: Add CLI parameter support for configurable --aiservice-install-plan-approval flag, allowing users to specify install plan approval strategy and pass it to GitOps templates.

Why these changes are needed:

CLI needs to accept install plan approval parameter from Tekton pipeline
Parameter must be passed to GitOps templates for Kubernetes Subscription configuration
Enables teams to control operator upgrade behavior per environment (Manual for production, Automatic for dev/test)
Provides default value "Automatic" for backward compatibility
Completes the parameter flow: saas-envs → Tekton → CLI → GitOps → Kubernetes

What was changed:

This PR adds comprehensive CLI parameter support for the AIService operator install plan approval setting across bash functions, Python argument parsers, and Jinja templates.

Changes made:

File 1: image/cli/mascli/functions/gitops_aiservice

Line 37 - Added parameter to help text:

--aiservice-install-plan-approval ${TEXT_RESET}AISERVICE_INSTALL_PLAN_APPROVAL${TEXT_RESET} 

Line 91 - Added default value:

export AISERVICE_INSTALL_PLAN_APPROVAL=${AISERVICE_INSTALL_PLAN_APPROVAL:-"Automatic"} 

Lines 178-180 - Added parameter parsing:

--aiservice-install-plan-approval) 
  export AISERVICE_INSTALL_PLAN_APPROVAL=$1 && shift 
;; 

Line 355 - Added parameter display in summary:

echo_reset_dim "AIService Install Plan Approval ........ ${COLOR_MAGENTA}${AISERVICE_INSTALL_PLAN_APPROVAL}" 

File 2: image/cli/mascli/templates/gitops/appset-configs/cluster/instance/ibm-aiservice.yaml.j2

Lines 48-49 - Added template variable:

aiservice_channel: "{{ AISERVICE_CHANNEL }}" aiservice_install_plan_approval: "{{ AISERVICE_INSTALL_PLAN_APPROVAL }}" 

File 3: python/src/mas/cli/aiservice/install/argBuilder.py

Lines 83-85 - Added parameter to command builder:

if self.getParam('aiservice_install_plan_approval') != "": 
            command += f" --aiservice-install-plan-approval \"{self.getParam('aiservice_install_plan_approval')}\"{newline}" 

File 4: python/src/mas/cli/aiservice/install/argParser.py

Lines 176-184 - Added argument parser:

masAppsArgGroup.add_argument( 
     "--aiservice-install-plan-approval", 
      dest="aiservice_install_plan_approval", 
      required=False, default="Automatic", 
      choices=["Automatic", "Manual"], 
      help="Install plan approval for AI Service operator subscription" 
) 

File 5: python/src/mas/cli/aiservice/install/params.py

Line 113 - Added parameter to params list:

"aiservice_install_plan_approval", 

File 6: python/src/mas/cli/install/argBuilder.py

Lines 344-346 - Added parameter to install command builder:

if self.getParam('aiservice_install_plan_approval') != "": 
        command += f" --aiservice-install-plan-approval \"{self.getParam('aiservice_install_plan_approval')}\"{newline}" 

File 7: python/src/mas/cli/install/argParser.py

Lines 532-540 - Added argument parser for install command:

masAppsArgGroup.add_argument( 
       "--aiservice-install-plan-approval", 
       dest="aiservice_install_plan_approval", 
       required=False, default="Automatic", 
       choices=["Automatic", "Manual"], 
       help="Install plan approval for AI Service operator subscription" 
) 

File 8: python/src/mas/cli/install/params.py

Line 221 - Added parameter to install params list:

"aiservice_install_plan_approval", 

File 9: tekton/src/params/install-aiservice.yml.j2

Lines 19-23 - Added Tekton parameter definition:

 name: aiservice_install_plan_approval 
type: string 
description: Install plan approval strategy for AIService operator (Manual or Automatic) 
default: "Automatic" 

Impact:

✅ CLI accepts --aiservice-install-plan-approval parameter
✅ Only accepts "Automatic" or "Manual" values (enforced by argparse choices)
✅ Parameter flows to GitOps templates via environment variable AISERVICE_INSTALL_PLAN_APPROVAL
✅ Default value "Automatic" ensures backward compatibility
✅ Enables Manual or Automatic operator upgrade control per environment
✅ No breaking changes to existing CLI usage

Testing performed:

CLI Parameter Testing:

✅ Validated parameter parsing in bash function
✅ Confirmed parameter validation in Python argparse (accepts only "Automatic" or "Manual")
✅ Verified default value "Automatic" is set correctly
✅ Tested parameter passing to GitOps template

Deployment Verification:

✅ Deployed to noble8 ArgoCD cluster
✅ CLI command with --aiservice-install-plan-approval "Manual" executed successfully
✅ CLI command with --aiservice-install-plan-approval "Automatic" executed successfully
✅ GitOps configuration generated with correct aiservice_install_plan_approval value

Test Results:

✅ Parameter accepted by CLI
✅ Accepts valid values ("Manual", "Automatic")
✅ Rejects invalid values with error message
✅ Template renders correctly with parameter value
✅ Deployment to noble8 cluster successful

Related Pull Requests:

This change is part of a multi-repository feature implementation for MASCORE-12745:

saas-envs-starter: PR#158 - Added prompts and template parameters for install plan configuration
saas-deploy-py: PR#266 - Added JSON schema validation for aiservice_install_plan_approval field
saas-tekton: PR #223 - Added Tekton pipeline support for aiservice_install_plan_approval parameter
ibm-mas/gitops: PR #447 -Added configurable install plan approval for AIService operator

Copy link
Copy Markdown
Contributor

@mnivedithaa mnivedithaa left a comment

Choose a reason for hiding this comment

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

Please cleanup the commented lines, resolve the conflicts.
Also you need to update gitops_aiservice pipeline and task changes here as well (changes done in saas-tekton)




masAppsArgGroup.add_argument(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this arg required for cli?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes, This accepts and validates user input.
Without this, the CLI won't recognize the --aiservice-install-plan-approval flag

@@ -343,6 +340,11 @@ def buildCommand(self) -> str:
if self.getParam('aiservice_channel') != "":
command += f" --aiservice-channel \"{self.getParam('aiservice_channel')}\"{newline}"


if self.getParam('aiservice_install_plan_approval') != "":
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this arg required for cli?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes, this passes the parameter to the gitops-aiservice function.
Without this, the parameter is accepted but never used

Copy link
Copy Markdown
Member

@whitfiea whitfiea left a comment

Choose a reason for hiding this comment

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

Please see comments.

Also I would expect that the aiservice-tenant would have the same setting as I thought was was now a subscription itself? I don't think it would make sense to have the aiservice as manual and the aiservice-tenant has automatic

--aiservice-channel ${TEXT_RESET}AISERVICE_CHANNEL${TEXT_RESET}
--mas-catalog-source ${TEXT_RESET}MAS_CATALOG_SOURCE${TEXT_RESET}

--aiservice-install-plan-approval ${TEXT_RESET}AISERVICE_INSTALL_PLAN_APPROVAL${TEXT_RESET}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this should be under ibm aiservice(required): lines 23:26

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I’ve updated the code and placed it under ibm aiservice (required)

Comment on lines +49 to +53





Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why all the whitespace?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I’ve cleaned up the unnecessary whitespace.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Everything under the python package is used for the non-gitops cli installer, if we are not making changes for the non-gitops then we shouldn't have any changes under this python folder.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This shouldn't be needed if this is gitops only

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.

4 participants