"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getNvidiaGpuLink = exports.getNodeFeatureDiscoveryLink = exports.getNmstateLink = exports.getLsoLink = exports.AUTHORINO_OPERATOR_LINK = exports.getMtuLink = exports.OSC_LINK = exports.OPENSHIFT_AI_LINK = exports.MTV_LINK = exports.getCiscoIntersightLink = exports.CHANGE_ISO_PASSWORD_FILE_LINK = exports.FEEDBACK_FORM_LINK = exports.getReportIssueLink = exports.REDHAT_CONSOLE_OPENSHIFT = exports.getKubeDeschedulerLink = exports.NODE_MAINTENANCE_LINK = exports.FENCE_AGENTS_REMEDIATION_LINK = exports.SELF_NODE_REMEDIATION_LINK = exports.NODE_HEALTHCHECK_LINK = exports.getLvmsDocsLink = exports.getMceDocsLink = exports.ODF_LINK = exports.getKmmDocsLink = exports.CNV_LINK = exports.OSC_REQUIREMENTS_LINK = exports.OPENSHIFT_AI_REQUIREMENTS_LINK = exports.ODF_REQUIREMENTS_LINK = exports.HOST_REQUIREMENTS_LINK = exports.DISK_WRITE_SPEED_LINK = exports.OCP_RELEASES_PAGE = exports.HOW_TO_KNOW_IF_CLUSTER_SUPPORTS_MULTIPLE_CPU_ARCHS = exports.OCI_CONFIG_LINK = exports.VSPHERE_LIMITATIONS_LINK = exports.VSPHERE_CONFIG_LINK = exports.NUTANIX_CONFIG_LINK = exports.getOCPStaticIPDocLink = exports.NMSTATE_EXAMPLES_LINK = exports.getApproveNodesInClLink = exports.getOcpConsoleNodesPage = exports.SSH_GENERATION_DOC_LINK = exports.RED_HAT_CNI_SUPPORT_MATRIX_LINK = exports.getOpenShiftNetworkingDocsLink = exports.getEncryptingDiskDuringInstallationDocsLink = exports.PULL_SECRET_INFO_LINK = exports.CLUSTER_MANAGER_SITE_LINK = exports.DEVELOPER_SUPPORT_LEVEL_LINK = exports.TECH_SUPPORT_LEVEL_LINK = exports.OPENSHIFT_LIFE_CYCLE_DATES_LINK = exports.ASSISTED_INSTALLER_DOCUMENTATION_LINK = exports.getYearForAssistedInstallerDocumentationLink = void 0;
exports.getNumaResourcesLink = exports.getOpenShiftLoggingLink = exports.getLokiLink = exports.getClusterObservabilityLink = exports.getMetalLbLink = exports.getOadpLink = exports.KUBECONFIG_INFO_LINK = exports.SERVERLESS_OPERATOR_LINK = exports.SERVICE_MESH_OPERATOR_LINK = exports.PIPELINES_OPERATOR_LINK = void 0;
const utils_1 = require("../utils");
const LATEST_OPENSHIFT_DOCS_VERSION = '4.21';
const MIN_OPENSHIFT_DOCS_VERSION = '4.14';
const getDocsOpenshiftVersion = (ocpVersion) => {
    if (!ocpVersion) {
        return LATEST_OPENSHIFT_DOCS_VERSION;
    }
    if ((0, utils_1.isMajorMinorVersionEqualOrGreater)(MIN_OPENSHIFT_DOCS_VERSION, ocpVersion)) {
        return MIN_OPENSHIFT_DOCS_VERSION;
    }
    if ((0, utils_1.isMajorMinorVersionEqualOrGreater)(ocpVersion, LATEST_OPENSHIFT_DOCS_VERSION)) {
        return LATEST_OPENSHIFT_DOCS_VERSION;
    }
    const versionParts = ocpVersion.split('.').slice(0, 2).map(Number);
    if (versionParts.length < 2) {
        return LATEST_OPENSHIFT_DOCS_VERSION;
    }
    return `${versionParts[0]}.${versionParts[1]}`;
};
const getYearForAssistedInstallerDocumentationLink = () => {
    return new Date().getFullYear();
};
exports.getYearForAssistedInstallerDocumentationLink = getYearForAssistedInstallerDocumentationLink;
exports.ASSISTED_INSTALLER_DOCUMENTATION_LINK = `https://docs.redhat.com/en/documentation/assisted_installer_for_openshift_container_platform/${(0, exports.getYearForAssistedInstallerDocumentationLink)()}/html/installing_openshift_container_platform_with_the_assisted_installer/index`;
//New cluster page
exports.OPENSHIFT_LIFE_CYCLE_DATES_LINK = 'https://access.redhat.com/support/policy/updates/openshift#dates';
exports.TECH_SUPPORT_LEVEL_LINK = 'https://access.redhat.com/support/offerings/techpreview';
exports.DEVELOPER_SUPPORT_LEVEL_LINK = 'https://access.redhat.com/support/offerings/devpreview';
exports.CLUSTER_MANAGER_SITE_LINK = 'https://console.redhat.com/openshift/install/pull-secret';
exports.PULL_SECRET_INFO_LINK = exports.CLUSTER_MANAGER_SITE_LINK;
const getEncryptingDiskDuringInstallationDocsLink = (ocpVersion) => `https://docs.redhat.com/en/documentation/openshift_container_platform/${getDocsOpenshiftVersion(ocpVersion)}/html/installation_configuration/installing-customizing#installation-special-config-encrypt-disk_installing-customizing`;
exports.getEncryptingDiskDuringInstallationDocsLink = getEncryptingDiskDuringInstallationDocsLink;
//Networking page
const getOpenShiftNetworkingDocsLink = (ocpVersion) => {
    const validOcpVersion = getDocsOpenshiftVersion(ocpVersion);
    const variant = (0, utils_1.isMajorMinorVersionEqualOrGreater)(validOcpVersion, '4.18')
        ? 'user-provisioned-infrastructure'
        : 'installing-bare-metal';
    return `https://docs.redhat.com/en/documentation/openshift_container_platform/${validOcpVersion}/html/installing_on_bare_metal/${variant}#installation-network-user-infra_installing-bare-metal`;
};
exports.getOpenShiftNetworkingDocsLink = getOpenShiftNetworkingDocsLink;
exports.RED_HAT_CNI_SUPPORT_MATRIX_LINK = 'https://access.redhat.com/articles/5436171';
exports.SSH_GENERATION_DOC_LINK = 'https://www.redhat.com/sysadmin/configure-ssh-keygen';
//Hosts status
const getOcpConsoleNodesPage = (ocpConsoleUrl) => `${ocpConsoleUrl}/k8s/cluster/nodes`;
exports.getOcpConsoleNodesPage = getOcpConsoleNodesPage;
const getApproveNodesInClLink = (ocpVersion) => `https://docs.redhat.com/en/documentation/openshift_container_platform/${getDocsOpenshiftVersion(ocpVersion)}/html/installing_on_any_platform/installing-platform-agnostic#installation-approve-csrs_installing-platform-agnostic`;
exports.getApproveNodesInClLink = getApproveNodesInClLink;
//Static Ip configuration
exports.NMSTATE_EXAMPLES_LINK = 'https://nmstate.io/examples.html';
const getOCPStaticIPDocLink = (docVersion = '2.8') => `https://docs.redhat.com/documentation/en-us/red_hat_advanced_cluster_management_for_kubernetes/${docVersion}/html-single/clusters/index#on-prem-creating-your-cluster-with-the-cli-nmstateconfig`;
exports.getOCPStaticIPDocLink = getOCPStaticIPDocLink;
//Platform integration
exports.NUTANIX_CONFIG_LINK = `https://docs.redhat.com/en/documentation/assisted_installer_for_openshift_container_platform/${(0, exports.getYearForAssistedInstallerDocumentationLink)()}/html-single/installing_openshift_container_platform_with_the_assisted_installer/index#assembly_installing-on-nutanix`;
exports.VSPHERE_CONFIG_LINK = `https://docs.redhat.com/en/documentation/assisted_installer_for_openshift_container_platform/${(0, exports.getYearForAssistedInstallerDocumentationLink)()}/html-single/installing_openshift_container_platform_with_the_assisted_installer/index#adding-hosts-on-vsphere_installing-on-vsphere`;
exports.VSPHERE_LIMITATIONS_LINK = `https://docs.redhat.com/en/documentation/assisted_installer_for_openshift_container_platform/${(0, exports.getYearForAssistedInstallerDocumentationLink)()}/html/installing_openshift_container_platform_with_the_assisted_installer/installing-on-vsphere`;
exports.OCI_CONFIG_LINK = `https://docs.redhat.com/en/documentation/assisted_installer_for_openshift_container_platform/${(0, exports.getYearForAssistedInstallerDocumentationLink)()}/html-single/installing_openshift_container_platform_with_the_assisted_installer/index#installing-on-oci`;
exports.HOW_TO_KNOW_IF_CLUSTER_SUPPORTS_MULTIPLE_CPU_ARCHS = `https://docs.redhat.com/en/documentation/assisted_installer_for_openshift_container_platform/${(0, exports.getYearForAssistedInstallerDocumentationLink)()}/html/installing_openshift_container_platform_with_the_assisted_installer/expanding-the-cluster#checking-for-multiple-architectures_expanding-the-cluster`;
exports.OCP_RELEASES_PAGE = 'openshift/releases';
//Host requirements
exports.DISK_WRITE_SPEED_LINK = 'https://access.redhat.com/solutions/4885641';
exports.HOST_REQUIREMENTS_LINK = 'https://access.redhat.com/solutions/4885641';
//Operators page
exports.ODF_REQUIREMENTS_LINK = 'https://docs.redhat.com/en/documentation/red_hat_openshift_data_foundation';
exports.OPENSHIFT_AI_REQUIREMENTS_LINK = 'https://docs.redhat.com/en/documentation/red_hat_openshift_ai_self-managed/2.16/html/installing_and_uninstalling_openshift_ai_self-managed/installing-and-deploying-openshift-ai_install#requirements-for-openshift-ai-self-managed_install';
exports.OSC_REQUIREMENTS_LINK = 'https://docs.redhat.com/en/documentation/openshift_sandboxed_containers/1.8/html/user_guide/deploying-osc-bare-metal#osc-resource-requirements_deploying-bare-metal';
exports.CNV_LINK = 'https://cloud.redhat.com/learn/topics/virtualization/';
const getKmmDocsLink = (ocpVersion) => `https://docs.redhat.com/en/documentation/openshift_container_platform/${getDocsOpenshiftVersion(ocpVersion)}/html/specialized_hardware_and_driver_enablement/kernel-module-management-operator`;
exports.getKmmDocsLink = getKmmDocsLink;
exports.ODF_LINK = 'https://www.redhat.com/en/resources/openshift-data-foundation-datasheet';
const getMceDocsLink = (ocpVersion) => `https://docs.redhat.com/en/documentation/openshift_container_platform/${getDocsOpenshiftVersion(ocpVersion)}/html/architecture/about-the-multicluster-engine-for-kubernetes-operator`;
exports.getMceDocsLink = getMceDocsLink;
const getLvmsDocsLink = (ocpVersion) => `https://docs.redhat.com/en/documentation/openshift_container_platform/${getDocsOpenshiftVersion(ocpVersion)}/html/storage/configuring-persistent-storage#overview-of-lvm-storage-functionality_ways-to-provision-local-storage`;
exports.getLvmsDocsLink = getLvmsDocsLink;
exports.NODE_HEALTHCHECK_LINK = 'https://docs.redhat.com/en/documentation/workload_availability_for_red_hat_openshift/latest/html/remediation_fencing_and_maintenance/node-health-check-operator';
exports.SELF_NODE_REMEDIATION_LINK = 'https://docs.redhat.com/en/documentation/workload_availability_for_red_hat_openshift/latest/html/remediation_fencing_and_maintenance/self-node-remediation-operator-remediate-nodes';
exports.FENCE_AGENTS_REMEDIATION_LINK = 'https://docs.redhat.com/en/documentation/workload_availability_for_red_hat_openshift/latest/html/remediation_fencing_and_maintenance/fence-agents-remediation-operator-remediate-nodes';
exports.NODE_MAINTENANCE_LINK = 'https://docs.redhat.com/en/documentation/workload_availability_for_red_hat_openshift/latest/html/remediation_fencing_and_maintenance/node-maintenance-operator';
const getKubeDeschedulerLink = (ocpVersion) => `https://docs.redhat.com/en/documentation/openshift_container_platform/${getDocsOpenshiftVersion(ocpVersion)}/html/nodes/controlling-pod-placement-onto-nodes-scheduling#descheduler`;
exports.getKubeDeschedulerLink = getKubeDeschedulerLink;
//Others
exports.REDHAT_CONSOLE_OPENSHIFT = 'https://console.redhat.com/openshift';
const getReportIssueLink = () => 'https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332330&issuetype=1&components=12370775';
exports.getReportIssueLink = getReportIssueLink;
exports.FEEDBACK_FORM_LINK = 'https://docs.google.com/forms/d/e/1FAIpQLSfg9M8wRW4m_HkWeAl6KpB5dTcMu8iI3iJ29GlLfZpF2hnjng/viewform';
exports.CHANGE_ISO_PASSWORD_FILE_LINK = 'https://raw.githubusercontent.com/openshift/assisted-service/master/docs/change-iso-password.sh';
const getCiscoIntersightLink = (downloadIsoUrl, ciscoUrl) => {
    if (ciscoUrl) {
        return `${ciscoUrl}?_workflow_Version=1&IsoUrl=${downloadIsoUrl}`;
    }
    return `https://www.intersight.com/an/workflow/workflow-definitions/execute/AddServersFromISO?_workflow_Version=1&IsoUrl=${downloadIsoUrl}`;
};
exports.getCiscoIntersightLink = getCiscoIntersightLink;
exports.MTV_LINK = 'https://docs.redhat.com/en/documentation/migration_toolkit_for_virtualization/2.7/';
exports.OPENSHIFT_AI_LINK = 'https://www.redhat.com/en/technologies/cloud-computing/openshift/openshift-ai';
exports.OSC_LINK = 'https://docs.redhat.com/en/documentation/openshift_sandboxed_containers';
const getMtuLink = (ocpVersion) => `https://docs.redhat.com/en/documentation/openshift_container_platform/${getDocsOpenshiftVersion(ocpVersion)}/html/networking/changing-cluster-network-mtu#nw-cluster-mtu-change-about_changing-cluster-network-mtu`;
exports.getMtuLink = getMtuLink;
exports.AUTHORINO_OPERATOR_LINK = 'https://github.com/Kuadrant/authorino-operator/blob/main/README.md';
const getLsoLink = (ocpVersion) => {
    const version = getDocsOpenshiftVersion(ocpVersion);
    return (0, utils_1.isMajorMinorVersionEqualOrGreater)(ocpVersion, '4.19')
        ? `https://docs.redhat.com/en/documentation/openshift_container_platform/${version}/html/storage/configuring-persistent-storage#persistent-storage-using-local-storage`
        : `https://docs.openshift.com/container-platform/${version}/storage/persistent_storage/persistent_storage_local/ways-to-provision-local-storage.html`;
};
exports.getLsoLink = getLsoLink;
const getNmstateLink = (ocpVersion) => {
    const version = getDocsOpenshiftVersion(ocpVersion);
    return (0, utils_1.isMajorMinorVersionEqualOrGreater)(ocpVersion, '4.17')
        ? `https://docs.redhat.com/en/documentation/openshift_container_platform/${version}/html/networking_operators/k8s-nmstate-about-the-k8s-nmstate-operator`
        : `https://docs.redhat.com/en/documentation/openshift_container_platform/4.17/html/networking_operators/k8s-nmstate-about-the-k8s-nmstate-operator`;
};
exports.getNmstateLink = getNmstateLink;
const getNodeFeatureDiscoveryLink = (ocpVersion) => `https://docs.redhat.com/en/documentation/openshift_container_platform/${getDocsOpenshiftVersion(ocpVersion)}/html/specialized_hardware_and_driver_enablement/psap-node-feature-discovery-operator`;
exports.getNodeFeatureDiscoveryLink = getNodeFeatureDiscoveryLink;
const getNvidiaGpuLink = (ocpVersion) => {
    const version = getDocsOpenshiftVersion(ocpVersion);
    return (0, utils_1.isMajorMinorVersionEqualOrGreater)(ocpVersion, '4.18')
        ? `https://docs.redhat.com/en/documentation/openshift_container_platform/${version}/html/virtualization/managing-vms#virt-configuring-virtual-gpus`
        : `https://docs.openshift.com/container-platform/${version}/virt/virtual_machines/advanced_vm_management/virt-configuring-virtual-gpus.html`;
};
exports.getNvidiaGpuLink = getNvidiaGpuLink;
exports.PIPELINES_OPERATOR_LINK = 'https://docs.redhat.com/en/documentation/red_hat_openshift_pipelines/1.18/html/installing_and_configuring/installing-pipelines';
exports.SERVICE_MESH_OPERATOR_LINK = 'https://docs.redhat.com/en/documentation/red_hat_openshift_service_mesh/3.0/html/installing/ossm-installing-service-mesh';
exports.SERVERLESS_OPERATOR_LINK = 'https://docs.redhat.com/en/documentation/red_hat_openshift_serverless/1.36/html/installing_openshift_serverless/install-serverless-operator#serverless-install-web-console_install-serverless-operator';
exports.KUBECONFIG_INFO_LINK = 'https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html/cli_tools/openshift-cli-oc#about-switches-between-cli-profiles_managing-cli-profiles';
const getOadpLink = (ocpVersion) => `https://docs.redhat.com/en/documentation/openshift_container_platform/${getDocsOpenshiftVersion(ocpVersion)}/html/backup_and_restore/oadp-application-backup-and-restore`;
exports.getOadpLink = getOadpLink;
const getMetalLbLink = (ocpVersion) => `https://docs.redhat.com/en/documentation/openshift_container_platform/${getDocsOpenshiftVersion(ocpVersion)}/html/networking_operators/metallb-operator`;
exports.getMetalLbLink = getMetalLbLink;
const getClusterObservabilityLink = (ocpVersion) => `https://docs.redhat.com/en/documentation/openshift_container_platform/${getDocsOpenshiftVersion(ocpVersion)}/html/cluster_observability_operator/cluster-observability-operator-overview`;
exports.getClusterObservabilityLink = getClusterObservabilityLink;
const getLokiLink = (ocpVersion) => `https://docs.redhat.com/en/documentation/openshift_container_platform/${getDocsOpenshiftVersion(ocpVersion)}/html/network_observability/network-observability-overview`;
exports.getLokiLink = getLokiLink;
const getOpenShiftLoggingLink = (ocpVersion) => `https://docs.redhat.com/en/documentation/openshift_container_platform/${getDocsOpenshiftVersion(ocpVersion)}/html/logging`;
exports.getOpenShiftLoggingLink = getOpenShiftLoggingLink;
const getNumaResourcesLink = (ocpVersion) => `https://docs.redhat.com/en/documentation/openshift_container_platform/${getDocsOpenshiftVersion(ocpVersion)}/html/scalability_and_performance/cnf-numa-aware-scheduling`;
exports.getNumaResourcesLink = getNumaResourcesLink;
//# sourceMappingURL=docs_links.js.map