|
1 |
| -const DEFAULT_OPENSHIFT_DOCS_VERSION = '4.15'; |
| 1 | +const DEFAULT_OPENSHIFT_DOCS_VERSION = 4.15; |
2 | 2 |
|
3 | 3 | export const getShortOpenshiftVersion = (ocpVersion?: string) => {
|
4 |
| - let shortOcpVersion = ocpVersion |
5 |
| - ? ocpVersion.split('.').slice(0, 2).join('.') |
6 |
| - : DEFAULT_OPENSHIFT_DOCS_VERSION; |
7 |
| - if (shortOcpVersion < '4.14') shortOcpVersion = '4.14'; |
8 |
| - return shortOcpVersion; |
| 4 | + if (!ocpVersion) { |
| 5 | + return DEFAULT_OPENSHIFT_DOCS_VERSION; |
| 6 | + } |
| 7 | + const versionXY = Number(ocpVersion.split('.').slice(0, 2).join('.')); |
| 8 | + if (!Number.isFinite(versionXY)) { |
| 9 | + return DEFAULT_OPENSHIFT_DOCS_VERSION; |
| 10 | + } |
| 11 | + return versionXY < 4.14 ? 4.14 : versionXY; |
9 | 12 | };
|
10 | 13 |
|
11 | 14 | export const getYearForAssistedInstallerDocumentationLink = () => {
|
@@ -36,7 +39,11 @@ export const getEncryptingDiskDuringInstallationDocsLink = (ocpVersion?: string)
|
36 | 39 | export const getOpenShiftNetworkingDocsLink = (ocpVersion?: string) =>
|
37 | 40 | `https://docs.redhat.com/en/documentation/openshift_container_platform/${getShortOpenshiftVersion(
|
38 | 41 | ocpVersion,
|
39 |
| - )}/html/installing_on_bare_metal/installing-bare-metal#installation-network-user-infra_installing-bare-metal`; |
| 42 | + )}/html/installing_on_bare_metal/${ |
| 43 | + getShortOpenshiftVersion(ocpVersion) > 4.17 |
| 44 | + ? 'user-provisioned-infrastructure' |
| 45 | + : 'installing-bare-metal' |
| 46 | + }#installation-network-user-infra_installing-bare-metal`; |
40 | 47 |
|
41 | 48 | export const SSH_GENERATION_DOC_LINK = 'https://www.redhat.com/sysadmin/configure-ssh-keygen';
|
42 | 49 |
|
|
0 commit comments