Skip to content

Commit 2283bcd

Browse files
authored
Add additional new fields to the above the sea UI (#3337)
Signed-off-by: Elay Aharoni <elayaha@gmail.com>
1 parent 9878a25 commit 2283bcd

File tree

10 files changed

+436
-77
lines changed

10 files changed

+436
-77
lines changed

libs/locales/lib/en/translation.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@
183183
"ai:Cluster installation is still in-progress.": "Cluster installation is still in-progress.",
184184
"ai:Cluster installation process": "Cluster installation process",
185185
"ai:Cluster installation was cancelled": "Cluster installation was cancelled.",
186+
"ai:Cluster must be created before configuring infrastructure environment": "Cluster must be created before configuring infrastructure environment",
186187
"ai:Cluster must have at least 3 hosts.": "Cluster must have at least 3 hosts.",
187188
"ai:Cluster name": "Cluster name",
188189
"ai:Cluster network CIDR": "Cluster network CIDR",
@@ -214,6 +215,7 @@
214215
"ai:Configure environment": "Configure environment",
215216
"ai:Configure host inventory settings": "Configure host inventory settings",
216217
"ai:Configure load balancer on Amazon Web Services for me.": "Configure load balancer on Amazon Web Services for me.",
218+
"ai:Configure proxy settings": "Configure proxy settings",
217219
"ai:Configure the SSH key and proxy settings after the modal appears (optional).": "Configure the SSH key and proxy settings after the modal appears (optional).",
218220
"ai:Configure your own NTP sources to sychronize the time between the hosts that will be added to this infrastructure environment.": "Configure your own NTP sources to sychronize the time between the hosts that will be added to this infrastructure environment.",
219221
"ai:Configure your own NTP sources to synchronize the time between the hosts that will be added to this infrastructure environment.": "Configure your own NTP sources to synchronize the time between the hosts that will be added to this infrastructure environment.",
@@ -346,9 +348,11 @@
346348
"ai:Failed to add hosts to the cluster": "Failed to add hosts to the cluster",
347349
"ai:Failed to configure provisioning to enable registering hosts via BMC.": "Failed to configure provisioning to enable registering hosts via BMC.",
348350
"ai:Failed to create AgentServiceConfig": "Failed to create AgentServiceConfig",
351+
"ai:Failed to create infrastructure environment": "Failed to create infrastructure environment",
349352
"ai:Failed to create IngressController": "Failed to create IngressController",
350353
"ai:Failed to delete host": "Failed to delete host",
351354
"ai:Failed to download the discovery Image": "Failed to download the discovery Image",
355+
"ai:Failed to fetch cluster": "Failed to fetch cluster",
352356
"ai:Failed to fetch cluster credentials.": "Failed to fetch cluster credentials.",
353357
"ai:Failed to get Provisioning Configuration": "Failed to get Provisioning Configuration",
354358
"ai:Failed to load Credentials Download step": "Failed to load Credentials Download step",
@@ -358,6 +362,7 @@
358362
"ai:Failed to save configuration": "Failed to save configuration",
359363
"ai:Failed to save host selection.": "Failed to save host selection.",
360364
"ai:Failed to update host": "Failed to update host",
365+
"ai:Failed to update infrastructure environment": "Failed to update infrastructure environment",
361366
"ai:Failed validations:": "Failed validations:",
362367
"ai:Failing infrastructure environment": "Failing infrastructure environment",
363368
"ai:Fence Agents Remediation requirements": "Fence Agents Remediation requirements",
@@ -562,6 +567,7 @@
562567
"ai:Minimum Memory": "Minimum Memory",
563568
"ai:Minimum memory for selected role": "Minimum memory for selected role",
564569
"ai:Minimum number of hosts": "Minimum number of hosts",
570+
"ai:Missing cluster": "Missing cluster",
565571
"ai:Model": "Model",
566572
"ai:Modify your platform configuration to access your platform's features directly in OpenShift.": "Modify your platform configuration to access your platform's features directly in OpenShift.",
567573
"ai:More info for configure storage sizes": "More information for configure storage sizes",
@@ -671,6 +677,7 @@
671677
"ai:Operators": "Operators",
672678
"ai:Option 1: Add the following records to your DNS server (recommended)": "Option 1: Add the following records to your DNS server (recommended)",
673679
"ai:Option 2: Update your local /etc/hosts or /etc/resolv.conf files": "Option 2: Update your local /etc/hosts or /etc/resolv.conf files",
680+
"ai:Optional configurations": "Optional configurations",
674681
"ai:Otherwise, the VMs will not be able to reboot during the installation process.": "Otherwise, the VMs will not be able to reboot during the installation process.",
675682
"ai:OVN separates the physical network topology from the logical one and is recommended if you're using new or telco features.": "OVN separates the physical network topology from the logical one and is recommended if you are using new or telco features.",
676683
"ai:Packet loss": "Packet loss",
@@ -740,6 +747,7 @@
740747
"ai:Removing {{name}} will remove the association with {{count}} host. These hosts will become available for other nodepools._plural": "Removing {{name}} will remove the association with {{count}} hosts. These hosts will become available for other nodepools.",
741748
"ai:Removing from cluster": "Removing from cluster",
742749
"ai:Rename hostnames using the custom template:": "Rename hostnames using the custom template:",
750+
"ai:Rendezvous IP": "Rendezvous IP",
743751
"ai:Report a bug": "Report a bug",
744752
"ai:Required field": "Required field",
745753
"ai:Requirements for Two Node control plane OpenShift": "Requirements for Two Node control plane OpenShift",
@@ -841,6 +849,7 @@
841849
"ai:The hosts you selected are using different proxy settings. Configure a proxy that will be applied for these hosts. <bold>Configure at least one of the proxy settings below.</bold>": "The hosts you selected are using different proxy settings. Configure a proxy that will be applied for these hosts. <bold>Configure at least one of the following proxy settings.</bold>",
842850
"ai:The HTTP proxy URL that agents should use to access the discovery service.": "The HTTP proxy URL that agents should use to access the discovery service.",
843851
"ai:The IP address pool to use for service IP addresses. You can enter only one IP address pool. If you need to access the services from an external network, configure load balancers and routers to manage the traffic.": "The IP address pool to use for service IP addresses. You can enter only one IP address pool. If you need to access the services from an external network, configure load balancers and routers to manage the traffic.",
852+
"ai:The IP address that hosts will use to communicate with the bootstrap node during installation.": "The IP address that hosts will use to communicate with the bootstrap node during installation.",
844853
"ai:The MAC address of the host's network connected NIC that will be used to provision the host.": "The MAC address of the host's network connected NIC that will be used to provision the host.",
845854
"ai:The output displays the following:": "The output displays the following:",
846855
"ai:The resource has been saved and the YAML is now read only.": "The resource has been saved and the YAML is now read only.",

libs/types/assisted-installer-service.d.ts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1734,7 +1734,7 @@ export interface ImageInfo {
17341734
staticNetworkConfig?: string;
17351735
type?: ImageType;
17361736
}
1737-
export type ImageType = 'full-iso' | 'minimal-iso';
1737+
export type ImageType = 'full-iso' | 'minimal-iso' | 'disconnected-iso';
17381738
export interface ImportClusterParams {
17391739
/**
17401740
* OpenShift cluster name.
@@ -1830,6 +1830,14 @@ export interface InfraEnv {
18301830
* certificates in this bundle.
18311831
*/
18321832
additionalTrustBundle?: string;
1833+
/**
1834+
* The IP address that hosts will use to communicate with the bootstrap node during installation.
1835+
*/
1836+
rendezvousIp?: string;
1837+
/**
1838+
* The type of network configuration for hosts: 'dhcp' for DHCP only, 'static' for static IP configuration.
1839+
*/
1840+
hostsNetworkConfigurationType?: 'dhcp' | 'static';
18331841
}
18341842
export interface InfraEnvCreateParams {
18351843
/**
@@ -1875,6 +1883,14 @@ export interface InfraEnvCreateParams {
18751883
* certificates in this bundle.
18761884
*/
18771885
additionalTrustBundle?: string;
1886+
/**
1887+
* The IP address that hosts will use to communicate with the bootstrap node during installation.
1888+
*/
1889+
rendezvousIp?: string;
1890+
/**
1891+
* The type of network configuration for hosts: 'dhcp' for DHCP only, 'static' for static IP configuration.
1892+
*/
1893+
hostsNetworkConfigurationType?: 'dhcp' | 'static';
18781894
}
18791895
export type InfraEnvList = InfraEnv[];
18801896
export interface InfraEnvUpdateParams {
@@ -1906,6 +1922,14 @@ export interface InfraEnvUpdateParams {
19061922
* Version of the OS image
19071923
*/
19081924
openshiftVersion?: string;
1925+
/**
1926+
* The IP address that hosts will use to communicate with the bootstrap node during installation.
1927+
*/
1928+
rendezvousIp?: string;
1929+
/**
1930+
* The type of network configuration for hosts: 'dhcp' for DHCP only, 'static' for static IP configuration.
1931+
*/
1932+
hostsNetworkConfigurationType?: 'dhcp' | 'static';
19091933
}
19101934
export interface InfraError {
19111935
/**

libs/ui-lib/lib/ocm/components/clusterConfiguration/DiscoveryImageTypeDropdown.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const discoveryImageTypes: Record<DiscoveryImageType, string> = {
2020
'minimal-iso': 'Minimal image file - Download an ISO that fetches content on boot',
2121
'full-iso': 'Full image file - Download a self-contained ISO',
2222
'discovery-image-ipxe': 'iPXE - Provision from your network server',
23+
'disconnected-iso': 'Disconnected ISO - Provision from a local file',
2324
};
2425

2526
type DiscoveryImageTypeDropdownProps = {

libs/ui-lib/lib/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
import { Formik, FormikHelpers } from 'formik';
1616
import {
1717
HostStaticNetworkConfig,
18-
ImageType,
1918
InfraEnv,
2019
Proxy,
2120
} from '@openshift-assisted/types/assisted-installer-service';
@@ -70,7 +69,7 @@ type OcmDiscoveryImageConfigFormProps = Proxy & {
7069
formikActions: FormikHelpers<OcmDiscoveryImageFormValues>,
7170
) => Promise<void>;
7271
sshPublicKey?: string;
73-
imageType?: ImageType;
72+
imageType?: DiscoveryImageType;
7473
isIpxeSelected?: boolean;
7574
enableCertificate?: boolean;
7675
trustBundle?: InfraEnv['additionalTrustBundle'];
@@ -104,7 +103,7 @@ export const OcmDiscoveryImageConfigForm = ({
104103
httpsProxy: httpsProxy || '',
105104
noProxy: noProxy || '',
106105
enableProxy: !!(httpProxy || httpsProxy || noProxy),
107-
imageType: imageTypeValue as ImageType,
106+
imageType: imageType,
108107
enableCertificate: enableCertificate || false,
109108
trustBundle: trustBundle || '',
110109
};

libs/ui-lib/lib/ocm/components/clusterWizard/ClusterWizardContextProvider.tsx

Lines changed: 91 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,33 @@ const getWizardStepIds = (
7676
return stepsCopy;
7777
};
7878

79+
// Same logic as getWizardStepIds but for disconnected flow
80+
// Adds static IP steps after 'disconnected-optional-configurations' instead of 'cluster-details'
81+
const getDisconnectedWizardStepIds = (
82+
wizardStepIds: ClusterWizardStepsType[] | undefined,
83+
staticIpView?: StaticIpView | 'dhcp-selected',
84+
): ClusterWizardStepsType[] => {
85+
let stepsCopy = wizardStepIds ? [...wizardStepIds] : [...disconnectedSteps];
86+
if (staticIpView === StaticIpView.YAML) {
87+
stepsCopy = removeStepFromClusterWizard(stepsCopy, 'static-ip-network-wide-configurations', 2);
88+
stepsCopy = addStepToClusterWizard(stepsCopy, 'disconnected-optional-configurations', [
89+
'static-ip-yaml-view',
90+
]);
91+
} else if (staticIpView === StaticIpView.FORM) {
92+
stepsCopy = removeStepFromClusterWizard(stepsCopy, 'static-ip-yaml-view', 1);
93+
stepsCopy = addStepToClusterWizard(
94+
stepsCopy,
95+
'disconnected-optional-configurations',
96+
staticIpFormViewSubSteps,
97+
);
98+
} else if (staticIpView === 'dhcp-selected') {
99+
stepsCopy = removeStepFromClusterWizard(stepsCopy, 'static-ip-network-wide-configurations', 2);
100+
stepsCopy = removeStepFromClusterWizard(stepsCopy, 'static-ip-yaml-view', 1);
101+
}
102+
103+
return stepsCopy;
104+
};
105+
79106
const ClusterWizardContextProvider = ({
80107
children,
81108
cluster,
@@ -89,6 +116,8 @@ const ClusterWizardContextProvider = ({
89116
const isSingleClusterFeatureEnabled = useFeature('ASSISTED_INSTALLER_SINGLE_CLUSTER_FEATURE');
90117
const [currentStepId, setCurrentStepId] = React.useState<ClusterWizardStepsType>();
91118
const [connectedWizardStepIds, setWizardStepIds] = React.useState<ClusterWizardStepsType[]>();
119+
const [disconnectedWizardStepIds, setDisconnectedWizardStepIds] =
120+
React.useState<ClusterWizardStepsType[]>(disconnectedSteps);
92121
const [wizardPerPage, setWizardPerPage] = React.useState(10);
93122
const [customManifestsStep, setCustomManifestsStep] = React.useState<boolean>(false);
94123
const [installDisconnected, setInstallDisconnected] = React.useState(false);
@@ -106,7 +135,7 @@ const ClusterWizardContextProvider = ({
106135
const { clearAlerts, addAlert, alerts } = useAlerts();
107136
const setClusterPermissions = useSetClusterPermissions();
108137

109-
const wizardStepIds = installDisconnected ? disconnectedSteps : connectedWizardStepIds;
138+
const wizardStepIds = installDisconnected ? disconnectedWizardStepIds : connectedWizardStepIds;
110139

111140
React.useEffect(() => {
112141
if (!UISettingsLoading) {
@@ -165,17 +194,29 @@ const ClusterWizardContextProvider = ({
165194

166195
const handleMoveFromStaticIp = () => {
167196
//if static ip view change wasn't persisted, moving from static ip step should change the wizard steps to match the view in the infra env
168-
const staticIpInfo = infraEnv ? getStaticIpInfo(infraEnv) : undefined;
197+
const currentInfraEnv = installDisconnected ? disconnectedInfraEnv : infraEnv;
198+
const staticIpInfo = currentInfraEnv ? getStaticIpInfo(currentInfraEnv) : undefined;
169199
if (!staticIpInfo) {
170200
throw `Wizard step is currently ${currentStepId}, but no static ip info is defined`;
171201
}
172-
const newStepIds = getWizardStepIds(
173-
wizardStepIds,
174-
staticIpInfo.view,
175-
customManifestsStep,
176-
isSingleClusterFeatureEnabled,
177-
);
178-
setWizardStepIds(newStepIds);
202+
203+
if (installDisconnected) {
204+
// For disconnected wizard, update wizard steps directly (same pattern as connected)
205+
const newStepIds = getDisconnectedWizardStepIds(
206+
disconnectedWizardStepIds,
207+
staticIpInfo.view,
208+
);
209+
setDisconnectedWizardStepIds(newStepIds);
210+
} else {
211+
// For connected wizard, update wizard steps directly
212+
const newStepIds = getWizardStepIds(
213+
wizardStepIds,
214+
staticIpInfo.view,
215+
customManifestsStep,
216+
isSingleClusterFeatureEnabled,
217+
);
218+
setWizardStepIds(newStepIds);
219+
}
179220
};
180221

181222
const onSetCurrentStepId = (stepId: ClusterWizardStepsType) => {
@@ -219,31 +260,57 @@ const ClusterWizardContextProvider = ({
219260
} else {
220261
setCurrentStepId('static-ip-network-wide-configurations');
221262
}
222-
setWizardStepIds(
223-
getWizardStepIds(wizardStepIds, view, customManifestsStep, isSingleClusterFeatureEnabled),
224-
);
225-
},
226-
onUpdateHostNetworkConfigType(type: HostsNetworkConfigurationType): void {
227-
if (type === HostsNetworkConfigurationType.STATIC) {
228-
setWizardStepIds(
229-
getWizardStepIds(
230-
wizardStepIds,
231-
StaticIpView.FORM,
232-
customManifestsStep,
233-
isSingleClusterFeatureEnabled,
234-
),
263+
if (installDisconnected) {
264+
// For disconnected wizard, update wizard steps (same pattern as connected)
265+
setDisconnectedWizardStepIds(
266+
getDisconnectedWizardStepIds(disconnectedWizardStepIds, view),
235267
);
236268
} else {
237269
setWizardStepIds(
238270
getWizardStepIds(
239271
wizardStepIds,
240-
'dhcp-selected',
272+
view,
241273
customManifestsStep,
242274
isSingleClusterFeatureEnabled,
243275
),
244276
);
245277
}
246278
},
279+
onUpdateHostNetworkConfigType(type: HostsNetworkConfigurationType): void {
280+
if (installDisconnected) {
281+
// For disconnected wizard, update wizard steps (same pattern as connected)
282+
if (type === HostsNetworkConfigurationType.STATIC) {
283+
setDisconnectedWizardStepIds(
284+
getDisconnectedWizardStepIds(disconnectedWizardStepIds, StaticIpView.FORM),
285+
);
286+
} else {
287+
setDisconnectedWizardStepIds(
288+
getDisconnectedWizardStepIds(disconnectedWizardStepIds, 'dhcp-selected'),
289+
);
290+
}
291+
} else {
292+
// For connected wizard, update wizard steps directly
293+
if (type === HostsNetworkConfigurationType.STATIC) {
294+
setWizardStepIds(
295+
getWizardStepIds(
296+
wizardStepIds,
297+
StaticIpView.FORM,
298+
customManifestsStep,
299+
isSingleClusterFeatureEnabled,
300+
),
301+
);
302+
} else {
303+
setWizardStepIds(
304+
getWizardStepIds(
305+
wizardStepIds,
306+
'dhcp-selected',
307+
customManifestsStep,
308+
isSingleClusterFeatureEnabled,
309+
),
310+
);
311+
}
312+
}
313+
},
247314
wizardStepIds: wizardStepIds,
248315
currentStepId,
249316
setCurrentStepId: onSetCurrentStepId,
@@ -276,8 +343,8 @@ const ClusterWizardContextProvider = ({
276343
uiSettings,
277344
updateUISettings,
278345
installDisconnected,
279-
setInstallDisconnected,
280346
connectedWizardStepIds,
347+
disconnectedWizardStepIds,
281348
disconnectedInfraEnv,
282349
]);
283350

libs/ui-lib/lib/ocm/components/clusterWizard/NewClusterWizard.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import { useClusterWizardContext } from './ClusterWizardContext';
55
import ReviewStep from './disconnected/ReviewStep';
66
import BasicStep from './disconnected/BasicStep';
77
import OptionalConfigurationsStep from './disconnected/OptionalConfigurationsStep';
8+
import DisconnectedStaticIp from './disconnected/DisconnectedStaticIp';
89
import { ClusterWizardStepsType } from './wizardTransition';
10+
import { ModalDialogsContextProvider } from '../hosts/ModalDialogsContext';
911

1012
const getCurrentStep = (currentStepId: ClusterWizardStepsType) => {
1113
switch (currentStepId) {
@@ -15,6 +17,10 @@ const getCurrentStep = (currentStepId: ClusterWizardStepsType) => {
1517
return <BasicStep />;
1618
case 'disconnected-optional-configurations':
1719
return <OptionalConfigurationsStep />;
20+
case 'static-ip-yaml-view':
21+
case 'static-ip-network-wide-configurations':
22+
case 'static-ip-host-configurations':
23+
return <DisconnectedStaticIp />;
1824
default:
1925
return <ClusterDetails />;
2026
}
@@ -23,9 +29,11 @@ const getCurrentStep = (currentStepId: ClusterWizardStepsType) => {
2329
const NewClusterWizard: React.FC = () => {
2430
const { currentStepId } = useClusterWizardContext();
2531
return (
26-
<div className={classNames('pf-v6-c-wizard', 'cluster-wizard')}>
27-
{getCurrentStep(currentStepId)}
28-
</div>
32+
<ModalDialogsContextProvider>
33+
<div className={classNames('pf-v6-c-wizard', 'cluster-wizard')}>
34+
{getCurrentStep(currentStepId)}
35+
</div>
36+
</ModalDialogsContextProvider>
2937
);
3038
};
3139

libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/BasicStep.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const BasicStep = () => {
4343
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
4444
await ClustersService.registerDisconnected({
4545
name: 'disconnected-cluster',
46-
openshiftVersion: '4.20',
46+
openshiftVersion: '4.22',
4747
});
4848
disconnectedClusterId = disconnectedCluster.id;
4949
navigate(`${currentPath}/${disconnectedClusterId}`, {
@@ -98,7 +98,7 @@ const BasicStep = () => {
9898
</GridItem>
9999
<GridItem>
100100
<Form id="wizard-cluster-basic-info__form">
101-
<OcmOpenShiftVersion openshiftVersion="4.20" withPreviewText withMultiText>
101+
<OcmOpenShiftVersion openshiftVersion="4.22" withPreviewText withMultiText>
102102
<ExternalLink href={`${window.location.origin}/${OCP_RELEASES_PAGE}`}>
103103
<span data-ouia-id="openshift-releases-link">
104104
{t('ai:Learn more about OpenShift releases')}

0 commit comments

Comments
 (0)