@openshift-assisted/ui-lib 2.52.1 → 2.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentWizard.d.ts +1 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentWizard.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/NetworkConfiguration.d.ts +1 -1
- package/build/@types/cim/components/ClusterDeployment/NetworkConfiguration.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/customManifests/ClusterDeploymentCustomManifestsStep.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/networkConfigurationValidation.d.ts +1 -1
- package/build/@types/cim/components/ClusterDeployment/networkConfigurationValidation.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/networking/NetworkTypeDropdown.d.ts +5 -0
- package/build/@types/cim/components/ClusterDeployment/networking/NetworkTypeDropdown.d.ts.map +1 -0
- package/build/@types/cim/components/ClusterDeployment/review/ClusterDeploymentReviewStep.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/types.d.ts +0 -1
- package/build/@types/cim/components/ClusterDeployment/types.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/use-networking-formik.d.ts +4 -4
- package/build/@types/cim/components/ClusterDeployment/use-networking-formik.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/wizardTransition.d.ts.map +1 -1
- package/build/@types/cim/components/featureSupportLevels/ACMFeatureSupportLevelProvider.d.ts.map +1 -1
- package/build/@types/cim/components/helpers/clusterDeployment.d.ts.map +1 -1
- package/build/@types/cim/components/helpers/versions.d.ts +2 -2
- package/build/@types/cim/components/helpers/versions.d.ts.map +1 -1
- package/build/@types/cim/components/helpers/versions.test.d.ts +2 -0
- package/build/@types/cim/components/helpers/versions.test.d.ts.map +1 -0
- package/build/@types/cim/components/modals/CimConfiguration/CimConfigurationModal.d.ts.map +1 -1
- package/build/@types/cim/components/modals/CimConfiguration/persist.d.ts +14 -17
- package/build/@types/cim/components/modals/CimConfiguration/persist.d.ts.map +1 -1
- package/build/@types/cim/hooks/index.d.ts +1 -0
- package/build/@types/cim/hooks/index.d.ts.map +1 -1
- package/build/@types/cim/hooks/useAgents.d.ts +4 -0
- package/build/@types/cim/hooks/useAgents.d.ts.map +1 -0
- package/build/@types/cim/types/k8s/agent-cluster-install.d.ts +1 -1
- package/build/@types/cim/types/k8s/agent-cluster-install.d.ts.map +1 -1
- package/build/@types/common/components/clusterDetail/ClusterCredentials.d.ts.map +1 -1
- package/build/@types/common/components/clusterDetail/ConsoleModal.d.ts +0 -5
- package/build/@types/common/components/clusterDetail/ConsoleModal.d.ts.map +1 -1
- package/build/@types/common/components/clusterWizard/customManifests/CustomManifestsAlert.d.ts +6 -0
- package/build/@types/common/components/clusterWizard/customManifests/CustomManifestsAlert.d.ts.map +1 -0
- package/build/@types/common/components/clusterWizard/customManifests/index.d.ts +2 -0
- package/build/@types/common/components/clusterWizard/customManifests/index.d.ts.map +1 -0
- package/build/@types/common/components/clusterWizard/index.d.ts +2 -0
- package/build/@types/common/components/clusterWizard/index.d.ts.map +1 -1
- package/build/@types/common/components/clusterWizard/networkingSteps/AvailableSubnetsControl.d.ts +2 -1
- package/build/@types/common/components/clusterWizard/networkingSteps/AvailableSubnetsControl.d.ts.map +1 -1
- package/build/@types/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.d.ts +2 -1
- package/build/@types/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.d.ts.map +1 -1
- package/build/@types/common/components/clusterWizard/networkingSteps/ThirdPartyCNIBanner.d.ts +3 -0
- package/build/@types/common/components/clusterWizard/networkingSteps/ThirdPartyCNIBanner.d.ts.map +1 -0
- package/build/@types/common/components/clusterWizard/networkingSteps/index.d.ts +1 -0
- package/build/@types/common/components/clusterWizard/networkingSteps/index.d.ts.map +1 -1
- package/build/@types/common/components/clusters/PullSecret.d.ts +0 -1
- package/build/@types/common/components/clusters/PullSecret.d.ts.map +1 -1
- package/build/@types/common/components/hosts/HostsTable.d.ts.map +1 -1
- package/build/@types/common/components/ui/WizardFooter.d.ts +1 -0
- package/build/@types/common/components/ui/WizardFooter.d.ts.map +1 -1
- package/build/@types/common/components/ui/formik/utils.d.ts +1 -0
- package/build/@types/common/components/ui/formik/utils.d.ts.map +1 -1
- package/build/@types/common/config/constants.d.ts +2 -2
- package/build/@types/common/config/constants.d.ts.map +1 -1
- package/build/@types/common/types/networkType.d.ts +2 -1
- package/build/@types/common/types/networkType.d.ts.map +1 -1
- package/build/@types/common/validationSchemas/networkingValidation.d.ts +10 -0
- package/build/@types/common/validationSchemas/networkingValidation.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/ControlPlaneNodesDropdown.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/OcmClusterDetailsFormFields.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/manifestsConfiguration/CustomManifestsPage.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/networkConfigurationValidation.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/review/ReviewNetworkingTable.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/review/ReviewSummary.d.ts.map +1 -1
- package/build/@types/ocm/components/{clusterDetail/ClusterProperties.d.ts → clusterConfiguration/review/utils.d.ts} +1 -8
- package/build/@types/ocm/components/clusterConfiguration/review/utils.d.ts.map +1 -0
- package/build/@types/ocm/components/clusterConfiguration/review/utils.test.d.ts +2 -0
- package/build/@types/ocm/components/clusterConfiguration/review/utils.test.d.ts.map +1 -0
- package/build/@types/ocm/components/clusterConfiguration/staticIp/data/formDataToInfraEnvField.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/staticIp/data/nmstateTypes.d.ts +1 -0
- package/build/@types/ocm/components/clusterConfiguration/staticIp/data/nmstateTypes.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/staticIp/data/nmstateYaml.d.ts +1 -1
- package/build/@types/ocm/components/clusterConfiguration/staticIp/data/nmstateYaml.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterDetail/ClusterDetailsButtonGroup.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterDetail/index.d.ts +0 -1
- package/build/@types/ocm/components/clusterDetail/index.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/ClusterDetailsForm.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/HostDiscovery.d.ts.map +1 -1
- package/build/@types/ocm/components/clusters/AssistedInstallerHeader.d.ts +5 -1
- package/build/@types/ocm/components/clusters/AssistedInstallerHeader.d.ts.map +1 -1
- package/build/@types/ocm/components/clusters/ClustersTable.d.ts.map +1 -1
- package/build/@types/ocm/components/hosts/HostsTableEmptyState.d.ts.map +1 -1
- package/build/@types/ocm/hooks/useClusterCustomManifests.d.ts.map +1 -1
- package/build/@types/ocm/hooks/useLateBinding.d.ts.map +1 -1
- package/build/@types/ocm/hooks/useUISettings.d.ts.map +1 -1
- package/build/@types/ocm/services/ClusterDetailsService.d.ts +2 -1
- package/build/@types/ocm/services/ClusterDetailsService.d.ts.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentWizard.js +9 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentWizard.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/NetworkConfiguration.js +46 -7
- package/build/cjs/cim/components/ClusterDeployment/NetworkConfiguration.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/customManifests/ClusterDeploymentCustomManifestsStep.js +22 -21
- package/build/cjs/cim/components/ClusterDeployment/customManifests/ClusterDeploymentCustomManifestsStep.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/networkConfigurationValidation.js +25 -9
- package/build/cjs/cim/components/ClusterDeployment/networkConfigurationValidation.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/networking/NetworkTypeDropdown.js +35 -0
- package/build/cjs/cim/components/ClusterDeployment/networking/NetworkTypeDropdown.js.map +1 -0
- package/build/cjs/cim/components/ClusterDeployment/review/ClusterDeploymentReviewStep.js +4 -4
- package/build/cjs/cim/components/ClusterDeployment/review/ClusterDeploymentReviewStep.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/use-networking-formik.js +13 -18
- package/build/cjs/cim/components/ClusterDeployment/use-networking-formik.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/wizardTransition.js +5 -1
- package/build/cjs/cim/components/ClusterDeployment/wizardTransition.js.map +1 -1
- package/build/cjs/cim/components/Hypershift/modals/NodePoolForm.js +1 -1
- package/build/cjs/cim/components/Hypershift/modals/NodePoolForm.js.map +1 -1
- package/build/cjs/cim/components/featureSupportLevels/ACMFeatureSupportLevelProvider.js +1 -4
- package/build/cjs/cim/components/featureSupportLevels/ACMFeatureSupportLevelProvider.js.map +1 -1
- package/build/cjs/cim/components/helpers/clusterDeployment.js +14 -10
- package/build/cjs/cim/components/helpers/clusterDeployment.js.map +1 -1
- package/build/cjs/cim/components/helpers/versions.js +39 -28
- package/build/cjs/cim/components/helpers/versions.js.map +1 -1
- package/build/cjs/cim/components/helpers/versions.test.js +423 -0
- package/build/cjs/cim/components/helpers/versions.test.js.map +1 -0
- package/build/cjs/cim/components/modals/CimConfiguration/CimConfigurationModal.js +39 -16
- package/build/cjs/cim/components/modals/CimConfiguration/CimConfigurationModal.js.map +1 -1
- package/build/cjs/cim/components/modals/CimConfiguration/persist.js +96 -136
- package/build/cjs/cim/components/modals/CimConfiguration/persist.js.map +1 -1
- package/build/cjs/cim/hooks/index.js +1 -0
- package/build/cjs/cim/hooks/index.js.map +1 -1
- package/build/cjs/cim/hooks/useAgents.js +13 -0
- package/build/cjs/cim/hooks/useAgents.js.map +1 -0
- package/build/cjs/common/components/clusterDetail/ClusterCredentials.js +10 -9
- package/build/cjs/common/components/clusterDetail/ClusterCredentials.js.map +1 -1
- package/build/cjs/common/components/clusterDetail/ConsoleModal.js +1 -10
- package/build/cjs/common/components/clusterDetail/ConsoleModal.js.map +1 -1
- package/build/cjs/common/components/clusterWizard/customManifests/CustomManifestsAlert.js +32 -0
- package/build/cjs/common/components/clusterWizard/customManifests/CustomManifestsAlert.js.map +1 -0
- package/build/cjs/common/components/clusterWizard/customManifests/index.js +5 -0
- package/build/cjs/common/components/clusterWizard/customManifests/index.js.map +1 -0
- package/build/cjs/common/components/clusterWizard/index.js +2 -0
- package/build/cjs/common/components/clusterWizard/index.js.map +1 -1
- package/build/cjs/common/components/clusterWizard/networkingSteps/AvailableSubnetsControl.js +8 -2
- package/build/cjs/common/components/clusterWizard/networkingSteps/AvailableSubnetsControl.js.map +1 -1
- package/build/cjs/common/components/clusterWizard/networkingSteps/ManagedNetworkingControlGroup.js +2 -2
- package/build/cjs/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.js +29 -19
- package/build/cjs/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.js.map +1 -1
- package/build/cjs/common/components/clusterWizard/networkingSteps/ThirdPartyCNIBanner.js +20 -0
- package/build/cjs/common/components/clusterWizard/networkingSteps/ThirdPartyCNIBanner.js.map +1 -0
- package/build/cjs/common/components/clusterWizard/networkingSteps/index.js +1 -0
- package/build/cjs/common/components/clusterWizard/networkingSteps/index.js.map +1 -1
- package/build/cjs/common/components/clusters/PullSecret.js +17 -19
- package/build/cjs/common/components/clusters/PullSecret.js.map +1 -1
- package/build/cjs/common/components/hosts/HostsTable.js +2 -1
- package/build/cjs/common/components/hosts/HostsTable.js.map +1 -1
- package/build/cjs/common/components/ui/WizardFooter.js +6 -1
- package/build/cjs/common/components/ui/WizardFooter.js.map +1 -1
- package/build/cjs/common/components/ui/formik/utils.js +5 -1
- package/build/cjs/common/components/ui/formik/utils.js.map +1 -1
- package/build/cjs/common/config/constants.js +13 -2
- package/build/cjs/common/config/constants.js.map +1 -1
- package/build/cjs/common/types/networkType.js +9 -8
- package/build/cjs/common/types/networkType.js.map +1 -1
- package/build/cjs/common/validationSchemas/networkingValidation.js +19 -1
- package/build/cjs/common/validationSchemas/networkingValidation.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/ControlPlaneNodesDropdown.js +4 -1
- package/build/cjs/ocm/components/clusterConfiguration/ControlPlaneNodesDropdown.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/OcmClusterDetailsFormFields.js +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/OcmClusterDetailsFormFields.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/CustomManifestsPage.js +1 -20
- package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/CustomManifestsPage.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.js +7 -6
- package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.js +6 -9
- package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/networkConfigurationValidation.js +4 -4
- package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/networkConfigurationValidation.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/review/ReviewClusterDetailTable.js +2 -2
- package/build/cjs/ocm/components/clusterConfiguration/review/ReviewClusterDetailTable.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/review/ReviewNetworkingTable.js +6 -5
- package/build/cjs/ocm/components/clusterConfiguration/review/ReviewNetworkingTable.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/review/ReviewSummary.js +5 -2
- package/build/cjs/ocm/components/clusterConfiguration/review/ReviewSummary.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/review/utils.js +57 -0
- package/build/cjs/ocm/components/clusterConfiguration/review/utils.js.map +1 -0
- package/build/cjs/ocm/components/{clusterDetail/ClusterProperties.test.js → clusterConfiguration/review/utils.test.js} +13 -13
- package/build/cjs/ocm/components/clusterConfiguration/review/utils.test.js.map +1 -0
- package/build/cjs/ocm/components/clusterConfiguration/staticIp/data/formDataToInfraEnvField.js +2 -2
- package/build/cjs/ocm/components/clusterConfiguration/staticIp/data/formDataToInfraEnvField.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/staticIp/data/nmstateTypes.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/staticIp/data/nmstateYaml.js +3 -7
- package/build/cjs/ocm/components/clusterConfiguration/staticIp/data/nmstateYaml.js.map +1 -1
- package/build/cjs/ocm/components/clusterDetail/ClusterDetailsButtonGroup.js +8 -2
- package/build/cjs/ocm/components/clusterDetail/ClusterDetailsButtonGroup.js.map +1 -1
- package/build/cjs/ocm/components/clusterDetail/index.js +1 -3
- package/build/cjs/ocm/components/clusterDetail/index.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/ClusterDetailsForm.js +10 -1
- package/build/cjs/ocm/components/clusterWizard/ClusterDetailsForm.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/HostDiscovery.js +4 -1
- package/build/cjs/ocm/components/clusterWizard/HostDiscovery.js.map +1 -1
- package/build/cjs/ocm/components/clusters/AssistedInstallerHeader.js +2 -2
- package/build/cjs/ocm/components/clusters/AssistedInstallerHeader.js.map +1 -1
- package/build/cjs/ocm/components/clusters/ClusterPage.js +1 -1
- package/build/cjs/ocm/components/clusters/ClusterPage.js.map +1 -1
- package/build/cjs/ocm/components/clusters/ClustersTable.js +3 -2
- package/build/cjs/ocm/components/clusters/ClustersTable.js.map +1 -1
- package/build/cjs/ocm/components/featureSupportLevels/featureStateUtils.js +1 -1
- package/build/cjs/ocm/components/hosts/HostsTableEmptyState.js +2 -1
- package/build/cjs/ocm/components/hosts/HostsTableEmptyState.js.map +1 -1
- package/build/cjs/ocm/hooks/useClusterCustomManifests.js +3 -15
- package/build/cjs/ocm/hooks/useClusterCustomManifests.js.map +1 -1
- package/build/cjs/ocm/hooks/useLateBinding.js +41 -26
- package/build/cjs/ocm/hooks/useLateBinding.js.map +1 -1
- package/build/cjs/ocm/hooks/usePullSecret.js +2 -2
- package/build/cjs/ocm/hooks/useUISettings.js +1 -1
- package/build/cjs/ocm/hooks/useUISettings.js.map +1 -1
- package/build/cjs/ocm/services/ClusterDetailsService.js +4 -2
- package/build/cjs/ocm/services/ClusterDetailsService.js.map +1 -1
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentWizard.tsx +10 -2
- package/lib/cim/components/ClusterDeployment/NetworkConfiguration.tsx +55 -6
- package/lib/cim/components/ClusterDeployment/customManifests/ClusterDeploymentCustomManifestsStep.tsx +18 -2
- package/lib/cim/components/ClusterDeployment/networkConfigurationValidation.ts +22 -8
- package/lib/cim/components/ClusterDeployment/networking/NetworkTypeDropdown.tsx +81 -0
- package/lib/cim/components/ClusterDeployment/review/ClusterDeploymentReviewStep.tsx +18 -14
- package/lib/cim/components/ClusterDeployment/types.ts +0 -1
- package/lib/cim/components/ClusterDeployment/use-networking-formik.ts +14 -22
- package/lib/cim/components/ClusterDeployment/wizardTransition.ts +5 -1
- package/lib/cim/components/Hypershift/modals/NodePoolForm.tsx +2 -2
- package/lib/cim/components/featureSupportLevels/ACMFeatureSupportLevelProvider.tsx +2 -5
- package/lib/cim/components/helpers/clusterDeployment.ts +9 -4
- package/lib/cim/components/helpers/versions.test.ts +465 -0
- package/lib/cim/components/helpers/versions.ts +37 -31
- package/lib/cim/components/modals/CimConfiguration/CimConfigurationModal.tsx +45 -18
- package/lib/cim/components/modals/CimConfiguration/persist.ts +97 -199
- package/lib/cim/hooks/index.tsx +1 -0
- package/lib/cim/hooks/useAgents.tsx +15 -0
- package/lib/cim/types/k8s/agent-cluster-install.ts +1 -1
- package/lib/common/components/clusterDetail/ClusterCredentials.tsx +49 -53
- package/lib/common/components/clusterDetail/ConsoleModal.tsx +0 -35
- package/lib/common/components/clusterWizard/customManifests/CustomManifestsAlert.tsx +39 -0
- package/lib/common/components/clusterWizard/customManifests/index.tsx +1 -0
- package/lib/common/components/clusterWizard/index.ts +2 -0
- package/lib/common/components/clusterWizard/networkingSteps/AvailableSubnetsControl.tsx +8 -1
- package/lib/common/components/clusterWizard/networkingSteps/ManagedNetworkingControlGroup.tsx +2 -2
- package/lib/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.tsx +36 -26
- package/lib/common/components/clusterWizard/networkingSteps/ThirdPartyCNIBanner.tsx +28 -0
- package/lib/common/components/clusterWizard/networkingSteps/index.ts +1 -0
- package/lib/common/components/clusters/PullSecret.tsx +28 -38
- package/lib/common/components/hosts/HostsTable.tsx +2 -0
- package/lib/common/components/ui/WizardFooter.tsx +10 -0
- package/lib/common/components/ui/formik/utils.ts +6 -0
- package/lib/common/config/constants.ts +14 -1
- package/lib/common/types/networkType.ts +9 -8
- package/lib/common/validationSchemas/networkingValidation.tsx +39 -1
- package/lib/ocm/components/clusterConfiguration/ControlPlaneNodesDropdown.tsx +6 -3
- package/lib/ocm/components/clusterConfiguration/OcmClusterDetailsFormFields.tsx +7 -6
- package/lib/ocm/components/clusterConfiguration/manifestsConfiguration/CustomManifestsPage.tsx +10 -45
- package/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.tsx +11 -9
- package/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.tsx +7 -24
- package/lib/ocm/components/clusterConfiguration/networkConfiguration/networkConfigurationValidation.ts +6 -5
- package/lib/ocm/components/clusterConfiguration/review/ReviewClusterDetailTable.tsx +1 -1
- package/lib/ocm/components/clusterConfiguration/review/ReviewNetworkingTable.tsx +10 -4
- package/lib/ocm/components/clusterConfiguration/review/ReviewSummary.tsx +9 -2
- package/lib/ocm/components/{clusterDetail/ClusterProperties.test.ts → clusterConfiguration/review/utils.test.ts} +1 -1
- package/lib/ocm/components/clusterConfiguration/review/utils.tsx +61 -0
- package/lib/ocm/components/clusterConfiguration/staticIp/data/formDataToInfraEnvField.ts +2 -0
- package/lib/ocm/components/clusterConfiguration/staticIp/data/nmstateTypes.ts +1 -0
- package/lib/ocm/components/clusterConfiguration/staticIp/data/nmstateYaml.ts +2 -0
- package/lib/ocm/components/clusterDetail/ClusterDetailsButtonGroup.tsx +27 -2
- package/lib/ocm/components/clusterDetail/index.ts +0 -1
- package/lib/ocm/components/clusterWizard/ClusterDetailsForm.tsx +10 -1
- package/lib/ocm/components/clusterWizard/HostDiscovery.tsx +4 -0
- package/lib/ocm/components/clusters/AssistedInstallerHeader.tsx +6 -2
- package/lib/ocm/components/clusters/ClusterPage.tsx +1 -1
- package/lib/ocm/components/clusters/ClustersTable.tsx +59 -49
- package/lib/ocm/components/featureSupportLevels/featureStateUtils.ts +1 -1
- package/lib/ocm/components/hosts/HostsTableEmptyState.tsx +2 -0
- package/lib/ocm/hooks/useClusterCustomManifests.ts +3 -0
- package/lib/ocm/hooks/useLateBinding.ts +45 -24
- package/lib/ocm/hooks/usePullSecret.ts +2 -2
- package/lib/ocm/hooks/useUISettings.ts +3 -1
- package/lib/ocm/services/ClusterDetailsService.ts +6 -0
- package/package.json +9 -9
- package/build/@types/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.d.ts +0 -7
- package/build/@types/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.d.ts.map +0 -1
- package/build/@types/ocm/components/clusterDetail/AssistedInstallerExtraDetailCard.d.ts +0 -8
- package/build/@types/ocm/components/clusterDetail/AssistedInstallerExtraDetailCard.d.ts.map +0 -1
- package/build/@types/ocm/components/clusterDetail/ClusterProperties.d.ts.map +0 -1
- package/build/@types/ocm/components/clusterDetail/ClusterProperties.test.d.ts +0 -2
- package/build/@types/ocm/components/clusterDetail/ClusterProperties.test.d.ts.map +0 -1
- package/build/cjs/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.js +0 -33
- package/build/cjs/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.js.map +0 -1
- package/build/cjs/ocm/components/clusterDetail/AssistedInstallerExtraDetailCard.js +0 -40
- package/build/cjs/ocm/components/clusterDetail/AssistedInstallerExtraDetailCard.js.map +0 -1
- package/build/cjs/ocm/components/clusterDetail/ClusterProperties.js +0 -77
- package/build/cjs/ocm/components/clusterDetail/ClusterProperties.js.map +0 -1
- package/build/cjs/ocm/components/clusterDetail/ClusterProperties.test.js.map +0 -1
- package/lib/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.tsx +0 -74
- package/lib/ocm/components/clusterDetail/AssistedInstallerExtraDetailCard.tsx +0 -69
- package/lib/ocm/components/clusterDetail/ClusterProperties.tsx +0 -169
|
@@ -20,12 +20,8 @@ import {
|
|
|
20
20
|
httpProxyValidationSchema,
|
|
21
21
|
noProxyValidationSchema,
|
|
22
22
|
CLUSTER_DEFAULT_NETWORK_SETTINGS,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
dualStackValidationSchema,
|
|
26
|
-
IPv4ValidationSchema,
|
|
27
|
-
IPV4_STACK,
|
|
28
|
-
NetworkConfigurationValues,
|
|
23
|
+
clusterNetworksSchema,
|
|
24
|
+
serviceNetworksSchema,
|
|
29
25
|
} from '../../../common';
|
|
30
26
|
import { ClusterDeploymentNetworkingValues } from './types';
|
|
31
27
|
import { useTranslation } from '../../../common/hooks/use-translation-wrapper';
|
|
@@ -53,22 +49,18 @@ const getNetworkConfigurationValidationSchema = (
|
|
|
53
49
|
) =>
|
|
54
50
|
Yup.lazy((values: ClusterDeploymentNetworkingValues) =>
|
|
55
51
|
Yup.object<ClusterDeploymentNetworkingValues>().shape({
|
|
56
|
-
clusterNetworks:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
serviceNetworkValidationSchema(t).concat(
|
|
69
|
-
dualStackValidationSchema(t('ai:service network'), t, openshiftVersion),
|
|
70
|
-
),
|
|
71
|
-
}),
|
|
52
|
+
clusterNetworks: clusterNetworksSchema(
|
|
53
|
+
t,
|
|
54
|
+
values.stackType ?? '',
|
|
55
|
+
values.machineNetworks?.[0]?.cidr,
|
|
56
|
+
openshiftVersion,
|
|
57
|
+
),
|
|
58
|
+
serviceNetworks: serviceNetworksSchema(
|
|
59
|
+
t,
|
|
60
|
+
values.stackType ?? '',
|
|
61
|
+
values.machineNetworks?.[0]?.cidr,
|
|
62
|
+
openshiftVersion,
|
|
63
|
+
),
|
|
72
64
|
apiVips: vipArrayValidationSchema(hostSubnets, values, t),
|
|
73
65
|
ingressVips: vipArrayValidationSchema(hostSubnets, values, t),
|
|
74
66
|
sshPublicKey: sshPublicKeyListValidationSchema(t),
|
|
@@ -69,7 +69,11 @@ const networkingStepValidationsMap: WizardStepValidationMap = {
|
|
|
69
69
|
// Alternatively we would have to whitelist network validations instead of using group
|
|
70
70
|
// TODO(mlibra): remove that container-images-available from soft validations and let backend drive it via disabling it.
|
|
71
71
|
// Depends on: https://issues.redhat.com/browse/MGMT-5265
|
|
72
|
-
softValidationIds: [
|
|
72
|
+
softValidationIds: [
|
|
73
|
+
'ntp-synced',
|
|
74
|
+
'container-images-available',
|
|
75
|
+
'custom-manifests-requirements-satisfied',
|
|
76
|
+
],
|
|
73
77
|
getPageURL: (host: Host, validationID: string) => {
|
|
74
78
|
if (validationID === 'ntp-synced') {
|
|
75
79
|
return {
|
|
@@ -13,7 +13,7 @@ import { useFormikContext } from 'formik';
|
|
|
13
13
|
import { InputField } from '../../../../common';
|
|
14
14
|
import { useTranslation } from '../../../../common/hooks/use-translation-wrapper';
|
|
15
15
|
import { AgentK8sResource } from '../../../types';
|
|
16
|
-
import { getAgentsForSelection,
|
|
16
|
+
import { getAgentsForSelection, getVersionFromReleaseString } from '../../helpers';
|
|
17
17
|
import NodePoolAgentsForm from '../forms/NodePoolAgentsForm';
|
|
18
18
|
import {
|
|
19
19
|
AgentMachineK8sResource,
|
|
@@ -44,7 +44,7 @@ const NodePoolForm = ({ agents, nodePool, hostedCluster, agentMachines }: NodePo
|
|
|
44
44
|
!agent.spec.clusterDeploymentName,
|
|
45
45
|
);
|
|
46
46
|
|
|
47
|
-
const ocpVersion =
|
|
47
|
+
const ocpVersion = getVersionFromReleaseString(hostedCluster.spec.release.image);
|
|
48
48
|
|
|
49
49
|
if (isEdit) {
|
|
50
50
|
const nodePoolAgents = getNodepoolAgents(nodePool, agents, agentMachines, hostedCluster);
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import { ClusterImageSetK8sResource } from '../../types';
|
|
10
10
|
import { featureSupportLevelsACM } from '../../config/constants';
|
|
11
11
|
import { getFeatureDisabledReason, isFeatureSupported } from './featureStateUtils';
|
|
12
|
-
import { getOCPVersions,
|
|
12
|
+
import { getOCPVersions, getVersionFromClusterImageSet } from '../helpers';
|
|
13
13
|
import { useTranslation } from '../../../common/hooks/use-translation-wrapper';
|
|
14
14
|
import { SupportLevel } from '@openshift-assisted/types/assisted-installer-service';
|
|
15
15
|
import { getMajorMinorVersion } from '../../../common/utils';
|
|
@@ -53,10 +53,7 @@ export const ACMFeatureSupportLevelProvider: React.FC<ACMFeatureSupportLevelProv
|
|
|
53
53
|
const clusterImage = clusterImages.find(
|
|
54
54
|
(clusterImageSet) => clusterImageSet.metadata?.name === versionName,
|
|
55
55
|
);
|
|
56
|
-
const version =
|
|
57
|
-
getVersionFromReleaseImage(clusterImage?.spec?.releaseImage) ||
|
|
58
|
-
clusterImage?.metadata?.name ||
|
|
59
|
-
'';
|
|
56
|
+
const version = getVersionFromClusterImageSet(clusterImage);
|
|
60
57
|
return getMajorMinorVersion(version);
|
|
61
58
|
},
|
|
62
59
|
[clusterImages],
|
|
@@ -172,6 +172,11 @@ export const getClusterProperties = (
|
|
|
172
172
|
const serviceNetworks = agentClusterInstall.spec?.networking?.serviceNetwork;
|
|
173
173
|
const clusterNetworks = agentClusterInstall.spec?.networking?.clusterNetwork;
|
|
174
174
|
|
|
175
|
+
const apiIPs = agentClusterInstall.spec?.apiVIPs || [agentClusterInstall.spec?.apiVIP];
|
|
176
|
+
const ingressIPs = agentClusterInstall.spec?.ingressVIPs || [
|
|
177
|
+
agentClusterInstall.spec?.ingressVIP,
|
|
178
|
+
];
|
|
179
|
+
|
|
175
180
|
return {
|
|
176
181
|
// TODO: we should translate following keys since they are used "as it is" in AcmDescriptionList.tsx / List component of the stolostron project
|
|
177
182
|
name: {
|
|
@@ -191,12 +196,12 @@ export const getClusterProperties = (
|
|
|
191
196
|
value: clusterDeployment.spec?.baseDomain,
|
|
192
197
|
},
|
|
193
198
|
apiVip: {
|
|
194
|
-
key: 'API IP',
|
|
195
|
-
value:
|
|
199
|
+
key: apiIPs.length > 1 ? 'API IPs' : 'API IP',
|
|
200
|
+
value: apiIPs.join(', '),
|
|
196
201
|
},
|
|
197
202
|
ingressVip: {
|
|
198
|
-
key: 'Ingress IP',
|
|
199
|
-
value:
|
|
203
|
+
key: ingressIPs.length > 1 ? 'Ingress IPs' : 'Ingress IP',
|
|
204
|
+
value: ingressIPs.join(', '),
|
|
200
205
|
},
|
|
201
206
|
clusterNetworkCidr: {
|
|
202
207
|
key: (clusterNetworks?.length || 0) > 1 ? 'Cluster network CIDRs' : 'Cluster network CIDR',
|
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
import { describe, expect, test } from 'vitest';
|
|
2
|
+
import { CpuArchitecture } from '../../../common/types/cpuArchitecture';
|
|
3
|
+
import { ClusterImageSetK8sResource } from '../../types/k8s/cluster-image-set';
|
|
4
|
+
import { AgentClusterInstallK8sResource } from '../../types/k8s/agent-cluster-install';
|
|
5
|
+
import { ClusterVersionK8sResource } from '../../types/k8s/cluster-version';
|
|
6
|
+
import { OsImage } from '../../types/k8s/agent-service-config';
|
|
7
|
+
import {
|
|
8
|
+
getCurrentClusterVersion,
|
|
9
|
+
getNetworkType,
|
|
10
|
+
getOCPVersions,
|
|
11
|
+
getSelectedVersion,
|
|
12
|
+
getVersionFromClusterImageSet,
|
|
13
|
+
} from './versions';
|
|
14
|
+
import { OpenshiftVersionOptionType } from '../../../common/types/versions';
|
|
15
|
+
|
|
16
|
+
const ClusterImageSetApiVersion = 'hive.openshift.io/v1';
|
|
17
|
+
const ClusterImageSetKind = 'ClusterImageSet';
|
|
18
|
+
|
|
19
|
+
function makeClusterImageSet(
|
|
20
|
+
overrides: Partial<ClusterImageSetK8sResource> & {
|
|
21
|
+
metadata: NonNullable<ClusterImageSetK8sResource['metadata']>;
|
|
22
|
+
},
|
|
23
|
+
): ClusterImageSetK8sResource {
|
|
24
|
+
return {
|
|
25
|
+
apiVersion: ClusterImageSetApiVersion,
|
|
26
|
+
kind: ClusterImageSetKind,
|
|
27
|
+
...overrides,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function makeOsImage(overrides: Partial<OsImage> & Pick<OsImage, 'openshiftVersion'>): OsImage {
|
|
32
|
+
const { openshiftVersion, ...rest } = overrides;
|
|
33
|
+
return {
|
|
34
|
+
cpuArchitecture: 'x86_64',
|
|
35
|
+
openshiftVersion,
|
|
36
|
+
url: 'https://example.com',
|
|
37
|
+
version: '1',
|
|
38
|
+
...rest,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
describe('getVersionFromClusterImageSet', () => {
|
|
43
|
+
test('uses releaseTag when releaseImage is digest-only', () => {
|
|
44
|
+
const cis = makeClusterImageSet({
|
|
45
|
+
metadata: {
|
|
46
|
+
name: 'img4.21.3-multi-appsub',
|
|
47
|
+
labels: { visible: 'true', releaseTag: '4.21.3-multi' },
|
|
48
|
+
},
|
|
49
|
+
spec: {
|
|
50
|
+
releaseImage: 'quay.io/openshift-release-dev/ocp-release@sha256:abc123',
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
expect(getVersionFromClusterImageSet(cis)).toBe('4.21.3-multi');
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
test('falls back to releaseImage when releaseTag is absent', () => {
|
|
57
|
+
const cis = makeClusterImageSet({
|
|
58
|
+
metadata: { name: 'img4.15.36-multi-appsub', labels: { visible: 'true' } },
|
|
59
|
+
spec: {
|
|
60
|
+
releaseImage: 'quay.io/openshift-release-dev/ocp-release:4.15.36-multi',
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
expect(getVersionFromClusterImageSet(cis)).toBe('4.15.36-multi');
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
test('falls back to metadata.name when tag and image do not parse', () => {
|
|
67
|
+
const cis = makeClusterImageSet({
|
|
68
|
+
metadata: {
|
|
69
|
+
name: 'img4.18.10-multi-appsub',
|
|
70
|
+
labels: { visible: 'true' },
|
|
71
|
+
},
|
|
72
|
+
spec: {
|
|
73
|
+
releaseImage: 'quay.io/openshift-release-dev/ocp-release@sha256:abc123',
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
expect(getVersionFromClusterImageSet(cis)).toBe('img4.18.10-multi-appsub');
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
describe('getOCPVersions', () => {
|
|
81
|
+
test('excludes image sets without visible true when extended is false', () => {
|
|
82
|
+
const hidden = makeClusterImageSet({
|
|
83
|
+
metadata: {
|
|
84
|
+
name: '4.16.1',
|
|
85
|
+
labels: { visible: 'false', releaseTag: '4.16.1' },
|
|
86
|
+
},
|
|
87
|
+
spec: { releaseImage: 'quay.io/ocp/release:4.16.1-x86_64' },
|
|
88
|
+
});
|
|
89
|
+
expect(getOCPVersions([hidden])).toEqual([]);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
test('includes image sets without visible true when extended is true', () => {
|
|
93
|
+
const hidden = makeClusterImageSet({
|
|
94
|
+
metadata: {
|
|
95
|
+
name: '4.16.2',
|
|
96
|
+
labels: { releaseTag: '4.16.2' },
|
|
97
|
+
},
|
|
98
|
+
spec: { releaseImage: 'quay.io/ocp/release:4.16.2-x86_64' },
|
|
99
|
+
});
|
|
100
|
+
const result = getOCPVersions([hidden], undefined, undefined, true);
|
|
101
|
+
expect(result).toHaveLength(1);
|
|
102
|
+
expect(result[0]?.version).toBe('4.16.2');
|
|
103
|
+
expect(result[0]?.default).toBe(true);
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
test('sorts by label descending', () => {
|
|
107
|
+
const a = makeClusterImageSet({
|
|
108
|
+
metadata: {
|
|
109
|
+
name: 'img-a',
|
|
110
|
+
labels: { visible: 'true', releaseTag: '4.15.0' },
|
|
111
|
+
},
|
|
112
|
+
spec: { releaseImage: 'quay.io/ocp/release:4.15.0-x86_64' },
|
|
113
|
+
});
|
|
114
|
+
const b = makeClusterImageSet({
|
|
115
|
+
metadata: {
|
|
116
|
+
name: 'img-b',
|
|
117
|
+
labels: { visible: 'true', releaseTag: '4.21.0' },
|
|
118
|
+
},
|
|
119
|
+
spec: { releaseImage: 'quay.io/ocp/release:4.21.0-x86_64' },
|
|
120
|
+
});
|
|
121
|
+
const result = getOCPVersions([a, b]);
|
|
122
|
+
expect(result.map((v) => v.version)).toEqual(['4.21.0', '4.15.0']);
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
test('marks only the first sorted option as default', () => {
|
|
126
|
+
const first = makeClusterImageSet({
|
|
127
|
+
metadata: {
|
|
128
|
+
name: 'first',
|
|
129
|
+
labels: { visible: 'true', releaseTag: '4.14.0' },
|
|
130
|
+
},
|
|
131
|
+
spec: { releaseImage: 'quay.io/ocp/release:4.14.0-x86_64' },
|
|
132
|
+
});
|
|
133
|
+
const second = makeClusterImageSet({
|
|
134
|
+
metadata: {
|
|
135
|
+
name: 'second',
|
|
136
|
+
labels: { visible: 'true', releaseTag: '4.16.0' },
|
|
137
|
+
},
|
|
138
|
+
spec: { releaseImage: 'quay.io/ocp/release:4.16.0-x86_64' },
|
|
139
|
+
});
|
|
140
|
+
const result = getOCPVersions([first, second]);
|
|
141
|
+
expect(result[0]?.default).toBe(true);
|
|
142
|
+
expect(result[1]?.default).toBe(false);
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
test('dedupes by version string keeping first in sorted order', () => {
|
|
146
|
+
const dupA = makeClusterImageSet({
|
|
147
|
+
metadata: {
|
|
148
|
+
name: 'dup-a',
|
|
149
|
+
labels: { visible: 'true', releaseTag: '4.17.0' },
|
|
150
|
+
},
|
|
151
|
+
spec: { releaseImage: 'quay.io/ocp/release:4.17.0-x86_64' },
|
|
152
|
+
});
|
|
153
|
+
const dupB = makeClusterImageSet({
|
|
154
|
+
metadata: {
|
|
155
|
+
name: 'dup-b',
|
|
156
|
+
labels: { visible: 'true', releaseTag: '4.17.0' },
|
|
157
|
+
},
|
|
158
|
+
spec: { releaseImage: 'quay.io/ocp/release:4.17.0-x86_64' },
|
|
159
|
+
});
|
|
160
|
+
const other = makeClusterImageSet({
|
|
161
|
+
metadata: {
|
|
162
|
+
name: 'other',
|
|
163
|
+
labels: { visible: 'true', releaseTag: '4.16.0' },
|
|
164
|
+
},
|
|
165
|
+
spec: { releaseImage: 'quay.io/ocp/release:4.16.0-x86_64' },
|
|
166
|
+
});
|
|
167
|
+
const result = getOCPVersions([dupA, dupB, other]);
|
|
168
|
+
expect(result.map((v) => v.value)).toEqual(['dup-a', 'other']);
|
|
169
|
+
expect(result.map((v) => v.version)).toEqual(['4.17.0', '4.16.0']);
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
test('when isNutanix, keeps only x86_64 or x86-64 release images or matching architecture label', () => {
|
|
173
|
+
const x86 = makeClusterImageSet({
|
|
174
|
+
metadata: {
|
|
175
|
+
name: 'nut-x86',
|
|
176
|
+
labels: { visible: 'true', releaseTag: '4.16.0' },
|
|
177
|
+
},
|
|
178
|
+
spec: { releaseImage: 'quay.io/ocp/release:4.16.0-x86_64' },
|
|
179
|
+
});
|
|
180
|
+
const multi = makeClusterImageSet({
|
|
181
|
+
metadata: {
|
|
182
|
+
name: 'nut-multi',
|
|
183
|
+
labels: { visible: 'true', releaseTag: '4.16.1-mutli', architecture: 'multi' },
|
|
184
|
+
},
|
|
185
|
+
spec: { releaseImage: 'quay.io/ocp/release:4.16.1-multi' },
|
|
186
|
+
});
|
|
187
|
+
const result = getOCPVersions([x86, multi], true);
|
|
188
|
+
expect(result.map((v) => v.value)).toEqual(['nut-x86']);
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
test('when isNutanix, allows architecture label x86_64 even if release image suffix differs', () => {
|
|
192
|
+
const cis = makeClusterImageSet({
|
|
193
|
+
metadata: {
|
|
194
|
+
name: 'nut-label',
|
|
195
|
+
labels: { visible: 'true', releaseTag: '4.16.2-multi', architecture: 'x86_64' },
|
|
196
|
+
},
|
|
197
|
+
spec: { releaseImage: 'quay.io/ocp/release:4.16.2-multi' },
|
|
198
|
+
});
|
|
199
|
+
const result = getOCPVersions([cis], true);
|
|
200
|
+
expect(result).toHaveLength(1);
|
|
201
|
+
expect(result[0]?.value).toBe('nut-label');
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
test('filters by osImages openshiftVersion major.minor', () => {
|
|
205
|
+
const inRange = makeClusterImageSet({
|
|
206
|
+
metadata: {
|
|
207
|
+
name: 'in',
|
|
208
|
+
labels: { visible: 'true', releaseTag: '4.18.55' },
|
|
209
|
+
},
|
|
210
|
+
spec: { releaseImage: 'quay.io/ocp/release:4.18.55-x86_64' },
|
|
211
|
+
});
|
|
212
|
+
const outRange = makeClusterImageSet({
|
|
213
|
+
metadata: {
|
|
214
|
+
name: 'out',
|
|
215
|
+
labels: { visible: 'true', releaseTag: '4.19.0' },
|
|
216
|
+
},
|
|
217
|
+
spec: { releaseImage: 'quay.io/ocp/release:4.19.0-x86_64' },
|
|
218
|
+
});
|
|
219
|
+
const osImages = [makeOsImage({ openshiftVersion: '4.18' })];
|
|
220
|
+
const result = getOCPVersions([inRange, outRange], false, osImages);
|
|
221
|
+
expect(result.map((v) => v.value)).toEqual(['in']);
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
test('cpuArchitectures from labels.architecture x86_64', () => {
|
|
225
|
+
const cis = makeClusterImageSet({
|
|
226
|
+
metadata: {
|
|
227
|
+
name: 'arch-x86',
|
|
228
|
+
labels: { visible: 'true', releaseTag: '4.17.0-multi', architecture: 'x86_64' },
|
|
229
|
+
},
|
|
230
|
+
spec: { releaseImage: 'quay.io/ocp/release:4.17.0-multi' },
|
|
231
|
+
});
|
|
232
|
+
const result = getOCPVersions([cis]);
|
|
233
|
+
expect(result[0]?.cpuArchitectures).toEqual([CpuArchitecture.x86]);
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
test('cpuArchitectures from labels.architecture arm64', () => {
|
|
237
|
+
const cis = makeClusterImageSet({
|
|
238
|
+
metadata: {
|
|
239
|
+
name: 'arch-arm',
|
|
240
|
+
labels: { visible: 'true', releaseTag: '4.17.0-multi', architecture: 'arm64' },
|
|
241
|
+
},
|
|
242
|
+
spec: { releaseImage: 'quay.io/ocp/release:4.17.0-multi' },
|
|
243
|
+
});
|
|
244
|
+
const result = getOCPVersions([cis]);
|
|
245
|
+
expect(result[0]?.cpuArchitectures).toEqual([CpuArchitecture.ARM]);
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
test('cpuArchitectures from labels.architecture multi', () => {
|
|
249
|
+
const cis = makeClusterImageSet({
|
|
250
|
+
metadata: {
|
|
251
|
+
name: 'arch-multi',
|
|
252
|
+
labels: { visible: 'true', releaseTag: '4.17.0-multi', architecture: 'multi' },
|
|
253
|
+
},
|
|
254
|
+
spec: { releaseImage: 'quay.io/ocp/release:4.17.0-multi' },
|
|
255
|
+
});
|
|
256
|
+
const result = getOCPVersions([cis]);
|
|
257
|
+
expect(result[0]?.cpuArchitectures).toEqual([CpuArchitecture.MULTI]);
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
test('cpuArchitectures from labels.architecture s390x', () => {
|
|
261
|
+
const cis = makeClusterImageSet({
|
|
262
|
+
metadata: {
|
|
263
|
+
name: 'arch-s390x',
|
|
264
|
+
labels: { visible: 'true', releaseTag: '4.17.0-multi', architecture: 's390x' },
|
|
265
|
+
},
|
|
266
|
+
spec: { releaseImage: 'quay.io/ocp/release:4.17.0-multi' },
|
|
267
|
+
});
|
|
268
|
+
const result = getOCPVersions([cis]);
|
|
269
|
+
expect(result[0]?.cpuArchitectures).toEqual([CpuArchitecture.s390x]);
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
test('cpuArchitectures normalizes x86-64 from release string when tag and image agree', () => {
|
|
273
|
+
const cis = makeClusterImageSet({
|
|
274
|
+
metadata: {
|
|
275
|
+
name: 'img4.17.1-x86-64-appsub',
|
|
276
|
+
labels: {
|
|
277
|
+
visible: 'true',
|
|
278
|
+
releaseTag: '4.17.1-x86-64',
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
spec: { releaseImage: 'quay.io/ocp/release:4.17.1-x86-64' },
|
|
282
|
+
});
|
|
283
|
+
const result = getOCPVersions([cis]);
|
|
284
|
+
expect(result[0]?.cpuArchitectures).toEqual([CpuArchitecture.x86]);
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
test('labels.architecture takes precedence over releaseTag arch segment', () => {
|
|
288
|
+
const cis = makeClusterImageSet({
|
|
289
|
+
metadata: {
|
|
290
|
+
name: 'prec',
|
|
291
|
+
labels: {
|
|
292
|
+
visible: 'true',
|
|
293
|
+
releaseTag: '4.19.0-multi',
|
|
294
|
+
architecture: 'x86_64',
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
spec: { releaseImage: 'quay.io/ocp/release:4.19.0-multi' },
|
|
298
|
+
});
|
|
299
|
+
const result = getOCPVersions([cis]);
|
|
300
|
+
expect(result[0]?.cpuArchitectures).toEqual([CpuArchitecture.x86]);
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
test('cpuArchitectures undefined when no arch in labels or release strings', () => {
|
|
304
|
+
const cis = makeClusterImageSet({
|
|
305
|
+
metadata: {
|
|
306
|
+
name: 'ocp-release4.17.0',
|
|
307
|
+
labels: { visible: 'true', releaseTag: '4.17.0' },
|
|
308
|
+
},
|
|
309
|
+
spec: { releaseImage: 'quay.io/ocp/release:4.17.0' },
|
|
310
|
+
});
|
|
311
|
+
const result = getOCPVersions([cis]);
|
|
312
|
+
expect(result[0]?.cpuArchitectures).toBeUndefined();
|
|
313
|
+
});
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
describe('getSelectedVersion', () => {
|
|
317
|
+
test('returns parsed version when cluster image matches imageSetRef', () => {
|
|
318
|
+
const cis = makeClusterImageSet({
|
|
319
|
+
metadata: {
|
|
320
|
+
name: 'my-imageset',
|
|
321
|
+
labels: { visible: 'true', releaseTag: '4.18.10' },
|
|
322
|
+
},
|
|
323
|
+
spec: { releaseImage: 'quay.io/ocp/release:4.18.10-x86_64' },
|
|
324
|
+
});
|
|
325
|
+
const aci = {
|
|
326
|
+
apiVersion: 'extensions.hive.openshift.io/v1beta1',
|
|
327
|
+
kind: 'AgentClusterInstall',
|
|
328
|
+
metadata: { name: 'aci', namespace: 'ns' },
|
|
329
|
+
spec: { imageSetRef: { name: 'my-imageset' } },
|
|
330
|
+
} as AgentClusterInstallK8sResource;
|
|
331
|
+
expect(getSelectedVersion([cis], aci)).toBe('4.18.10');
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
test('returns imageSetRef name when no cluster image matches', () => {
|
|
335
|
+
const aci = {
|
|
336
|
+
apiVersion: 'extensions.hive.openshift.io/v1beta1',
|
|
337
|
+
kind: 'AgentClusterInstall',
|
|
338
|
+
metadata: { name: 'aci', namespace: 'ns' },
|
|
339
|
+
spec: { imageSetRef: { name: 'missing' } },
|
|
340
|
+
} as AgentClusterInstallK8sResource;
|
|
341
|
+
expect(getSelectedVersion([], aci)).toBe('missing');
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
test('returns undefined when imageSetRef is missing', () => {
|
|
345
|
+
const aci = {
|
|
346
|
+
apiVersion: 'extensions.hive.openshift.io/v1beta1',
|
|
347
|
+
kind: 'AgentClusterInstall',
|
|
348
|
+
metadata: { name: 'aci', namespace: 'ns' },
|
|
349
|
+
spec: {},
|
|
350
|
+
} as AgentClusterInstallK8sResource;
|
|
351
|
+
expect(getSelectedVersion([], aci)).toBeUndefined();
|
|
352
|
+
});
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
describe('getCurrentClusterVersion', () => {
|
|
356
|
+
test('prefers status.history[0].version', () => {
|
|
357
|
+
const cv = {
|
|
358
|
+
apiVersion: 'config.openshift.io/v1',
|
|
359
|
+
kind: 'ClusterVersion',
|
|
360
|
+
metadata: { name: 'version' },
|
|
361
|
+
spec: {
|
|
362
|
+
channel: 'fast-4.18',
|
|
363
|
+
clusterID: 'id',
|
|
364
|
+
desiredUpdate: { version: '4.18.99', image: 'img' },
|
|
365
|
+
},
|
|
366
|
+
status: {
|
|
367
|
+
desired: { version: '4.18.0', image: 'img' },
|
|
368
|
+
history: [
|
|
369
|
+
{
|
|
370
|
+
version: '4.18.5',
|
|
371
|
+
state: 'Completed' as const,
|
|
372
|
+
startedTime: '',
|
|
373
|
+
completionTime: '',
|
|
374
|
+
image: '',
|
|
375
|
+
verified: true,
|
|
376
|
+
},
|
|
377
|
+
],
|
|
378
|
+
observedGeneration: 1,
|
|
379
|
+
versionHash: 'h',
|
|
380
|
+
availableUpdates: [],
|
|
381
|
+
},
|
|
382
|
+
} as ClusterVersionK8sResource;
|
|
383
|
+
expect(getCurrentClusterVersion(cv)).toBe('4.18.5');
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
test('falls back to spec.desiredUpdate.version when history is empty', () => {
|
|
387
|
+
const cv = {
|
|
388
|
+
apiVersion: 'config.openshift.io/v1',
|
|
389
|
+
kind: 'ClusterVersion',
|
|
390
|
+
metadata: { name: 'version' },
|
|
391
|
+
spec: {
|
|
392
|
+
channel: 'fast-4.18',
|
|
393
|
+
clusterID: 'id',
|
|
394
|
+
desiredUpdate: { version: '4.18.99', image: 'img' },
|
|
395
|
+
},
|
|
396
|
+
status: {
|
|
397
|
+
desired: { version: '4.18.0', image: 'img' },
|
|
398
|
+
history: [],
|
|
399
|
+
observedGeneration: 1,
|
|
400
|
+
versionHash: 'h',
|
|
401
|
+
availableUpdates: [],
|
|
402
|
+
},
|
|
403
|
+
} as ClusterVersionK8sResource;
|
|
404
|
+
expect(getCurrentClusterVersion(cv)).toBe('4.18.99');
|
|
405
|
+
});
|
|
406
|
+
|
|
407
|
+
test('returns undefined when no version is available', () => {
|
|
408
|
+
const cv = {
|
|
409
|
+
apiVersion: 'config.openshift.io/v1',
|
|
410
|
+
kind: 'ClusterVersion',
|
|
411
|
+
metadata: { name: 'version' },
|
|
412
|
+
spec: {
|
|
413
|
+
channel: 'fast-4.18',
|
|
414
|
+
clusterID: 'id',
|
|
415
|
+
},
|
|
416
|
+
status: {
|
|
417
|
+
desired: { version: '4.18.0', image: 'img' },
|
|
418
|
+
history: [],
|
|
419
|
+
observedGeneration: 1,
|
|
420
|
+
versionHash: 'h',
|
|
421
|
+
availableUpdates: [],
|
|
422
|
+
},
|
|
423
|
+
} as ClusterVersionK8sResource;
|
|
424
|
+
expect(getCurrentClusterVersion(cv)).toBeUndefined();
|
|
425
|
+
});
|
|
426
|
+
});
|
|
427
|
+
|
|
428
|
+
describe('getNetworkType', () => {
|
|
429
|
+
test('returns OpenShiftSDN when version is below 4.12', () => {
|
|
430
|
+
const v: OpenshiftVersionOptionType = {
|
|
431
|
+
label: 'OpenShift 4.11.5',
|
|
432
|
+
version: '4.11.5',
|
|
433
|
+
value: 'x',
|
|
434
|
+
default: false,
|
|
435
|
+
supportLevel: 'production',
|
|
436
|
+
};
|
|
437
|
+
expect(getNetworkType(v)).toBe('OpenShiftSDN');
|
|
438
|
+
});
|
|
439
|
+
|
|
440
|
+
test('returns OVNKubernetes when version is 4.12 or higher', () => {
|
|
441
|
+
const v: OpenshiftVersionOptionType = {
|
|
442
|
+
label: 'OpenShift 4.12.0',
|
|
443
|
+
version: '4.12.0',
|
|
444
|
+
value: 'x',
|
|
445
|
+
default: false,
|
|
446
|
+
supportLevel: 'production',
|
|
447
|
+
};
|
|
448
|
+
expect(getNetworkType(v)).toBe('OVNKubernetes');
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
test('returns OVNKubernetes when ocpVersion is undefined', () => {
|
|
452
|
+
expect(getNetworkType(undefined)).toBe('OVNKubernetes');
|
|
453
|
+
});
|
|
454
|
+
|
|
455
|
+
test('returns OVNKubernetes when version string is empty', () => {
|
|
456
|
+
const v: OpenshiftVersionOptionType = {
|
|
457
|
+
label: 'OpenShift ',
|
|
458
|
+
version: '',
|
|
459
|
+
value: 'x',
|
|
460
|
+
default: false,
|
|
461
|
+
supportLevel: 'production',
|
|
462
|
+
};
|
|
463
|
+
expect(getNetworkType(v)).toBe('OVNKubernetes');
|
|
464
|
+
});
|
|
465
|
+
});
|