Skip to content

[master] MGMT-20727: Cisco Intersight URL should be configurable#3332

Merged
openshift-merge-bot[bot] merged 4 commits intoopenshift-assisted:masterfrom
openshift-cherrypick-robot:cherry-pick-3282-to-master
Dec 18, 2025
Merged

[master] MGMT-20727: Cisco Intersight URL should be configurable#3332
openshift-merge-bot[bot] merged 4 commits intoopenshift-assisted:masterfrom
openshift-cherrypick-robot:cherry-pick-3282-to-master

Conversation

@openshift-cherrypick-robot
Copy link
Contributor

@openshift-cherrypick-robot openshift-cherrypick-robot commented Dec 18, 2025

This is an automated cherry-pick of #3282

/assign jgyselov

Summary by CodeRabbit

Release Notes

  • New Features

    • Added support for configuring a custom Cisco Intersight URL during cluster configuration setup.
    • Improved form validation with real-time feedback for storage sizes and Cisco Intersight URL format.
  • Bug Fixes

    • Removed duplicate localization entry for URL configuration guidance.
  • Refactor

    • Restructured configuration form components for better modularity and maintainability.
    • Enhanced form state management with improved error handling and validation workflows.

✏️ Tip: You can customize this high-level summary in your review settings.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Dec 18, 2025

@openshift-cherrypick-robot: Ignoring requests to cherry-pick non-bug issues: MGMT-20727

Details

In response to this:

This is an automated cherry-pick of #3282

/assign jgyselov

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai
Copy link

coderabbitai bot commented Dec 18, 2025

Walkthrough

This PR refactors the CIM configuration modal to use Formik for form state management instead of direct React state, while introducing Cisco Intersight URL configuration support. Changes include replacing the monolithic CimConfigurationForm with a Formik-based CimConfigurationFormFields component, updating persist.ts to use dynamic-plugin-sdk k8s operations instead of passed-in helper functions, adding localization entries for Cisco Intersight validation, and defining new K8sModel exports. The old resources.ts type definitions are removed in favor of SDK-based models.

Changes

Cohort / File(s) Summary
Localization
libs/locales/lib/en/translation.json
Added new translation keys for Cisco Intersight URL configuration, validation messages, and custom URL setup guidance. Removed obsolete error entry for AgentServiceConfig updates.
CIM Modal Refactoring
libs/ui-lib/lib/cim/components/modals/CimConfiguration/CimConfigurationModal.tsx, CimConfigurationFormFields.tsx (new), CimConfigurationForm.tsx (deleted), types.ts
Replaced stateful modal with Formik-driven form flow using Yup schema validation. Introduced CimConfigurationFormFields component. Updated types: CimConfiguratioProps → CimConfigurationValues, CimConfigurationFormProps → CimConfigurationFormFieldsProps. Added Cisco URL and checkbox support.
Persistence Layer Refactoring
libs/ui-lib/lib/cim/components/modals/CimConfiguration/persist.ts
Refactored resource operations from passed-in helper functions to direct dynamic-plugin-sdk k8s calls (k8sListItems, k8sGet, k8sCreate, k8sPatch). Updated function signatures to remove resource operation dependencies. Added ciscoIntersightURL parameter to createAgentServiceConfig.
K8s Model Definitions
libs/ui-lib/lib/cim/types/models.tsx
Added new public K8sModel exports: AgentServiceConfigModel, RouteModel, ProvisioningModel. Extended AgentClusterInstallModel with apiVersion, apiGroup, and namespaced fields.
Type System Cleanup
libs/ui-lib/lib/cim/types/resources.ts (deleted), libs/ui-lib/lib/cim/types/index.ts
Removed resources.ts containing ResourceType, resource operation function types, and convertOCPtoCIMResourceHeader. Removed re-export of resources from types/index.ts.
CSS Updates
libs/ui-lib/lib/cim/components/modals/CimConfiguration/CimConfigurationForm.css, CimConfigurationModal.css
Removed multiple CSS rules including font-size, whitespace, margin, width, and overflow declarations.
Hooks
libs/ui-lib/lib/cim/hooks/useAgentServiceConfig.tsx (new), libs/ui-lib/lib/cim/hooks/index.tsx
Added new useAgentServiceConfig hook wrapping useK8sWatchResource for AgentServiceConfig CRD. Updated hooks/index.tsx to export the new hook.
Modal Integration
libs/ui-lib/lib/cim/components/modals/AddHostModal.tsx
Added useAgentServiceConfig hook integration. Computed ciscoUrl from agent service config metadata annotations. Passed ciscoUrl to DiscoveryImageConfigForm and GeneratingIsoDownload components.
Common UI Components
libs/ui-lib/lib/common/components/ui/formik/InputField.tsx, types.ts, DownloadIso.tsx, docs_links.ts
Updated InputField with type prop (default 'text'). Changed InputFieldProps type from TextInputTypes to TextInputProps['type']. Added optional ciscoUrl prop to DownloadIso and getCiscoIntersightLink with branching logic.

Sequence Diagram

sequenceDiagram
    actor User
    participant Modal as CimConfigurationModal
    participant Formik
    participant Form as CimConfigurationFormFields
    participant K8s as K8s SDK Operations
    participant Cluster as OpenShift Cluster

    User->>Modal: Open CIM Configuration
    Modal->>K8s: Load AgentServiceConfig
    K8s->>Cluster: k8sGet AgentServiceConfig
    Cluster-->>K8s: Resource data + Cisco URL annotation
    K8s-->>Modal: Resource loaded
    Modal->>Form: Initialize Formik with values
    Note over Formik: Storage sizes, LoadBalancer config,<br/>Cisco Intersight URL fields
    Form->>User: Display form with Cisco URL option
    
    User->>Form: Fill form & enable Cisco URL
    Form->>Formik: Update values (addCiscoIntersightUrl=true)
    Formik->>Formik: Validate schema (URL format, sizes)
    
    alt Validation Success
        Formik->>Form: Valid state
        Form->>User: Enable Submit button
        User->>Modal: Click Submit
        Modal->>K8s: onEnableCIM(values)
        
        rect rgb(200, 220, 255)
            Note over K8s: Create/Patch resources with Cisco URL
            K8s->>Cluster: k8sCreate IngressController
            K8s->>Cluster: k8sPatch Route + Provisioning
            K8s->>Cluster: k8sCreate AgentServiceConfig<br/>(with ciscoIntersightURL annotation)
        end
        
        Cluster-->>K8s: Resources created/updated
        K8s-->>Modal: Success
        Modal->>User: Close modal
    else Validation Error
        Formik->>Form: Invalid state with error messages
        Form->>User: Display error indicators
        User->>Form: Correct input
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Areas requiring extra attention:

  • persist.ts: Complex refactoring of six function signatures with changed resource operation patterns and new SDK integration. Verify error handling and conditional flows remain correct.
  • CimConfigurationModal.tsx: New Formik integration with validation schema and submission lifecycle. Check Yup schema completeness, state management transitions, and error propagation.
  • Type system changes: Propagation of renamed types (CimConfiguratioProps → CimConfigurationValues, etc.) and removal of resource operation types. Verify all consuming code updated correctly.
  • CimConfigurationFormFields.tsx: New component with Formik context consumption and async initialization effects. Validate form field binding and conditional rendering logic.
  • K8s model additions: Verify new model definitions match actual CRD schemas and namespacing rules.

Possibly related PRs

Suggested labels

lgtm, approved, size/XXL, jira/valid-reference

Suggested reviewers

  • jgyselov
  • ammont82
  • batzionb

Poem

🐰 A form takes shape with Formik's grace,
Cisco URLs find their rightful place,
SDK calls replace the old dance,
State management gets its second chance,
Validation schemas guard the way—
Configuration reborn today! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: making the Cisco Intersight URL configurable, which aligns with the extensive changes throughout the codebase to support custom Cisco Intersight URL configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Dec 18, 2025
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Dec 18, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Dec 18, 2025

@openshift-cherrypick-robot: This pull request references MGMT-20727 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

This is an automated cherry-pick of #3282

/assign jgyselov

Summary by CodeRabbit

Release Notes

  • New Features

  • Added support for configuring a custom Cisco Intersight URL during cluster configuration setup.

  • Improved form validation with real-time feedback for storage sizes and Cisco Intersight URL format.

  • Bug Fixes

  • Removed duplicate localization entry for URL configuration guidance.

  • Refactor

  • Restructured configuration form components for better modularity and maintainability.

  • Enhanced form state management with improved error handling and validation workflows.

✏️ Tip: You can customize this high-level summary in your review settings.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
libs/ui-lib/lib/common/config/docs_links.ts (1)

150-155: URL-encode the downloadIsoUrl query parameter for special character safety.

The ciscoUrl parameter is validated at the form level in CimConfigurationModal.tsx using parseUrl() to ensure it starts with http:// or https://, and this validation occurs before persistence to the Kubernetes annotation, so that concern is already addressed.

However, the downloadIsoUrl parameter should be URL-encoded in the query string to safely handle special characters:

return `${ciscoUrl}?_workflow_Version=1&IsoUrl=${encodeURIComponent(downloadIsoUrl)}`;

Apply this to both branches of the function.

libs/ui-lib/lib/cim/components/modals/CimConfiguration/CimConfigurationFormFields.tsx (1)

39-58: Consider adding missing dependencies or documenting the rationale.

The useEffect disables react-hooks/exhaustive-deps but omits isEdit, setFieldValue, and setConfigureLoadBalancerInitial from the dependency array. While setFieldValue from Formik is typically stable, the others could potentially cause stale closure issues if they change.

If these are intentionally omitted because:

  1. isEdit is constant for the component's lifetime
  2. setConfigureLoadBalancerInitial is a stable setter

Consider adding a brief comment explaining why, or include them in the dependency array to be safe.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f5603e6 and 7e33700.

📒 Files selected for processing (18)
  • libs/locales/lib/en/translation.json (3 hunks)
  • libs/ui-lib/lib/cim/components/modals/AddHostModal.tsx (5 hunks)
  • libs/ui-lib/lib/cim/components/modals/CimConfiguration/CimConfigurationForm.css (0 hunks)
  • libs/ui-lib/lib/cim/components/modals/CimConfiguration/CimConfigurationForm.tsx (0 hunks)
  • libs/ui-lib/lib/cim/components/modals/CimConfiguration/CimConfigurationFormFields.tsx (1 hunks)
  • libs/ui-lib/lib/cim/components/modals/CimConfiguration/CimConfigurationModal.css (0 hunks)
  • libs/ui-lib/lib/cim/components/modals/CimConfiguration/CimConfigurationModal.tsx (2 hunks)
  • libs/ui-lib/lib/cim/components/modals/CimConfiguration/persist.ts (14 hunks)
  • libs/ui-lib/lib/cim/components/modals/CimConfiguration/types.ts (1 hunks)
  • libs/ui-lib/lib/cim/hooks/index.tsx (1 hunks)
  • libs/ui-lib/lib/cim/hooks/useAgentServiceConfig.tsx (1 hunks)
  • libs/ui-lib/lib/cim/types/index.ts (0 hunks)
  • libs/ui-lib/lib/cim/types/models.tsx (1 hunks)
  • libs/ui-lib/lib/cim/types/resources.ts (0 hunks)
  • libs/ui-lib/lib/common/components/clusterConfiguration/DownloadIso.tsx (2 hunks)
  • libs/ui-lib/lib/common/components/ui/formik/InputField.tsx (2 hunks)
  • libs/ui-lib/lib/common/components/ui/formik/types.ts (2 hunks)
  • libs/ui-lib/lib/common/config/docs_links.ts (1 hunks)
💤 Files with no reviewable changes (5)
  • libs/ui-lib/lib/cim/types/index.ts
  • libs/ui-lib/lib/cim/components/modals/CimConfiguration/CimConfigurationForm.css
  • libs/ui-lib/lib/cim/components/modals/CimConfiguration/CimConfigurationModal.css
  • libs/ui-lib/lib/cim/types/resources.ts
  • libs/ui-lib/lib/cim/components/modals/CimConfiguration/CimConfigurationForm.tsx
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: linoyaslan
Repo: openshift-assisted/assisted-installer-ui PR: 3190
File: libs/ui-lib/lib/ocm/components/clusterConfiguration/networkConfiguration/networkConfigurationValidation.ts:69-69
Timestamp: 2025-10-19T17:22:52.502Z
Learning: CIM UI changes in the repository openshift-assisted/assisted-installer-ui (e.g., files under libs/ui-lib/lib/cim/) are handled separately by the CIM team and should be tracked via separate issues rather than being included in PRs for other UI components.
📚 Learning: 2025-10-19T17:22:52.502Z
Learnt from: linoyaslan
Repo: openshift-assisted/assisted-installer-ui PR: 3190
File: libs/ui-lib/lib/ocm/components/clusterConfiguration/networkConfiguration/networkConfigurationValidation.ts:69-69
Timestamp: 2025-10-19T17:22:52.502Z
Learning: CIM UI changes in the repository openshift-assisted/assisted-installer-ui (e.g., files under libs/ui-lib/lib/cim/) are handled separately by the CIM team and should be tracked via separate issues rather than being included in PRs for other UI components.

Applied to files:

  • libs/ui-lib/lib/cim/components/modals/CimConfiguration/CimConfigurationFormFields.tsx
  • libs/ui-lib/lib/cim/components/modals/CimConfiguration/CimConfigurationModal.tsx
  • libs/ui-lib/lib/cim/components/modals/CimConfiguration/persist.ts
📚 Learning: 2025-10-21T04:40:36.292Z
Learnt from: linoyaslan
Repo: openshift-assisted/assisted-installer-ui PR: 3190
File: libs/ui-lib/lib/ocm/components/clusterConfiguration/networkConfiguration/AdvancedNetworkFields.tsx:55-63
Timestamp: 2025-10-21T04:40:36.292Z
Learning: In libs/ui-lib/lib/ocm/components/clusterConfiguration/networkConfiguration/AdvancedNetworkFields.tsx, the network reordering logic in the useEffect (swapping clusterNetworks and serviceNetworks based on the primary machine network's IP family) is for UI consistency only. Validation of empty or invalid CIDRs is handled separately by validation schemas, not by the reordering logic.

Applied to files:

  • libs/ui-lib/lib/cim/components/modals/CimConfiguration/CimConfigurationFormFields.tsx
📚 Learning: 2025-08-11T06:07:38.056Z
Learnt from: ammont82
Repo: openshift-assisted/assisted-installer-ui PR: 3101
File: libs/ui-lib/lib/common/config/docs_links.ts:203-221
Timestamp: 2025-08-11T06:07:38.056Z
Learning: The MetalLB, OADP, Cluster Observability, and NUMA Resources operators in the virtualization bundle don't require version fallback logic in their documentation link functions (getMetalLbLink, getOadpLink, getClusterObservabilityLink, getNumaResourcesLink) in libs/ui-lib/lib/common/config/docs_links.ts, unlike some other operators like LSO and NVIDIA GPU.

Applied to files:

  • libs/ui-lib/lib/common/config/docs_links.ts
📚 Learning: 2025-12-17T09:08:07.992Z
Learnt from: jgyselov
Repo: openshift-assisted/assisted-installer-ui PR: 3319
File: libs/ui-lib/lib/cim/components/helpers/toAssisted.ts:199-201
Timestamp: 2025-12-17T09:08:07.992Z
Learning: In libs/ui-lib/lib/cim/components/helpers/toAssisted.ts, the platformType field on agentClusterInstall.spec is guaranteed to always contain a valid PlatformType value (when lowercased), making the type assertion safe without additional runtime validation.

Applied to files:

  • libs/ui-lib/lib/cim/types/models.tsx
🧬 Code graph analysis (4)
libs/ui-lib/lib/cim/hooks/useAgentServiceConfig.tsx (3)
libs/ui-lib/lib/cim/hooks/types.tsx (1)
  • K8sWatchHookProps (8-8)
libs/ui-lib/lib/cim/hooks/useK8sWatchResource.tsx (1)
  • useK8sWatchResource (13-27)
libs/ui-lib/lib/cim/types/k8s/agent-service-config.ts (1)
  • AgentServiceConfigK8sResource (23-33)
libs/ui-lib/lib/cim/components/modals/CimConfiguration/CimConfigurationFormFields.tsx (3)
libs/ui-lib/lib/cim/components/modals/CimConfiguration/types.ts (2)
  • CimConfigurationFormFieldsProps (17-25)
  • CimConfigurationValues (3-10)
libs/ui-lib/lib/common/hooks/index.ts (1)
  • useTranslation (3-3)
libs/ui-lib/lib/cim/components/modals/CimConfiguration/persist.ts (1)
  • isIngressController (134-146)
libs/ui-lib/lib/cim/components/modals/AddHostModal.tsx (3)
libs/ui-lib/lib/common/hooks/index.ts (1)
  • useTranslation (3-3)
libs/ui-lib/lib/cim/hooks/useAgentServiceConfig.tsx (1)
  • useAgentServiceConfig (5-15)
libs/ui-lib/lib/cim/types/k8s/infra-env-k8s-resource.ts (1)
  • InfraEnvK8sResource (8-42)
libs/ui-lib/lib/cim/components/modals/CimConfiguration/persist.ts (1)
libs/ui-lib/lib/cim/types/models.tsx (4)
  • RouteModel (36-45)
  • IngressControllerModel (25-34)
  • ProvisioningModel (47-56)
  • AgentServiceConfigModel (14-23)
🪛 Biome (2.1.2)
libs/ui-lib/lib/cim/components/modals/CimConfiguration/CimConfigurationModal.tsx

[error] 105-105: Do not add then to an object.

(lint/suspicious/noThenProperty)

🔇 Additional comments (24)
libs/ui-lib/lib/common/components/ui/formik/types.ts (1)

8-8: LGTM: Type refinement aligns with PatternFly API.

The change from TextInputTypes to TextInputProps['type'] improves type accuracy by directly referencing the PatternFly library's type definition.

Also applies to: 67-67

libs/locales/lib/en/translation.json (1)

161-163: LGTM: Localization entries follow established patterns.

The new Cisco Intersight URL localization keys follow the same validation message pattern as existing URL fields (e.g., Tang Server URL at line 816).

libs/ui-lib/lib/common/components/clusterConfiguration/DownloadIso.tsx (1)

25-25: LGTM: Clean integration of optional Cisco URL parameter.

The optional ciscoUrl prop is properly threaded through to the link construction function with appropriate fallback behavior when undefined.

Also applies to: 41-41, 48-48

libs/ui-lib/lib/cim/hooks/index.tsx (1)

2-2: LGTM: Standard export addition.

libs/ui-lib/lib/cim/hooks/useAgentServiceConfig.tsx (1)

5-15: LGTM: Clean hook implementation following established patterns.

The hook properly configures Kubernetes resource watching for AgentServiceConfig with correct GVK and type safety.

libs/ui-lib/lib/common/components/ui/formik/InputField.tsx (2)

35-35: LGTM: Input type prop enables field type flexibility.

Adding the type prop with a default value of 'text' maintains backward compatibility while enabling different input types (url, password, email, etc.) needed for fields like the new Cisco Intersight URL input.

Also applies to: 84-84


92-105: LGTM: Improved error and helper text rendering.

Separating error and helper text into distinct HelperTextItem components improves clarity and follows PatternFly's recommended pattern for form field feedback.

libs/ui-lib/lib/cim/components/modals/CimConfiguration/types.ts (2)

8-9: URL validation for ciscoIntersightURL field is correctly implemented.

The ciscoIntersightURL field includes proper runtime validation in CimConfigurationModal.tsx (lines 103–120) that ensures the URL is required when addCiscoIntersightUrl is enabled and validates that it starts with "http://" or "https://" using the parseUrl utility.


3-10: No API updates required—all type changes are correctly implemented.

All consumers of CimConfiguration types have already been updated to use the new type signatures. The codebase contains zero references to the old type names (CimConfiguratioProps, CimConfigurationFormProps) or the removed resource operation props (createResource, getResource, listResources, patchResource). Components correctly use the new types: CimConfigurationValues, CimConfigurationFormFieldsProps, and CimConfigurationModalProps.

Likely an incorrect or invalid review comment.

libs/ui-lib/lib/cim/components/modals/AddHostModal.tsx (2)

30-35: Verify the annotation key matches the persist.ts usage.

The annotation key 'ciscoIntersightURL' is used here to read the Cisco URL. Ensure this matches the key used when creating the AgentServiceConfig in persist.ts (line 291), which also uses ciscoIntersightURL. The keys appear consistent.

The conditional loaded && !error correctly guards against accessing properties before the resource is loaded or when there's an error.


106-136: LGTM!

The GeneratingIsoDownload component correctly accepts the optional ciscoUrl prop and forwards it to DownloadIso. The type annotation is appropriate.

libs/ui-lib/lib/cim/components/modals/CimConfiguration/CimConfigurationFormFields.tsx (2)

224-255: LGTM!

The Cisco Intersight URL configuration section is well-implemented:

  • Checkbox controls conditional visibility of the URL input
  • Both fields are correctly disabled in edit mode (isEdit)
  • The placeholder provides a helpful example URL
  • isRequired aligns with the validation schema in the modal

60-191: LGTM!

The form structure is well-organized with:

  • Consistent PatternFly component usage
  • Proper accessibility attributes (aria-label on popovers)
  • Secure external links (rel="noreferrer" with target="_blank")
  • Storage fields correctly disabled in edit mode to prevent post-configuration changes
libs/ui-lib/lib/cim/types/models.tsx (2)

14-23: LGTM!

The AgentServiceConfigModel is correctly defined as cluster-scoped (namespaced: false), which aligns with the Kubernetes CRD for AgentServiceConfig in the agent-install.openshift.io API group.


47-56: ProvisioningModel is correctly configured as cluster-scoped.

The model is correctly defined with namespaced: false for the metal3.io/v1alpha1 Provisioning resource, which is a singleton cluster-wide resource. Codebase usage confirms this configuration—operations fetch and patch the resource by name without a namespace.

libs/ui-lib/lib/cim/components/modals/CimConfiguration/CimConfigurationModal.tsx (4)

98-121: Static analysis false positive - Yup's conditional validation API is correct.

The Biome linter flags line 105 with "Do not add then to an object" (noThenProperty). This is a false positive because Yup's .when() API uses then as a method name for conditional schema definitions, not as a Promise-like thenable property. This is the standard Yup pattern for conditional validation.

The validation schema correctly:

  • Validates storage sizes with minimum values
  • Conditionally requires ciscoIntersightURL when addCiscoIntersightUrl is true
  • Validates URL format using parseUrl to ensure http:// or https:// protocol

43-71: LGTM!

The onConfigure handler correctly:

  • Resets error state and sets submitting before the async operation
  • Conditionally passes ciscoIntersightURL only when the checkbox is enabled
  • Closes modal on success, keeps it open with error on failure
  • Properly resets isSubmitting via Formik helpers on failure

80-96: LGTM!

The initialValues correctly:

  • Provides sensible defaults (10Gi, 100Gi, 50Gi) when creating new config
  • Reads existing values from agentServiceConfig when editing
  • Derives addCiscoIntersightUrl from annotation presence using !! coercion
  • Uses consistent annotation key 'ciscoIntersightURL'

138-151: Consider if button should be disabled when no changes are made in edit mode.

The Configure button disable logic checks isEdit && configureLoadBalancerInitial === values.configureLoadBalancer, which only tracks load balancer changes. Since Cisco Intersight fields are disabled in edit mode (isDisabled={isEdit} in form fields), this is currently correct—the only editable field in edit mode is the load balancer checkbox.

However, if future edits allow more fields to be modified, this logic would need updating.

libs/ui-lib/lib/cim/components/modals/CimConfiguration/persist.ts (5)

1-19: LGTM!

The import restructuring to use @openshift-console/dynamic-plugin-sdk operations (k8sCreate, k8sGet, k8sListItems, k8sPatch) with locally-defined models provides a cleaner, more consistent approach to Kubernetes resource operations.


253-298: LGTM!

The createAgentServiceConfig function correctly handles the optional ciscoIntersightURL:

  • Initializes with an empty annotations object (safe for K8s)
  • Conditionally merges the annotation only when ciscoIntersightURL is provided
  • Uses the consistent annotation key ciscoIntersightURL
  • Properly uses AgentServiceConfigModel for the SDK create operation

134-146: LGTM!

The isIngressController function is cleanly refactored to use model-based SDK operations. The catch-all returning false is appropriate for an existence check—if the resource doesn't exist or there's any error accessing it, we treat it as "not present."


198-234: LGTM!

The patchProvisioningConfiguration function correctly:

  • Uses k8sGet without namespace (appropriate for cluster-scoped Provisioning resource)
  • Dynamically determines op: 'add' | 'replace' based on existing field presence
  • Treats errors as warnings (AlertVariant.warning) rather than blocking errors, allowing CIM setup to proceed

311-355: LGTM!

The onEnableCIM function is cleanly refactored:

  • Accepts optional ciscoIntersightURL and passes it through to createAgentServiceConfig
  • Simplified signature by removing resource-helper function parameters
  • Internal calls now use the model-based SDK operations directly
  • Maintains existing conditional logic for platform-specific provisioning configuration

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 18, 2025
@openshift-ci
Copy link

openshift-ci bot commented Dec 18, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jgyselov, openshift-cherrypick-robot

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

The pull request process is described here

Details 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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 18, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit 60b2e0f into openshift-assisted:master Dec 18, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants