apiVersion: xl/v2
kind: Blueprint
metadata:
  name: XL OP
  description: |
    This blueprint deploys Digital.ai Deploy operator, Digital.ai Release operator, and XL-k8s-foundation into an existing Kubernetes installation (local single-node Kubernetes, on-premises multi-node Kubernetes cluster, or Amazon EKS cluster).
  author: Digital.ai
  version: 1.0
spec:
  parameters:
    - name: ImageRegistryType
      type: Select
      prompt: "Select type of image registry:"
      options:
        - label: Default (Uses various public image registries for the installation images)
          value: default
        - label: Custom Public Registry (Uses a specific custom registry)
          value: public
        - label: Custom Private Registry - Password protected (Uses a specific custom registry with password)
          value: private
      promptIf: !expr "ProcessType == 'install' || ProcessType == 'upgrade'"
      ignoreIfSkipped: true
      saveInXlvals: true
      default: default
      description: |
        Select the type of the Image Registry to use for pulling all images required for the installation.
        When selecting a custom image registry, all prerequisite images need to be available in the image registry. 
    - name: IsCustomImageRegistry
      type: Confirm
      saveInXlvals: true
      ignoreIfSkipped: true
      value: !expr "ImageRegistryType == 'public' || ImageRegistryType == 'private'"
      description: Is Custom Image Repository
      default: false
    - name: CustomImageRegistryName
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr "IsCustomImageRegistry && (ProcessType == 'install' || ProcessType == 'upgrade')"
      prompt: "Enter the custom docker image registry name (eg: <imageRegistryName> from <imageRegistryName>/<repositoryName>/<imageName>:<tagName>):"
      description: Enter the custom image registry name for pulling all the images required for this installation
      default: docker.io
    - name: CustomPrivateImageRegistrySecret
      type: Select
      options:
        - !expr k8sResources(Namespace, 'secrets')
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide the custom docker image registry secret:"
      promptIf: !expr "(ImageRegistryType == 'private') && (ProcessType == 'install' || ProcessType == 'upgrade')"
      description: Provide the imagePullSecrets name for the custom image registry
    - name: RepositoryNameRelease
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr "ServerType == 'dai-release' && (ProcessType == 'install' || ProcessType == 'upgrade') && (K8sSetup == 'OpenshiftCertified' && IsCustomImageRegistry || K8sSetup != 'OpenshiftCertified')"
      prompt: "Enter the repository name for the Release application and operator images (eg: <repositoryName> from <repositoryName>/<imageName>:<tagName>):"
      description: Enter the repository name to use for the Release application and operator images
    - name: RepositoryNameDeploy
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr "ServerType == 'dai-deploy' && (ProcessType == 'install' || ProcessType == 'upgrade') && (K8sSetup == 'OpenshiftCertified' && IsCustomImageRegistry || K8sSetup != 'OpenshiftCertified')"
      prompt: "Enter the repository name for the Deploy application and operator images (eg: <repositoryName> from <repositoryName>/<imageName>:<tagName>):"
      description: Enter the repository name to use for the Deploy application and operator images
    - name: ImageNameDeploy
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr "ServerType == 'dai-deploy' && (ProcessType == 'install' || ProcessType == 'upgrade') && (K8sSetup == 'OpenshiftCertified' && IsCustomImageRegistry || K8sSetup != 'OpenshiftCertified')"
      prompt: "Enter the Deploy server image name (eg: <imageName> from <repositoryName>/<imageName>:<tagName>):"
      default: xl-deploy
      description: Enter the Deploy server image name to use. Choose the default value, unless using a custom image with different name.
    - name: ImageNameRelease
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr "ServerType == 'dai-release' && (ProcessType == 'install' || ProcessType == 'upgrade') && (K8sSetup == 'OpenshiftCertified' && IsCustomImageRegistry || K8sSetup != 'OpenshiftCertified')"
      prompt: "Enter the Release image name (eg: <imageName> from <repositoryName>/<imageName>:<tagName>):"
      default: xl-release
      description: Enter the Release server image name to use. Choose the default value, unless using a custom image with different name.
    - name: ImageTagRelease
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr "ServerType == 'dai-release' && (ProcessType == 'install' || ProcessType == 'upgrade') && (K8sSetup == 'OpenshiftCertified' && IsCustomImageRegistry || K8sSetup != 'OpenshiftCertified')"
      prompt: "Enter the Release application image tag (eg: <tagName> from <repositoryName>/<imageName>:<tagName>):"
      description: |
        Enter the Release application server image tag to use. The default value is the latest version.
        The available versions can be seen from docker hub repository tags for the image. Such as
        https://hub.docker.com/r/xebialabs/xl-release/tags      
    - name: ImageTagDeploy
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr "ServerType == 'dai-deploy' && (ProcessType == 'install' || ProcessType == 'upgrade') && (K8sSetup == 'OpenshiftCertified' && IsCustomImageRegistry || K8sSetup != 'OpenshiftCertified')"
      prompt: "Enter the Deploy application image tag (eg: <tagName> from <repositoryName>/<imageName>:<tagName>):"
      description: |
        Enter the Deploy application server image tag to use. The default value is the latest version. 
        The available versions can be seen from docker hub repository tags for the image. Such as
        https://hub.docker.com/r/xebialabs/xl-deploy/tags
        https://hub.docker.com/r/xebialabs/deploy-task-engine/tags
        https://hub.docker.com/r/xebialabs/central-configuration/tags
    - name: ImageNameDeployTaskEngine
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr "ServerType == 'dai-deploy' && !regex('^10.*$', ImageTagDeploy) && (ProcessType == 'install' || ProcessType == 'upgrade') && (K8sSetup == 'OpenshiftCertified' && IsCustomImageRegistry || K8sSetup != 'OpenshiftCertified')"
      prompt: "Enter the Deploy task engine image name for version 22 and above (eg: <imageName> from <repositoryName>/<imageName>:<tagName>):"
      default: deploy-task-engine
      description: Enter the Deploy task engine image name to use. Choose the default value, unless using a custom image with different name.
    - name: ImageNameCc
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr "ServerType == 'dai-deploy' && !regex('^10.*$', ImageTagDeploy) && (ProcessType == 'install' || ProcessType == 'upgrade') && (K8sSetup == 'OpenshiftCertified' && IsCustomImageRegistry || K8sSetup != 'OpenshiftCertified')"
      prompt: "Enter the Central Configuration image name for version 22 and above (eg: <imageName> from <repositoryName>/<imageName>:<tagName>):"
      default: central-configuration
      description: Enter the Central Configuration image name to use. Choose the default value, unless using a custom image with different name.
    - name: LicenseSource
      type: Select
      options:
        - label: Generate the license (accepting EULA, this is only for temporary license)
          value: generate
        - label: Path to the license file (the file can be in clean text or base64 encoded)
          value: file
        - label: Copy/Paste the license to editor (the text can be in clean text or base64 encoded)
          value: editor
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Select source of the license:"
      promptIf: !expr ServerType != 'dai-release-runner' && ProcessType == "install"
      description: |
        Provide source of the license file. Using generate option, the license is a temporary evaluation license
        and should not be used for production. The license file/content can be plain text or base64 encoded.
      default: generate
    - name: LicenseEditor
      type: Editor
      saveInXlvals: true
      ignoreIfSkipped: true
      prompt: "Provide license for the server:"
      promptIf: !expr ServerType != 'dai-release-runner' && ProcessType == "install" && LicenseSource == "editor"
      description: "Provide license for the server in the editor"
      default: ""
    - name: LicenseFile
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide license file for the server:"
      promptIf: !expr ServerType != 'dai-release-runner' && ProcessType == "install" && LicenseSource == "file"
      description: "Provide license file for the server. Input the path to the license file."
      validate: !expr "isFile(LicenseFile)"
      default: ""
    - name: License
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      description: Provide license file for the server
      value: !expr "LicenseSource == 'editor' ? ifBase64(LicenseEditor) : (LicenseSource == 'file' ? ifBase64(ifFileReadBytes(LicenseFile)) : '')"
    - name: XldMasterCount
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr "ServerType == 'dai-deploy' && ProcessType == 'install'"
      prompt: "Enter the Deploy master replica count:"
      default: 3
      description: "Enter the Deploy master server replica count. For production use 3 or above."
      validate: !expr "regex('^([1-9])+$', XldMasterCount)"
    - name: PvcSizeDeploy
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr "ServerType == 'dai-deploy' && ProcessType == 'install'"
      prompt: "Enter PVC size for Deploy master (Gi):"
      default: 10
      description: "Enter PVC size for Deploy master"
      validate: !expr "regex('^([0-9])+(\\.)?([0-9])*$', PvcSizeDeploy)"
    - name: AccessModeDeploy
      type: Select
      prompt: "Select between supported Access Modes for the Deploy application pods:"
      options:
        - label: ReadWriteOnce
          value: ReadWriteOnce
        - label: ReadWriteMany
          value: ReadWriteMany
      promptIf: !expr "ServerType == 'dai-deploy' && ProcessType == 'install'"
      ignoreIfSkipped: true
      saveInXlvals: true
      default: ReadWriteOnce
      description: |
        Select between supported Access Modes to define if the volume can be mounted as 
        read-write by a single node (ReadWriteOnce) or by many nodes (ReadWriteMany).
        For all Deploy pods ReadWriteOnce access mode is enough, the pods are not sharing the volumes.
        Note, the same access mode will apply to Deploy task engine and Central configuration also.
    - name: EnableSCC
      type: Confirm
      saveInXlvals: true
      overrideDefault: true
      ignoreIfSkipped: true
      default: false
      promptIf: !expr "regex('^Openshift.*', K8sSetup) && ServerType != 'dai-release-runner' && (ProcessType == 'install' || ProcessType == 'upgrade')"
      prompt: "Do you want to enable Security Context Constraints (SCCs)?"
      description: |
        Security Context Constraints are disabled by default for openshift. If you are upgrading from a setup that had SCCs enabled,
        select 'yes' or configure them manually to avoid pod failures.
    - name: XldWorkerCount
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr "ServerType == 'dai-deploy' && ProcessType == 'install'"
      prompt: "Enter the Deploy worker replica count:"
      default: 3
      description: Enter the Deploy worker replica count
      validate: !expr "regex('^([1-9])+$', XldWorkerCount)"
    - name: PvcSizeDeployTaskEngine
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr "ServerType == 'dai-deploy' && ProcessType == 'install'"
      prompt: "Enter PVC size for Deploy worker (Gi):"
      default: 10
      description: "Enter PVC size for Deploy worker"
      validate: !expr "regex('^([0-9])+(\\.)?([0-9])*$', PvcSizeDeployTaskEngine)"
    - name: XlrReplicaCount
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr "ServerType == 'dai-release' && ProcessType == 'install'"
      prompt: "Enter the Release server replica count:"
      default: 3
      description: Enter the Release server replica count
      validate: !expr "regex('^([1-9])+$', XlrReplicaCount)"
    - name: PvcSizeRelease
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr ServerType == 'dai-release' && ProcessType == 'install'
      prompt: "Enter PVC size for Release (Gi):"
      default: 8
      description: Enter PVC size for Release
      validate: !expr "regex('^([0-9])+(\\.)?([0-9])*$', PvcSizeRelease)"
    - name: AccessModeRelease
      type: Select
      prompt: "Select between supported Access Modes for the Release pods (use ReadWriteMany if you plan to use multiple pods):"
      options:
        - label: ReadWriteMany
          value: ReadWriteMany
        - label: ReadWriteOnce
          value: ReadWriteOnce
      promptIf: !expr "ServerType == 'dai-release' && ProcessType == 'install'"
      saveInXlvals: true
      ignoreIfSkipped: true
      default: ReadWriteMany
      description: |
        Select between supported Access Modes to define if the volume can be mounted as
        read-write by a single node (ReadWriteOnce) or by many nodes (ReadWriteMany).
        For the Release pods if you plan to use multiple pods on different nodes use ReadWriteMany,
        since the pods are sharing volumes.
    - name: StorageClass
      type: Select
      options:
        - !expr k8sResources(Namespace, 'storageclasses')
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide storage class for the server:"
      promptIf: !expr ServerType != 'dai-release-runner' && ProcessType == "install"
      description: Provide storage class for the server
    - name: ResourcesSource
      type: Select
      options:
        - label: Predefined resource values
          value: preset
        - label: Custom resource values
          value: editor
        - label: None
          value: none
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Select source of the resource values (CPU and memory):"
      promptIf: !expr ServerType != 'dai-release-runner' && ProcessType == "install"
      description: |
        Provide source of the resources (CPU and memory) requests and limits values for various containers.
        This type will be used for specifying resources for all the installation components.
        You can choose to enter the resources values either as a preset, where we choose from a
        predefined set of values or specify in editor the custom resource values for requests and limits.
        If none is selected, resources will not be specified and will need to be done manually.
        For example, if you select preset, the following prompts for specifying resource values
        will use the preset configurations. Similarly, if you select custom resource values, the 
        following prompts will use editor for specifying the custom resource values. If you choose
        none, there will no prompts for specifying resources.
        Note: In production, its recommended to have resource values specified through any of the options. 
      default: none
    - name: ResourcesPresetDeploy
      type: Select
      options:
        - label: Request - 500m cpu, 1Gi memory. Limit - 1.0 cpu, 2Gi memory
          value: nano
        - label: Request - 1.0 cpu, 2Gi memory. Limit - 2.0 cpu, 4Gi memory
          value: micro
        - label: Request - 2.0 cpu, 5Gi memory. Limit - 4.0 cpu, 8Gi memory
          value: small
        - label: Request - 5.0 cpu, 10Gi memory. Limit - 8.0 cpu, 16Gi memory
          value: medium
        - label: Request - 10.0 cpu, 21Gi memory. Limit - 16.0 cpu, 32Gi memory
          value: large
        - label: Request - 21.0 cpu, 42Gi memory. Limit - 32.0 cpu, 64Gi memory
          value: xlarge
        - label: Request - 42.0 cpu, 85Gi memory. Limit - 64.0 cpu, 128Gi memory
          value: 2xlarge                                                                     
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Select one of the predefined resource values for Deploy master:"
      promptIf: !expr ServerType == 'dai-deploy' && ProcessType == "install" && ResourcesSource == "preset"
      description: "Select one of the predefined resource values for Deploy master"
      default: nano
    - name: DefaultResourcesEditor
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      value: |-
        resources:
          requests:
            cpu:
            memory:
          limits:
            cpu:
            memory:      
      description: Default values for resources editor      
    - name: ResourcesEditorDeploy
      type: Editor
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide resource allocation for Deploy master:"
      promptIf: !expr ServerType == 'dai-deploy' && ProcessType == "install" && ResourcesSource == "editor"
      description: "Provide resource allocation (requests and limits values) for Deploy master"
      default: !expr DefaultResourcesEditor
    - name: ResourcesPresetDeployCc
      type: Select
      options:
        - label: Request - 250m cpu, 256Mi memory. Limit - 375m cpu, 384Mi memory
          value: nano
        - label: Request - 500m cpu, 512Mi memory. Limit - 750m cpu, 768Mi memory
          value: micro
        - label: Request - 500m cpu, 1Gi memory. Limit - 750m cpu, 1.5Gi memory
          value: small
        - label: Request - 1.0 cpu, 2Gi memory. Limit - 1.5 cpu, 3Gi memory
          value: medium
        - label: Request - 1.5 cpu, 4Gi memory. Limit - 3.0 cpu, 6Gi memory
          value: large
        - label: Request - 1.5 cpu, 4Gi memory. Limit - 6.0 cpu, 12Gi memory
          value: xlarge
        - label: Request - 1.5 cpu, 4Gi memory. Limit - 12.0 cpu, 24Gi memory
          value: 2xlarge
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Select one of the predefined resource values for Central Configuration:"
      promptIf: !expr ServerType == 'dai-deploy' && ProcessType == "install" && ResourcesSource == "preset"
      description: "Select one of the predefined resource values for Central Configuration"
      default: nano
    - name: ResourcesEditorDeployCc
      type: Editor
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide resource allocation for Central Configuration:"
      promptIf: !expr ServerType == 'dai-deploy' && ProcessType == "install" && ResourcesSource == "editor"
      description: "Provide resource allocation (requests and limits values) for Central Configuration"
      default: !expr DefaultResourcesEditor
    - name: ResourcesPresetDeployTaskEngine
      type: Select
      options:
        - label: Request - 500m cpu, 1Gi memory. Limit - 1.0 cpu, 2Gi memory
          value: nano
        - label: Request - 1.0 cpu, 2Gi memory. Limit - 2.0 cpu, 4Gi memory
          value: micro
        - label: Request - 2.0 cpu, 5Gi memory. Limit - 4.0 cpu, 8Gi memory
          value: small
        - label: Request - 5.0 cpu, 10Gi memory. Limit - 8.0 cpu, 16Gi memory
          value: medium
        - label: Request - 10.0 cpu, 21Gi memory. Limit - 16.0 cpu, 32Gi memory
          value: large
        - label: Request - 21.0 cpu, 42Gi memory. Limit - 32.0 cpu, 64Gi memory
          value: xlarge
        - label: Request - 42.0 cpu, 85Gi memory. Limit - 64.0 cpu, 128Gi memory
          value: 2xlarge                                                                     
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Select one of the predefined resource values for Deploy worker:"
      promptIf: !expr ServerType == 'dai-deploy' && ProcessType == "install" && ResourcesSource == "preset"
      description: "Select one of the predefined resource values for Deploy worker"
      default: nano         
    - name: ResourcesEditorDeployTaskEngine
      type: Editor
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide resource allocation for the Deploy worker:"
      promptIf: !expr ServerType == 'dai-deploy' && ProcessType == "install" && ResourcesSource == "editor"
      description: "Provide resource allocation (requests and limits values) for Deploy worker"
      default: !expr DefaultResourcesEditor
    - name: ResourcesPresetRelease
      type: Select
      options:
        - label: Request - 500m cpu, 1Gi memory. Limit - 1.0 cpu, 2Gi memory
          value: nano
        - label: Request - 1.0 cpu, 2Gi memory. Limit - 2.0 cpu, 4Gi memory
          value: micro
        - label: Request - 2.0 cpu, 5Gi memory. Limit - 4.0 cpu, 8Gi memory
          value: small
        - label: Request - 5.0 cpu, 10Gi memory. Limit - 8.0 cpu, 16Gi memory
          value: medium
        - label: Request - 10.0 cpu, 21Gi memory. Limit - 16.0 cpu, 32Gi memory
          value: large
        - label: Request - 21.0 cpu, 42Gi memory. Limit - 32.0 cpu, 64Gi memory
          value: xlarge
        - label: Request - 42.0 cpu, 85Gi memory. Limit - 64.0 cpu, 128Gi memory
          value: 2xlarge
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Select one of the predefined resource values for Release server:"
      promptIf: !expr ServerType == 'dai-release' && ProcessType == "install" && ResourcesSource == "preset"
      description: "Select one of the predefined resource values for Release server"
      default: nano
    - name: ResourcesEditorRelease
      type: Editor
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide resource allocation for Release server:"
      promptIf: !expr ServerType == 'dai-release' && ProcessType == "install" && ResourcesSource == "editor"
      description: "Provide resource allocation (requests and limits values) for Release server"
      default: !expr DefaultResourcesEditor
    - name: HttpProtocolRelease
      type: Select
      options:
        - label: HTTP - not encrypted
          value: http
        - label: HTTPS - Secure HTTP
          value: https
        - label: HTTP2 - Secure HTTP2
          value: http2
      prompt: "Select Release server protocol:"
      default: http
      promptIf: !expr "ServerType == 'dai-release' && ProcessType == 'install'"
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      description: |
        Select the application backend protocol. Ingress will connect using this backend protocol.
        When selecting https or http2, ssl is enabled for the application server. 
        And you will need to provide the ssl keystore with key, either through file, editor,
        kubernetes secret in the same namespace. Or you will need to use an autogenerated self-signed key.
        Note: This is only for the application server. The protocol for ingress will be selected later.
    - name: HttpProtocolDeploy
      type: Select
      options:
        - label: HTTP - not encrypted
          value: http
        - label: HTTPS - Secure HTTP
          value: https
      prompt: "Select Deploy server protocol:"
      default: http
      promptIf: !expr "ServerType == 'dai-deploy' && ProcessType == 'install'"
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      description: |
        Select the application backend protocol. Ingress will connect using this backend protocol.
        When selecting https, ssl is enabled for the application server.
        And you will need to provide the ssl keystore with key, either through file, editor,
        kubernetes secret in the same namespace. Or you will need to use autogenerated self-signed key.
        Note: This is only for the application server. The protocol for ingress will be selected later.
    - name: ApplicationKeystoreSource
      type: Select
      options:
        - label: The HTTPS keystore will be automatically generated with self-signed key
          value: generate
        - label: Path to the HTTPS keystore file (the file can be in the raw format or base64 encoded)
          value: file
        - label: Copy/Paste the HTTPS keystore to editor (the content needs to be base64 encoded)
          value: editor
        - label: Generic Secret containing HTTPS keystore file in PKCS12 or JKS format
          value: secret
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Select source of the HTTPS keystore for the server:"
      promptIf: !expr ServerType != 'dai-release-runner' && ProcessType == "install" && (HttpProtocolRelease != "http" || HttpProtocolDeploy != "http")
      description: |
        Provide source of the HTTPS keystore in PKCS12 or JKS format. The keystore should contain the server certificate and private key. 
        When selecting 'generate', a self-signed key will be generated for the server.
        If you want to use your own keystore, select 'file' or 'editor' or 'secret'. Use openssl or keytool to create the keystore.
        When selecting 'file', provide the path to the keystore file.
        When selecting 'editor', provide the keystore content in base64 encoded format. 
        When selecting 'secret', provide the generic secret name with the HTTPS keystore for the application server.
        eg. `kubectl create secret generic app-tls-secret --from-file=ssl-keystore.p12=ssl-keystore.p12 -n digitalai`
        And make sure the secret is already created in the same namespace.
      default: "generate"
      validate: !expr "ApplicationKeystoreSource == 'secret' ? length(k8sResources(Namespace, 'secrets')) > '0' : true"
    - name: ApplicationKeystoreEditor
      type: Editor
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide HTTPS keystore for the server:"
      promptIf: !expr "ServerType != 'dai-release-runner' && ProcessType == 'install' && ApplicationKeystoreSource == 'editor'"
      description: "Provide HTTPS keystore for the server in jks or pkcs12 format"
      default: ""
    - name: ApplicationKeystoreFile
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide HTTPS keystore file for the server:"
      promptIf: !expr ServerType != 'dai-release-runner' && ProcessType == 'install' && ApplicationKeystoreSource == 'file'
      description: Provide the HTTPS keystore file for the server
      validate: !expr "isFile(ApplicationKeystoreFile)"
      default: ""
    - name: ApplicationKeystoreSecretName
      type: Select
      options:
        - !expr k8sResources(Namespace, 'secrets')
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide the generic secret name with the application server HTTPS keystore added in PKCS12 or JKS format:"
      promptIf: !expr ServerType != 'dai-release-runner' && ProcessType == "install" && ApplicationKeystoreSource == 'secret'
      description: Provide the Generic secret name with the HTTPS keystore for the application server. It must be in PKCS12 or JKS format.
    - name: ApplicationKeystoreSecretKey
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide the key from the provided secret that has HTTPS keystore:"
      promptIf: !expr ServerType != 'dai-release-runner' && ProcessType == "install" && ApplicationKeystoreSource == 'secret'
      description: From the provided Generic secret provide key which contains the HTTPS keystore. It must be in PKCS12 or JKS format.
    - name: ApplicationKeystore
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      description: Provide the application server HTTPS keystore
      value: !expr "ApplicationKeystoreSource == 'editor' ? ifBase64(ApplicationKeystoreEditor) : ifBase64(ifFileReadBytes(ApplicationKeystoreFile))"
      default: ""
    - name: ApplicationKeystoreType
      type: Select
      options:
        - label: PKCS12
          value: pkcs12
        - label: JKS
          value: jks
      saveInXlvals: true
      ignoreIfSkipped: true
      prompt: "Provide the application server HTTPS keystore format:"
      description: Provide the application server HTTPS keystore type
      promptIf: !expr ServerType != 'dai-release-runner' && ProcessType == "install" && (HttpProtocolRelease != "http" || HttpProtocolDeploy != "http")
      default: "pkcs12"
    - name: ApplicationKeystorePassword
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      allowEmpty: true
      overrideDefault: true
      prompt: "Provide the server HTTPS keystore password:"
      promptIf: !expr ServerType != 'dai-release-runner' && ProcessType == "install" && (HttpProtocolRelease != "http" || HttpProtocolDeploy != "http")
      description: Passphrase for the application server HTTPS keystore
      default: !expr "ApplicationKeystoreSource == 'generate' ? randPassword() : ''"
    - name: IngressTypeGeneric
      type: Select
      prompt: "Select between supported ingress types:"
      options:
        - label: Ingress NGINX controller (experimental/non-production)
          value: ingress-nginx-controller
        - label: NGINX Ingress Bitnami Helm Chart (deprecated)
          value: nginx
        - label: HAProxy Helm Chart (deprecated)
          value: haproxy
        - label: External - IngressClass resource should already exist
          value: external
        - label: None - Ingress will not be set up during installation
          value: none
      promptIf: !expr "!(regex('^Openshift.*', K8sSetup)) && ServerType != 'dai-release-runner' && ProcessType == 'install'"
      saveInXlvals: true
      default: nginx
      description: |
        Select between supported ingress types. If None is selected, the application will not be exposed
        and therefore will not be accessible from the browser.
      validate: !expr "regex('.*external.*', IngressTypeGeneric) ? length(k8sResources(Namespace, 'ingressclasses')) > '0' : true"
    - name: IngressTypeOpenshift
      type: Select
      prompt: "Select between supported ingress types:"
      options:
        - label: Openshift Route
          value: route
        - label: Ingress NGINX controller (experimental/non-production)
          value: ingress-nginx-controller
        - label: NGINX Bitnami Helm Chart (deprecated)
          value: nginx
        - label: HAProxy Helm Chart (deprecated)
          value: haproxy
        - label: External - IngressClass resource should already exist
          value: external
        - label: None - Ingress will not be set up during installation
          value: none
      promptIf: !expr "regex('^Openshift.*', K8sSetup) && ServerType != 'dai-release-runner' && ProcessType == 'install'"
      saveInXlvals: true
      default: route
      description: |
        Select between supported ingress types. or just use Openshift Route which is supported by default in openshift.
        If None is selected, the application will not be exposed and therefore will not be accessible from the browser.
      validate: !expr "regex('.*external.*', IngressTypeOpenshift) ? length(k8sResources(Namespace, 'ingressclasses')) > '0' : true"
    - name: IngressType
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      value: !expr "regex('^Openshift.*', K8sSetup) ? IngressTypeOpenshift : IngressTypeGeneric"
      description: |
        Select between supported ingress types. If None is selected, the application will not be exposed
        and therefore will not be accessible from the browser.
    - name: NginxResourcesPreset
      type: Select
      options:
        - label: Request - 100m cpu, 128Mi memory. Limit - 150m cpu, 192Mi memory
          value: nano
        - label: Request - 250m cpu, 256Mi memory. Limit - 375m cpu, 384Mi memory
          value: micro
        - label: Request - 500m cpu, 512Mi memory. Limit - 750m cpu, 768Mi memory
          value: small
        - label: Request - 500m cpu, 1024Mi memory. Limit - 750m cpu, 1536Mi memory
          value: medium
        - label: Request - 1.0 cpu, 2048Mi memory. Limit - 1.5 cpu, 3072Mi memory
          value: large
        - label: Request - 1.5 cpu, 4096Mi memory. Limit - 3.0 cpu, 6144Mi memory
          value: xlarge
        - label: Request - 1.5 cpu, 4096Mi memory. Limit - 6.0 cpu, 12288Mi memory
          value: 2xlarge
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Select one of the predefined resource values for Nginx ingress:"
      promptIf: !expr ServerType != 'dai-release-runner' && ProcessType == "install" && IngressType == "nginx" && ResourcesSource == "preset"
      description: "Select one of the predefined resource values for Nginx ingress"
      default: nano
    - name: NginxResourcesEditor
      type: Editor
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide resource allocation for Nginx ingress:"
      promptIf: !expr ServerType != 'dai-release-runner' && ProcessType == "install" && IngressType == "nginx" && ResourcesSource == "editor"
      description: "Provide resource allocation (requests and limits values) for Nginx ingress"
      default: !expr DefaultResourcesEditor
    - name: HAProxyResourcesEditor
      type: Editor
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide resource allocation for HAProxy ingress:"
      promptIf: !expr ServerType != 'dai-release-runner' && ProcessType == "install" && IngressType == "haproxy" && ResourcesSource != "none"
      description: "Provide resource allocation (requests and limits values) for HAProxy ingress"
      default: !expr DefaultResourcesEditor
    - name: ExternalIngressClass
      type: Select
      options:
        - !expr k8sResources(Namespace, 'ingressclasses')
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide external ingress class:"
      promptIf: !expr ServerType != 'dai-release-runner' && ProcessType == "install" && IngressType == "external"
      description: Select from an already available External ingress class
    - name: HttpProtocolIngress
      type: Select
      options:
        - label: HTTP - not encrypted
          value: http
        - label: HTTPS - enable an TLS/SSL ingress configuration
          value: https
      prompt: "Select ingress protocol:"
      default: !expr "ServerType == 'dai-release' ? HttpProtocolRelease : HttpProtocolDeploy"
      promptIf: !expr "ServerType != 'dai-release-runner' && ProcessType == 'install' && IngressType != 'none' && HttpProtocolRelease == 'http' && HttpProtocolDeploy == 'http'"
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      description: |
        Select the ingress protocol, for https you will need to provide the ssl keystore with key,
        or you will need to use autogenerated self-signed key. 
        Refer documentation on 'Configure SSL/TLS in kubernetes environment' for more details.
    - name: IngressKeystoreSourceGeneric
      type: Select
      options:
        - label: The ingress keystore will be automatically generated with self-signed key
          value: generate
        - label: TLS Secret containing tls key and cert
          value: secret
        - label: SSL passthrough (Cannot be chosen with backend protocol as http. It will pass the traffic to the backend without decryption. Application ssl keystore should be configured)
          value: passthrough
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Select source of the secure ingress keystore:"
      promptIf: !expr "!(regex('^Openshift.*', K8sSetup)) && ServerType != 'dai-release-runner' && ProcessType == 'install' && IngressType != 'haproxy' && IngressType != 'none' && HttpProtocolIngress != 'http' && ((ServerType=='dai-release' && HttpProtocolRelease != 'http') || (ServerType=='dai-deploy' && HttpProtocolDeploy != 'http'))"
      description: |
        Provide source of the ingress keystore. 
        If you select secret, provide the tls secret.
        Like `kubectl create secret tls ingress-tls-secret --key=server.key --cert=server.crt`
        If you select passthrough, the traffic will be passed onto the backend for ssl decryption.
      default: "generate"
      validate: !expr "IngressKeystoreSourceGeneric == 'secret' ? (length(k8sResources(Namespace, 'secrets')) > '0') : (IngressKeystoreSourceGeneric == 'passthrough' ? (HttpProtocolRelease != 'http' || HttpProtocolDeploy != 'http') : true)"
    - name: IngressKeystoreSourceNoPassthrough
      type: Select
      options:
        - label: The ingress keystore will be automatically generated with self-signed key
          value: generate
        - label: TLS Secret containing tls key and cert
          value: secret
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Select source of the secure ingress keystore:"
      promptIf: !expr "!(regex('^Openshift.*', K8sSetup)) && ServerType != 'dai-release-runner' && ProcessType == 'install' && HttpProtocolIngress != 'http' && ( IngressType == 'haproxy' || ( IngressType != 'none' && IngressType != 'haproxy' && ((ServerType == 'dai-release' && HttpProtocolRelease == 'http') || (ServerType == 'dai-deploy' && HttpProtocolDeploy == 'http')) ) )"
      description: |
        Provide source of the ingress keystore.
        If you select secret, provide the tls secret.
        Like `kubectl create secret tls ingress-tls-secret --key=server.key --cert=server.crt`
      default: "generate"
      validate: !expr "IngressKeystoreSourceNoPassthrough == 'secret' ? (length(k8sResources(Namespace, 'secrets')) > '0') : true"
    - name: IngressKeystoreSourceOpenshiftHttp
      type: Select
      options:
        - label: Use route default certificate
          value: default
        - label: The keystore will be automatically generated with self-signed key
          value: generate
        - label: TLS Secret containing tls key and cert
          value: secret
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Select source of the keystore for the route:"
      promptIf: !expr "regex('^Openshift.*', K8sSetup) && ServerType != 'dai-release-runner' && ProcessType == 'install' && IngressType != 'none' && HttpProtocolIngress != 'http' && (ServerType == 'dai-release' && HttpProtocolRelease == 'http' || ServerType == 'dai-deploy' && HttpProtocolDeploy == 'http')"
      description: |
        Provide source of the ingress keystore.
        If you select default, the route will use its default certificate.
        If you select secret, provide the tls secret.
        Like `kubectl create secret tls ingress-tls-secret --key=server.key --cert=server.crt`
      default: "default"
      validate: !expr "IngressKeystoreSourceOpenshiftHttp == 'secret' ? (length(k8sResources(Namespace, 'secrets')) > '0') : (IngressKeystoreSourceOpenshiftHttp == 'passthrough' ? (HttpProtocolRelease != 'http' || HttpProtocolDeploy != 'http') : true)"
    - name: IngressKeystoreSourceOpenshiftHttps
      type: Select
      options:
        - label: SSL passthrough (It will pass the traffic to the backend without decryption)
          value: passthrough
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Select source of the keystore for the secure route (only passthrough is supported in case of the secure backend):"
      promptIf: !expr "regex('^Openshift.*', K8sSetup) && ServerType != 'dai-release-runner' && ProcessType == 'install' && IngressType != 'none' && HttpProtocolIngress != 'http' && (ServerType == 'dai-release' && HttpProtocolRelease != 'http' || ServerType == 'dai-deploy' && HttpProtocolDeploy != 'http')"
      description: "Provide source of the ingress keystore"
      default: "passthrough"
      validate: !expr "IngressKeystoreSourceOpenshiftHttps == 'secret' ? (length(k8sResources(Namespace, 'secrets')) > '0') : (IngressKeystoreSourceOpenshiftHttps == 'passthrough' ? (HttpProtocolRelease != 'http' || HttpProtocolDeploy != 'http') : true)"
    - name: IngressKeystoreSourceOpenshift
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      value: !expr "regex('^Openshift.*', K8sSetup) && ServerType != 'dai-release-runner' && ProcessType == 'install' && IngressType != 'none' && HttpProtocolIngress != 'http' && (ServerType == 'dai-release' && HttpProtocolRelease != 'http' || ServerType == 'dai-deploy' && HttpProtocolDeploy != 'http') ? IngressKeystoreSourceOpenshiftHttps : IngressKeystoreSourceOpenshiftHttp"
      description: "Provide source of the ingress keystore"
    - name: IngressKeystoreSource
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      value: !expr "regex('^Openshift.*', K8sSetup) ? IngressKeystoreSourceOpenshift : ((IngressType == 'haproxy' || (IngressType != 'none' && IngressType != 'haproxy' && ((ServerType=='dai-release' && HttpProtocolRelease == 'http') || (ServerType=='dai-deploy' && HttpProtocolDeploy == 'http')))) ? IngressKeystoreSourceNoPassthrough : IngressKeystoreSourceGeneric)"
      description: Select between supported ingress keystore sources.
    - name: IngressHost
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide DNS name for accessing UI of the server:"
      promptIf: !expr ServerType != 'dai-release-runner' && ProcessType == "install" && (IngressType != "none" || ServerType == 'dai-release')
      description: |
        Provide DNS name for accessing UI of the server. For OpenShift, this is used with Routing,
        while for other providers this is set up only when Ingress is used.
      validate: !expr "regex('^[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}$', IngressHost)"
    - name: HttpsProtocol
      type: Confirm
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "The access to the Release host will be secured externally with HTTPS protocol:"
      promptIf: !expr ServerType == 'dai-release' && ProcessType == "install" && IngressType == "none" && HttpProtocolRelease == "http"
      description: |
        Select true if the HTTPS protocol will be used that is setup somewhere externally,
        the server URL will start with https.
    - name: IngressTlsSecretName
      type: Select
      options:
        - !expr k8sResources(Namespace, 'secrets')
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide the TLS secret name with the key and certificate:"
      promptIf: !expr ServerType != 'dai-release-runner' && ProcessType == "install" && IngressType != "none" && HttpProtocolIngress != "http" && IngressKeystoreSource == "secret"
      description: Provide the TLS secret name with the key and certificate which was created earlier.
    - name: IngressNginxControllerClean
      type: Confirm
      saveInXlvals: true
      promptIf: !expr (ServerType == 'dai-deploy' || ServerType == 'dai-release') && (CleanBefore || ProcessType == 'clean') && length(k8sResources(Namespace, 'deployment', 'ingress-nginx-controller')) > '0'
      prompt: "Clean IngressNginx Controller?:"
      description: "Type yes to delete IngressNginx Controller installation. The cleanup will be performed alongside at the end of cleanup process. Please note that this will delete all related resources if the controller is shared between applications"
      default: false
    - name: AdminPassword
      type: Input
      saveInXlvals: true
      overrideDefault: true
      prompt: "Provide administrator password:"
      promptIf: !expr ServerType != 'dai-release-runner' && ProcessType == "install"
      description: Administrator password
      default: !expr "randPassword()"
    - name: OidcConfigTypeInstall
      type: Select
      options:
        - label: No OIDC Configuration
          value: no-oidc
        - label: External OIDC Configuration
          value: external
        - label: Identity Service Configuration
          value: identity-service
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Type of the OIDC configuration:"
      promptIf: !expr ServerType != 'dai-release-runner' && ProcessType == "install"
      description: |
        Provide the type of the OIDC configuration. Based on the type, you will be providing the OIDC configuration.
      default: no-oidc
    - name: OidcConfigTypeUpgrade
      type: Select
      options:
        - label: Existing OIDC Configuration
          value: existing
        - label: No OIDC Configuration
          value: no-oidc
        - label: External OIDC Configuration
          value: external
        - label: Identity Service Configuration
          value: identity-service
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Type of the OIDC configuration:"
      promptIf: !expr ServerType != 'dai-release-runner' && ProcessType == "upgrade"
      description: |
        Provide the type of the OIDC configuration. Based on the type, you will be providing the OIDC configuration
        or using the existing OIDC configuration.
      default: existing
    - name: OidcConfigType
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      value: !expr "ProcessType == 'install' ? OidcConfigTypeInstall : OidcConfigTypeUpgrade"
      description: The type of the OIDC configuration
    - name: ExternalOidcConfGenericDeploy
      type: Editor
      prompt: "Configure external oidc setup:"
      promptIf: !expr ServerType == 'dai-deploy' && OidcConfigType == 'external' && (ProcessType == 'install' || ProcessType == 'upgrade')
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      default: |-
        accessTokenUri: ""
        clientId: ""
        clientSecret: ""
        emailClaim: ""
        issuer: ""
        keyRetrievalUri: ""
        logoutUri: ""
        postLogoutRedirectUri: ""
        redirectUri: ""
        rolesClaimName: ""
        userAuthorizationUri: ""
        userNameClaimName: ""
        fullNameClaim: ""
        scopes: '["openid"]'
      description: The external OIDC configuration
    - name: ExternalOidcConfGenericRelease
      type: Editor
      prompt: "Configure external oidc setup:"
      promptIf: !expr ServerType == 'dai-release' && OidcConfigType == 'external' && (ProcessType == 'install' || ProcessType == 'upgrade')
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      default: |-
        accessTokenUri: ""
        clientId: ""
        clientSecret: ""
        emailClaim: ""
        fullNameClaim: ""
        issuer: ""
        keyRetrievalUri: ""
        logoutUri: ""
        postLogoutRedirectUri: ""
        redirectUri: ""
        rolesClaim: ""
        userAuthorizationUri: ""
        userNameClaim: ""
        scopes: '["openid"]'
      description: The external OIDC configuration
    - name: ExternalOidcConfGeneric
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      value: !expr "OidcConfigType == 'external' ? (ServerType == 'dai-deploy' ? ExternalOidcConfGenericDeploy : ExternalOidcConfGenericRelease) : ''"
      description: The external OIDC configuration
    - name: IdentityServiceConfDeploy
      type: Editor
      prompt: "Configure Identity Service setup:"
      promptIf: !expr ServerType == 'dai-deploy' && OidcConfigType == 'identity-service' && (ProcessType == 'install' || ProcessType == 'upgrade')
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      default: |-
        clientId: ""
        clientSecret: ""
        issuer: ""
        redirectUri: ""
        postLogoutRedirectUri: ""
        rolesClaimName: ""
        userNameClaimName: "preferred_username"
        scopes: ["openid"]
      description: The identity service OIDC configuration
    - name: IdentityServiceConfRelease
      type: Editor
      prompt: "Configure Identity Service setup:"
      promptIf: !expr ServerType == 'dai-release' && OidcConfigType == 'identity-service' && (ProcessType == 'install' || ProcessType == 'upgrade')
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      default: |-
        clientId: ""
        clientSecret: ""
        issuer: ""
        redirectUri: ""
        postLogoutRedirectUri: ""
        rolesClaim: ""
        userNameClaim: "preferred_username"
        scopes: ["openid"]
      description: The identity service OIDC configuration
    - name: IdentityServiceConf
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      value: !expr "OidcConfigType == 'identity-service' ? (ServerType == 'dai-deploy' ? IdentityServiceConfDeploy : IdentityServiceConfRelease) : ''"
      description: The identity service OIDC configuration
    - name: ExternalOidcConf
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      value: !expr "OidcConfigType == 'identity-service' ? IdentityServiceConf : (OidcConfigType == 'external' ? ExternalOidcConfGeneric : 'external: false')"
      description: The external OIDC configuration based on OIDC type. No OIDC Configuration will have disabled external OIDC setup
    - name: OperatorImageDeploy
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Enter the operator image to use (eg: <imageName> from <repositoryName>/<imageName>:<tagName>):"
      promptIf: !expr "K8sSetup != 'OpenshiftCertified' && ServerType == 'dai-deploy' && (ProcessType == 'install' || ProcessType == 'upgrade')"
      default: deploy-operator
      description: Enter the Deploy operator image to use. Choose the default value, unless using a custom image with different name.
    - name: OperatorImageRelease
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Enter the operator image to use (eg: <imageName> from <repositoryName>/<imageName>:<tagName>):"
      promptIf: !expr "K8sSetup != 'OpenshiftCertified' && ServerType == 'dai-release' && (ProcessType == 'install' || ProcessType == 'upgrade')"
      default: release-operator
      description: Enter the Release operator image to use. Choose the default value, unless using a custom image with different name.
    - name: OperatorImageTagRelease
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr "K8sSetup != 'OpenshiftCertified' && ServerType == 'dai-release' && (ProcessType == 'install' || ProcessType == 'upgrade')"
      prompt: "Enter the Release operator image tag (eg: <tagName> from <repositoryName>/<imageName>:<tagName>):"
      description: | 
        Enter the Release operator image tag to use. The default is the latest tag.
        The available versions can be seen from docker hub repository tags for the image. Such as
        https://hub.docker.com/r/xebialabs/release-operator/tags
    - name: OperatorImageTagDeploy
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr "K8sSetup != 'OpenshiftCertified' && ServerType == 'dai-deploy' && (ProcessType == 'install' || ProcessType == 'upgrade')"
      prompt: "Enter the Deploy operator image tag (eg: <tagName> from <repositoryName>/<imageName>:<tagName>):"
      description: | 
        Enter the Deploy operator image tag to use. The default is the latest tag. 
        The available versions can be seen from docker hub repository tags for the image. Such as
        https://hub.docker.com/r/xebialabs/deploy-operator/tags
    - name: RepositoryKeystoreSource
      type: Select
      options:
        - label: Generate the repository keystore during installation (you need to have keytool utility installed in your path)
          value: generate
        - label: Path to the repository keystore file (the file can be in the raw format or base64 encoded)
          value: file
        - label: Copy/Paste the repository keystore to editor (the content needs to be base64 encoded)
          value: editor
        - label: Default repository keystore
          value: default        
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Select source of the repository keystore:"
      promptIf: !expr ServerType != 'dai-release-runner' && ProcessType == "install"
      description: |
        Provide source of the repository keystore file.
        Selecting generate will create a new repository keystore.
        Selecting file and editor option will require to input the repository keystore.
        Selecting default option will use the default internal repository keystore.
      default: generate
    - name: RepositoryKeystoreEditor
      type: Editor
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide repository keystore for the server:"
      promptIf: !expr "ProcessType == 'install' && RepositoryKeystoreSource == 'editor'"
      description: "Provide repository keystore for the server, generated with: `keytool -genseckey -alias deployit-passsword-key -keyalg aes -keysize 128 -keypass deployit -keystore repository-keystore.jceks -storetype jceks -storepass <KeystorePassphrase>`"
      default: ""
    - name: RepositoryKeystoreFile
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide repository keystore for the server:"
      promptIf: !expr "ProcessType == 'install' && RepositoryKeystoreSource == 'file'"
      description: |
        Provide repository keystore for the server, generated with:
        `keytool -genseckey -alias deployit-passsword-key -keyalg aes -keysize 128 -keypass deployit -keystore repository-keystore.jceks -storetype jceks -storepass <KeystorePassphrase>`
      validate: !expr "isFile(RepositoryKeystoreFile)"
      default: ""
    - name: RepositoryKeystore
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      description: Provide repository keystore for the server
      value: !expr "RepositoryKeystoreSource == 'default' ? '' : (RepositoryKeystoreSource == 'editor' ? ifBase64(RepositoryKeystoreEditor) : ifBase64(ifFileReadBytes(RepositoryKeystoreFile)))"
    - name: KeystorePassphrase
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide repository keystore passphrase:"
      promptIf: !expr ServerType != 'dai-release-runner' && ProcessType == "install" && RepositoryKeystoreSource != 'default'
      description: Enter the Repository keystore passphrase
      default: !expr "RepositoryKeystoreSource == 'generate' ? randPassword() : ''"
    - name: PostgresqlInstall
      type: Select
      options:
        - label: CloudNativePG Operator (experimental/non-production)
          value: operator
        - label: Bitnami Helm Chart (deprecated)
          value: chart
        - label: External Postgresql
          value: external
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Do you want to install a new Postgresql on the cluster:"
      promptIf: !expr "ServerType != 'dai-release-runner' && ProcessType == 'install'"
    - name: PostgresqlStorageClass
      type: Select
      options:
        - !expr k8sResources(Namespace, 'storageclasses')
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide Storage Class to be defined for PostgreSQL:"
      promptIf: !expr ProcessType == "install" && (PostgresqlInstall == "chart" || PostgresqlInstall == "operator")
      description: |
        Provide Storage Class to be defined for PostgreSQL that should be available in the cluster.
        The storage class needs to support minimally ReadWriteOnce access mode.
    - name: PostgresqlPvcSize
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide PVC size for PostgreSQL (Gi):"
      promptIf: !expr ProcessType == "install" && (PostgresqlInstall == "chart" || PostgresqlInstall == "operator")
      default: 8
      description: Provide PVC size for PostgreSQL
      validate: !expr "regex('^([0-9])+(\\.)?([0-9])*$', PostgresqlPvcSize)"
    - name: PostgresqlResourcesPreset
      type: Select
      options:
        - label: Request - 100m cpu, 128Mi memory. Limit - 150m cpu, 192Mi memory
          value: nano
        - label: Request - 250m cpu, 256Mi memory. Limit - 375m cpu, 384Mi memory
          value: micro
        - label: Request - 500m cpu, 512Mi memory. Limit - 750m cpu, 768Mi memory
          value: small
        - label: Request - 500m cpu, 1024Mi memory. Limit - 750m cpu, 1536Mi memory
          value: medium
        - label: Request - 1.0 cpu, 2048Mi memory. Limit - 1.5 cpu, 3072Mi memory
          value: large
        - label: Request - 1.5 cpu, 4096Mi memory. Limit - 3.0 cpu, 6144Mi memory
          value: xlarge
        - label: Request - 1.5 cpu, 4096Mi memory. Limit - 6.0 cpu, 12288Mi memory
          value: 2xlarge                                                                    
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Select one of the predefined resource values for Postgresql:"
      promptIf: !expr ProcessType == "install" && ResourcesSource == "preset" && (PostgresqlInstall == "chart" || PostgresqlInstall == "operator")
      description: "Select one of the predefined resource values for Postgresql"
      default: nano
    - name: PostgresqlResourcesEditor
      type: Editor
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide resource allocation for Postgresql:"
      promptIf: !expr ProcessType == "install" && ResourcesSource == "editor" && (PostgresqlInstall == "chart" || PostgresqlInstall == "operator")
      description: "Provide resource allocation (requests and limits values) for Postgresql"
      default: !expr DefaultResourcesEditor
    - name: PostgresqlExternalConfigRelease
      type: Editor
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Edit database external setup:"
      promptIf: !expr "ServerType == 'dai-release' && ProcessType == 'install' && (PostgresqlInstall == 'external')"
      description: |
        Setup the external DB parameters (such as JDBC URL, DB username, DB password).
        Any of the supported external DB can be used. Modify the jdbc url accordingly.
      default: |-
        main:
          url: jdbc:postgresql://<xlr-db-host>:5432/<xlr-database-name>
          username: <xlr-username>
          password: |-
            <xlr-password>
          maxPoolSize: 10
        report:
          url: jdbc:postgresql://<xlr-report-db-host>:5432/<xlr-report-database-name>
          username: <xlr-report-username>
          password: |-
            <xlr-report-password>
          maxPoolSize: 10
    - name: PostgresqlExternalConfigDeploy
      type: Editor
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Edit database external setup:"
      promptIf: !expr "ServerType == 'dai-deploy' && ProcessType == 'install' && (PostgresqlInstall == 'external')"
      description: |
        Setup the external DB parameters (such as JDBC URL, DB username, DB password).
        Any of the supported external DB can be used. Modify the jdbc url accordingly.
      default: |-
        main:
          url: jdbc:postgresql://<xld-db-host>:5432/<xld-database-name>
          username: <xld-username>
          password: |-
            <xld-password>
          maxPoolSize: 10
        report:
          url: jdbc:postgresql://<xld-report-db-host>:5432/<xld-report-database-name>
          username: <xld-report-username>
          password: |-
            <xld-report-password>
          maxPoolSize: 10
    - name: PostgresqlOperatorClean
      type: Confirm
      saveInXlvals: true
      promptIf: !expr (ServerType == 'dai-release' || ServerType == 'dai-deploy') && (CleanBefore || ProcessType == 'clean') && length(k8sResources(Namespace, 'deployment', 'cnpg-controller-manager')) > '0'
      prompt: "Clean Postgresql Operator?:"
      description: "Type yes to delete Postgresql Operator installation. The cleanup will be performed alongside at the end of cleanup process. Please note that this will delete all related resources if the operator is shared between applications"
      default: false
    - name: RabbitmqInstall
      type: Select
      options:
        - label: RabbitMQ Cluster Operator (experimental/non-production)
          value: operator
        - label: Bitnami Helm Chart (deprecated)
          value: chart
        - label: External RabbitMQ
          value: external
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Do you want to install a new RabbitMQ on the cluster:"
      promptIf: !expr "ServerType != 'dai-release-runner' && ServerType != 'dai-release' && ProcessType == 'install'"
    - name: RabbitmqReplicaCount
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Replica count to be defined for RabbitMQ:"
      default: 3
      promptIf: !expr "ProcessType == 'install' && (RabbitmqInstall == 'chart' || RabbitmqInstall == 'operator')"
      description: Replica count to be defined for RabbitMQ
      validate: !expr "regex('^([1-9])+$', RabbitmqReplicaCount)"
    - name: RabbitmqStorageClass
      type: Select
      options:
        - !expr k8sResources(Namespace, 'storageclasses')
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Storage Class to be defined for RabbitMQ:"
      default: !expr StorageClass
      promptIf: !expr "ProcessType == 'install' && (RabbitmqInstall == 'chart' || RabbitmqInstall == 'operator')"
      description: |
        Storage Class to be defined for RabbitMQ.
        The storage class needs to support minimally ReadWriteOnce access mode.
    - name: RabbitmqPvcSize
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide PVC size for RabbitMQ (Gi):"
      default: 8
      promptIf: !expr "ProcessType == 'install' && (RabbitmqInstall == 'chart' || RabbitmqInstall == 'operator')"
      description: Provide PVC size for RabbitMQ
      validate: !expr "regex('^([0-9])+(\\.)?([0-9])*$', RabbitmqPvcSize)"
    - name: RabbitmqResourcesPreset
      type: Select
      options:
        - label: Request - 100m cpu, 128Mi memory. Limit - 150m cpu, 192Mi memory
          value: nano
        - label: Request - 250m cpu, 256Mi memory. Limit - 375m cpu, 384Mi memory
          value: micro
        - label: Request - 500m cpu, 512Mi memory. Limit - 750m cpu, 768Mi memory
          value: small
        - label: Request - 500m cpu, 1024Mi memory. Limit - 750m cpu, 1536Mi memory
          value: medium
        - label: Request - 1.0 cpu, 2048Mi memory. Limit - 1.5 cpu, 3072Mi memory
          value: large
        - label: Request - 1.5 cpu, 4096Mi memory. Limit - 3.0 cpu, 6144Mi memory
          value: xlarge
        - label: Request - 1.5 cpu, 4096Mi memory. Limit - 6.0 cpu, 12288Mi memory
          value: 2xlarge                                                                    
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Select one of the predefined resource values for Rabbitmq:"
      promptIf: !expr ProcessType == "install" && ResourcesSource == "preset" && (RabbitmqInstall == 'chart' || RabbitmqInstall == 'operator')
      description: "Select one of the predefined resource values for Rabbitmq"
      default: nano
    - name: RabbitmqResourcesEditor
      type: Editor
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide resource allocation for Rabbitmq:"
      promptIf: !expr ProcessType == "install" && ResourcesSource == "editor" && (RabbitmqInstall == 'external')
      description: "Provide resource allocation (requests and limits values) for Rabbitmq"
      default: !expr DefaultResourcesEditor
    - name: RabbitmqExternalConfigDeploy
      type: Editor
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Edit RabbitMQ external setup:"
      promptIf: !expr "ServerType == 'dai-deploy' && ProcessType == 'install' && (RabbitmqInstall == 'external')"
      description: |
        Setup the external RabbitMQ or ActiveMQ parameters (such as queue url, queue name, credentials).
        Any of the supported external MQ can be used. Modify the driver class accordingly.
      default: |-
        url: <queue-url>
        queueName: <queue-name>
        username: <username>
        password: |-
          <password>
        driverClassName: <driver-class-name>
        queueType: <classic-or-quorum>
    - name: RabbitmqOperatorClean
      type: Confirm
      saveInXlvals: true
      promptIf: !expr ServerType == 'dai-deploy' && (CleanBefore || ProcessType == 'clean') && length(k8sResources(Namespace, 'deployment', 'rabbitmq-cluster-operator')) > '0'
      prompt: "Clean Rabbitmq Operator?:"
      description: "Type yes to delete Rabbitmq Operator installation. The cleanup will be performed alongside at the end of cleanup process. Please note that this will delete all related resources if the operator is shared between applications"
      default: false
    - name: CrdName
      type: Select
      options:
        - !expr k8sResources(Namespace, 'crd')
      saveInXlvals: true
      promptIf: !expr "ServerType != 'dai-release-runner' && ((CleanBefore || ProcessType == 'clean') && length(k8sResources(Namespace, 'crd', '', ShortServerName)) != '0') || (ProcessType == 'upgrade' && UpgradeType == 'operatorToOperator' && CrdName == '')"
      prompt: "Enter the name of custom resource definition you want to reuse or replace:"
      ignoreIfSkipped: true
      overrideDefault: true
      description: The name of custom resource definition that you want to reuse or replace (delete).
      default: !expr "ServerType != 'dai-release-runner' && (CleanBefore || ProcessType == 'clean' || (ProcessType == 'upgrade' && UpgradeType == 'operatorToOperator')) ? k8sResource(Namespace, 'crd', ShortServerName) : ''"
    - name: IsCrdReused
      type: Confirm
      saveInXlvals: true
      promptIf: !expr "K8sSetup != 'OpenshiftCertified' && ServerType != 'dai-release-runner' && (CleanBefore || ProcessType == 'clean' || ProcessType == 'upgrade') && CrdName != ''"
      prompt: !expr "'Should CRD be reused, if No we will delete the CRD ' + CrdName + ', and all related CRs will be deleted with it:'"
      ignoreIfSkipped: true
      overrideDefault: true
      description: !expr "'Should CRD be reused? If Yes it will not be deleted, if No we will delete the CRD ' + CrdName + ', and all related CRs will be deleted with it. Put Yes if you have on the same cluster multiple installation of the ' + ServerType"
      default: !expr "ServerType != 'dai-release-runner' && ProcessType == 'upgrade' && UpgradeType == 'OperatorToOperator'"
    - name: CrName
      type: Select
      options:
        - !expr k8sResources(Namespace, CrdName)
      saveInXlvals: true
      promptIf: !expr "ServerType != 'dai-release-runner' && ((CrdName != '' && (CleanBefore || ProcessType == 'clean') && length(k8sResources(Namespace, CrdName)) != '0') || (ProcessType == 'upgrade' && UpgradeType == 'operatorToOperator' && CrName == ''))"
      prompt: "Enter the name of custom resource:"
      ignoreIfSkipped: true
      overrideDefault: true
      description: The name of your custom resource
      default: !expr "(ServerType != 'dai-release-runner' && CrdName != '' && (CleanBefore || ProcessType == 'clean')) || (ProcessType == 'upgrade' && UpgradeType == 'operatorToOperator') ? k8sResource(Namespace, CrdName, ShortServerName) : ''"
    - name: PreserveCrValuesDeploy
      type: Editor
      prompt: "Edit list of custom resource keys that will migrate to the new Deploy CR:"
      promptIf: !expr "ServerType == 'dai-deploy' && ProcessType == 'upgrade'"
      saveInXlvals: true
      ignoreIfSkipped: true
      description: |
        For all matched expressions in the cluster CR, the values will be migrated to the upgraded CR.
        The keys present here are the paths in the new CR, which will be preserved from cluster CR
        of earlier installed version.
        These values will be migrated by moving values to new or same CR keys by matching old CR keys
        in the format given below.
        
        In the example snippet:
        ```
        .metadata.name: .         # 1 Represents the same path in the upgraded new version CR
        ```
        1. The value . for a key represents the same path. This mapping defines that value from old 
        version CR value under that path will be copied to the new version CR under the same path.
        
        In the example snippet:
        ```
        .spec.auth.adminPassword:   # Represents the path in the upgraded new version CR
          0.0: .spec.AdminPassword  # 2 Matching path in the cluster CR (for version earlier than 23.3)
          23.3: .                   # 3 Matching path in the cluster CR (for version from 23.3 onwards)
        ```
        2. The value for 0.0 represents the path in cluster CR before upgrade. This mapping defines that 
        value from old version CR from cluster will be copied to the new version CR in the parent path of 0.0.
        3. The value for 23.3 represents the path in cluster CR before upgrade. This mapping defines that
        value from old version CR from cluster will be copied to the new version CR in the parent path of 23.3.
        
        Refer section 'Custom resource keys migration during upgrade' in the documentation for more details.
      default: |-
        .metadata.name: .
        .spec.centralConfiguration.persistence.storageClass:
          0.0: .spec.Persistence.StorageClass
          23.3: .
        .spec.master.persistence.storageClass:
          0.0: .spec.Persistence.StorageClass
          23.3: .
        .spec.worker.persistence.storageClass:
          0.0: .spec.Persistence.StorageClass
          23.3: .
        .spec.auth.adminPassword:
          0.0: .spec.AdminPassword
          23.3: .
        .spec.centralConfiguration.replicaCount: .
        .spec.centralConfiguration.persistence.paths: .
        .spec.centralConfiguration.persistence.emptyDirPaths: .
        .spec.centralConfiguration.persistence.accessModes[0]:
          0.0: .spec.Persistence.AccessMode
          23.3:
        .spec.centralConfiguration.persistence.accessModes:
          0.0:
          23.3: .
        .spec.centralConfiguration.persistence.size:
          0.0: .spec.centralConfiguration.persistence.pvcSize
          23.3: .
        .spec.centralConfiguration.persistence.existingClaim:
          0.0:
            existance: .spec.deploy.centralConfiguration.persistence.existingClaim
            expression: .spec.deploy.centralConfiguration.persistence.existingClaim
          23.3: .
        .spec.centralConfiguration.migrateFromEmbedded: .
        .spec.master.replicaCount:
          0.0: .spec.XldMasterCount
          23.3: .
        .spec.master.persistence.paths: .
        .spec.master.persistence.emptyDirPaths: .
        .spec.master.persistence.accessModes[0]:
          0.0: .spec.Persistence.AccessMode
          23.3:
        .spec.master.persistence.accessModes:
          0.0:
          23.3: .
        .spec.master.persistence.size:
          0.0: .spec.Persistence.XldMasterPvcSize
          23.3: .
        .spec.master.persistence.existingClaim:
          0.0:
            existance: .spec.deploy.master.persistence.existingClaim
            expression: .spec.deploy.master.persistence.existingClaim
          23.3: .
        .spec.worker.replicaCount:
          0.0: .spec.XldWorkerCount
          23.3: .
        .spec.worker.persistence.paths: .
        .spec.worker.persistence.emptyDirPaths: .
        .spec.worker.persistence.accessModes[0]:
          0.0: .spec.Persistence.AccessMode
          23.3:
        .spec.worker.persistence.accessModes:
          0.0:
          23.3: .
        .spec.worker.persistence.size:
          0.0: .spec.Persistence.XldWorkerPvcSize
          23.3: .
        .spec.worker.persistence.existingClaim:
          0.0:
            existance: .spec.deploy.worker.persistence.existingClaim
            expression: .spec.deploy.worker.persistence.existingClaim
          23.3: .
        .spec.oidc: .
        .spec.external.db:
          0.0:
          23.3: .
        .spec.external.db.enabled:
          0.0: .spec.UseExistingDB.Enabled
          23.3:
        .spec.external.db.main.url:
          0.0: .spec.UseExistingDB.XL_DB_URL
          23.3:
        .spec.external.db.main.username:
          0.0: .spec.UseExistingDB.XL_DB_USERNAME
          23.3:
        .spec.external.db.main.password:
          0.0: .spec.UseExistingDB.XL_DB_PASSWORD
          23.3:
        .spec.external.db.report.url:
          0.0: .spec.UseExistingDB.XL_REPORT_DB_URL // .spec.UseExistingDB.XL_DB_URL
          23.3:
        .spec.external.db.report.username:
          0.0: .spec.UseExistingDB.XL_REPORT_DB_USER // .spec.UseExistingDB.XL_REPORT_DB_USERNAME // .spec.UseExistingDB.XL_DB_USERNAME
          23.3:
        .spec.external.db.report.password:
          0.0: .spec.UseExistingDB.XL_REPORT_DB_PASS // .spec.UseExistingDB.XL_REPORT_DB_PASSWORD // .spec.UseExistingDB.XL_DB_PASSWORD
          23.3:
        .spec.external.mq:
          0.0:
          23.3: .
        .spec.external.mq.enabled:
          0.0: .spec.UseExistingMQ.Enabled
          23.3:
        .spec.external.mq.url:
          0.0: .spec.UseExistingMQ.XLD_TASK_QUEUE_URL
          23.3:
        .spec.external.mq.username:
          0.0: .spec.UseExistingMQ.XLD_TASK_QUEUE_USERNAME
          23.3:
        .spec.external.mq.password:
          0.0: .spec.UseExistingMQ.XLD_TASK_QUEUE_PASSWORD
          23.3:
        .spec.external.mq.driverClassName:
          0.0: .spec.UseExistingMQ.XLD_TASK_QUEUE_DRIVER_CLASS_NAME
          23.3:
        .spec.ingress.enabled:
          0.0: .spec.ingress.Enabled
          23.3: .
        .spec.ingress.hostname:
          0.0: .spec.ingress.hosts.[0]
          23.3: .
        .spec.ingress.path: .
        .spec.ingress.annotations: .
        .spec.ingress.extraTls:
          0.0: .spec.ingress.tls
          23.3: .
        .spec.keystore.passphrase:
          0.0: .spec.KeystorePassphrase
          23.3: .
        .spec.keystore.keystore:
          0.0: .spec.RepositoryKeystore
          23.3: .
        .spec.truststore: .
        .spec.postgresql.install: .
        .spec.postgresql.primary.persistence.size:
          0.0: .spec.postgresql.persistence.size
          23.3: .
        .spec.postgresql.global.storageClass:
          0.0: .spec.postgresql.persistence.storageClass
          23.3: .
        .spec.postgresql.primary.persistence.storageClass:
          0.0: .spec.postgresql.persistence.storageClass
          23.3: .
        .spec.postgresql.primary.extendedConfiguration:
          0.0:
            existance: .spec.postgresql.postgresqlMaxConnections
            expression: .spec.postgresql.postgresqlMaxConnections as $maxConnection | "max_connections = " + $maxConnection
          23.3: .
        .spec.postgresql.hasReport:
          0.0: .spec.postgresql.hasReport // false
          23.3: .
        # preserve current DB version
        .spec.postgresql.image.tag: .
        .spec.haproxy-ingress.install: .
        .spec.nginx-ingress-controller.install: .
        .spec.rabbitmq.install: .
        .spec.rabbitmq.persistence.storageClass: .
        .spec.rabbitmq.persistence.size: .
        .spec.rabbitmq.replicaCount: .
        .spec.rabbitmq.persistence.replicaCount: .
        # upgrade to next supported MQ version (do the manual upgrade later)
        .spec.rabbitmq.image.tag:
          0.0:
            existance: .spec.rabbitmq.image.tag
            expression: .spec.rabbitmq.image.updateTag // "3.10.25"
          23.3: .
        .spec.route.hostname:
          0.0: .spec.route.hosts.[0]
          23.3: .
        .spec.route.path: .
        .spec.route.annotations: .
        .spec.route.tls: .
        .spec.route.enabled:
          0.0: .spec.route.Enabled
          23.3: .
        .spec.license:
          0.0: .spec.xldLicense
          23.3: .
        .spec.licenseAcceptEula:
          0.0:
          23.3: .
        .spec.ssl: .
        .spec.hooks.genSelfSigned: .
        .spec.hooks.getLicense: .
        .spec.centralConfiguration.configuration: .
        .spec.centralConfiguration.extraConfiguration: .
        .spec.centralConfiguration.diagnosticMode: .
        .spec.master.configuration: .
        .spec.master.extraConfiguration: .
        .spec.master.diagnosticMode: .
        .spec.worker.configuration: .
        .spec.worker.extraConfiguration: .
        .spec.worker.diagnosticMode: .
        .spec.postgresql.primary.configuration: .
        .spec.postgresql.primary.extraConfiguration: .
        .spec.rabbitmq.configuration: .
        .spec.rabbitmq.extraConfiguration: .
        .spec.centralConfiguration.resourcesPreset: .
        .spec.centralConfiguration.resources: .
        .spec.centralConfiguration.defaultInitContainers.resources: .
        .spec.master.resourcesPreset: .
        .spec.master.resources: .
        .spec.master.defaultInitContainers.resources: .
        .spec.worker.resourcesPreset: .
        .spec.worker.resources: .
        .spec.worker.defaultInitContainers.resources: .
        .spec.haproxy-ingress.resources: .
        .spec.nginx-ingress-controller.defaultBackend.resources: .
        .spec.nginx-ingress-controller.defaultBackend.resourcesPreset: .
        .spec.nginx-ingress-controller.resources: .
        .spec.nginx-ingress-controller.resourcesPreset: .
        .spec.postgresql.primary.resources: .
        .spec.postgresql.primary.resourcesPreset: .
        .spec.postgresql.diagnosticMode: .
        .spec.rabbitmq.resources: .
        .spec.rabbitmq.resourcesPreset: .
        .spec.rabbitmq.diagnosticMode: .
        .spec.centralConfiguration.podSecurityContext: .
        .spec.centralConfiguration.containerSecurityContext: .
        .spec.centralConfiguration.volumePermissions: .
        .spec.master.podSecurityContext: .
        .spec.master.containerSecurityContext: .
        .spec.master.volumePermissions: .
        .spec.worker.podSecurityContext: .
        .spec.worker.containerSecurityContext: .
        .spec.worker.volumePermissions: .
        .spec.haproxy-ingress.controller.securityContext: .
        .spec.postgresql.primary.containerSecurityContext: .
        .spec.postgresql.primary.podSecurityContext: .
        .spec.postgresql.volumePermissions: .
        .spec.rabbitmq.containerSecurityContext: .
        .spec.rabbitmq.podSecurityContext: .
        .spec.rabbitmq.volumePermissions: .
    - name: PreserveCrValuesRelease
      type: Editor
      prompt: "Edit list of custom resource keys that will migrate to the new Release CR:"
      promptIf: !expr "ServerType == 'dai-release' && ProcessType == 'upgrade'"
      saveInXlvals: true
      ignoreIfSkipped: true
      description: |
        For all matched expressions in the cluster CR, the values will be migrated to the upgraded CR.
        The keys present here are the paths in the new CR, which will be preserved from cluster CR
        of earlier installed version.
        These values will be migrated by moving values to new or same CR keys by matching old CR keys
        in the format given below.
        
        In the example snippet:
        ```
        .metadata.name: .         # 1 Represents the same path in the upgraded new version CR
        ```
        1. The value . for a key represents the same path. This mapping defines that value from old 
        version CR value under that path will be copied to the new version CR under the same path.
        
        In the example snippet:
        ```
        .spec.auth.adminPassword:   # Represents the path in the upgraded new version CR
          0.0: .spec.AdminPassword  # 2 Matching path in the cluster CR (for version earlier than 23.3)
          23.3: .                   # 3 Matching path in the cluster CR (for version from 23.3 onwards)
        ```
        2. The value for 0.0 represents the path in cluster CR before upgrade. This mapping defines that 
        value from old version CR from cluster will be copied to the new version CR in the parent path of 0.0.
        3. The value for 23.3 represents the path in cluster CR before upgrade. This mapping defines that
        value from old version CR from cluster will be copied to the new version CR in the parent path of 23.3.
        
        Refer section 'Custom resource keys migration during upgrade' in the documentation for more details.
      default: |-
        .metadata.name: .
        .spec.persistence.storageClass:
          0.0: .spec.Persistence.StorageClass
          23.3: .
        .spec.auth.adminPassword:
          0.0: .spec.AdminPassword
          23.3: .
        .spec.appProtocol:
          0.0:
          23.3: .
        .spec.appHostname:
          0.0:
          23.3: .
        .spec.diagnosticMode: .
        .spec.replicaCount: .
        .spec.persistence.paths: .
        .spec.persistence.emptyDirPaths: .
        .spec.persistence.accessModes.[0]:
          0.0: .spec.Persistence.AccessMode
          23.3:
        .spec.persistence.accessModes:
          0.0:
          23.3: .
        .spec.persistence.size:
          0.0: .spec.Persistence.Size
          23.3: .
        .spec.persistence.existingClaim:
          0.0:
            existance: .spec.Persistence.ExistingClaim
            expression: .spec.Persistence.ExistingClaim
          23.3: .
        .spec.oidc: .
        .spec.external.db:
          0.0:
          23.3: .
        .spec.external.db.enabled:
          0.0: .spec.UseExistingDB.Enabled
          23.3:
        .spec.external.db.main.url:
          0.0: .spec.UseExistingDB.XLR_DB_URL
          23.3:
        .spec.external.db.main.username:
          0.0: .spec.UseExistingDB.XLR_DB_USER
          23.3:
        .spec.external.db.main.password:
          0.0: .spec.UseExistingDB.XLR_DB_PASS
          23.3:
        .spec.external.db.report.url:
          0.0: .spec.UseExistingDB.XLR_REPORT_DB_URL
          23.3:
        .spec.external.db.report.username:
          0.0: .spec.UseExistingDB.XLR_REPORT_DB_USER
          23.3:
        .spec.external.db.report.password:
          0.0: .spec.UseExistingDB.XLR_REPORT_DB_PASS
          23.3:
        .spec.external.mq:
          0.0:
          23.3: .
        .spec.external.mq.enabled:
          0.0: .spec.UseExistingMQ.Enabled
          23.3:
        .spec.external.mq.url:
          0.0: .spec.UseExistingMQ.XLR_TASK_QUEUE_URL
          23.3:
        .spec.external.mq.queueName:
          0.0: .spec.UseExistingMQ.XLR_TASK_QUEUE_NAME
          23.3:
        .spec.external.mq.username:
          0.0: .spec.UseExistingMQ.XLR_TASK_QUEUE_USERNAME
          23.3:
        .spec.external.mq.password:
          0.0: .spec.UseExistingMQ.XLR_TASK_QUEUE_PASSWORD
          23.3:
        .spec.ingress.enabled:
          0.0: .spec.ingress.Enabled
          23.3: .
        .spec.ingress.hostname:
          0.0: .spec.ingress.hosts.[0]
          23.3: .
        .spec.ingress.path: .
        .spec.ingress.annotations: .
        .spec.ingress.extraTls:
          0.0: .spec.ingress.tls
          23.3: .
        .spec.keystore.passphrase:
          0.0: .spec.KeystorePassphrase
          23.3: .
        .spec.keystore.keystore:
          0.0: .spec.RepositoryKeystore
          23.3: .
        .spec.truststore: .
        .spec.postgresql.install: .
        .spec.postgresql.primary.persistence.size:
          0.0: .spec.postgresql.persistence.size
          23.3: .
        .spec.postgresql.global.storageClass:
          0.0: .spec.postgresql.persistence.storageClass
          23.3: .
        .spec.postgresql.primary.persistence.storageClass:
          0.0: .spec.postgresql.persistence.storageClass
          23.3: .
        .spec.postgresql.primary.extendedConfiguration:
          0.0:
            existance: .spec.postgresql.postgresqlMaxConnections
            expression: .spec.postgresql.postgresqlMaxConnections as $maxConnection | "max_connections = " + $maxConnection
          23.3: .
        # preserve current DB version
        .spec.postgresql.image.tag: .
        .spec.haproxy-ingress.install: .
        .spec.nginx-ingress-controller.install: .
        .spec.route.hostname:
          0.0: .spec.route.hosts.[0]
          23.3: .
        .spec.route.path: .
        .spec.route.annotations: .
        .spec.route.tls: .
        .spec.route.enabled:
          0.0: .spec.route.Enabled
          23.3: .
        .spec.license:
          0.0: .spec.xlrLicense
          23.3: .
        .spec.licenseAcceptEula:
          0.0:
          23.3: .
        .spec.http2.enabled: .
        .spec.ssl: .
        .spec.hooks.genSelfSigned: .
        .spec.hooks.getLicense: .
        .spec.configuration: .
        .spec.extraConfiguration: .
        .spec.postgresql.primary.configuration: .
        .spec.postgresql.primary.extraConfiguration: .
        .spec.resourcesPreset: .
        .spec.resources: .
        .spec.defaultInitContainers.resources: .
        .spec.haproxy-ingress.resources: .
        .spec.nginx-ingress-controller.defaultBackend.resources: .
        .spec.nginx-ingress-controller.defaultBackend.resourcesPreset: .
        .spec.nginx-ingress-controller.resources: .
        .spec.nginx-ingress-controller.resourcesPreset: .
        .spec.postgresql.primary.resources: .
        .spec.postgresql.primary.resourcesPreset: .
        .spec.postgresql.diagnosticMode: .
        .spec.rabbitmq.diagnosticMode: .
        .spec.podSecurityContext: .
        .spec.containerSecurityContext: .
        .spec.volumePermissions: .
        .spec.haproxy-ingress.controller.securityContext: .
        .spec.postgresql.primary.containerSecurityContext: .
        .spec.postgresql.primary.podSecurityContext: .
        .spec.postgresql.volumePermissions: .
    - name: PreservePvc
      type: Confirm
      saveInXlvals: true
      promptIf: !expr "(ProcessType == 'clean' || CleanBefore) && ServerType != 'dai-release-runner'"
      prompt: "Should we preserve persisted volume claims? If not all volume data will be lost:"
      ignoreIfSkipped: true
      overrideDefault: true
      description: If yes the PVC will remain and not deleted
      default: !expr "ProcessType == 'upgrade'"
    - name: ReleaseName
      type: Input
      saveInXlvals: true
      promptIf: !expr ServerType != 'dai-release-runner' && UpgradeType == 'helmToOperator' && ProcessType == 'upgrade'
      prompt: "Enter the helm release name:"
      ignoreIfSkipped: true
      overrideDefault: true
      description: The name of your custom resource definition.
    - name: RemoteRunnerInstallType
      type: Select
      options:
        - label: Don't install Digital.ai Release Runner
          value: no-install
        - label: Install Release Runner from local setup
          value: local-install
        - label: Install Release Runner on the cluster
          value: cluster-install
      saveInXlvals: true
      overrideDefault: true
      promptIf: !expr ServerType == 'dai-release' && ProcessType == 'install'
      prompt: "Install Digital.ai Release Runner:"
      description: |
        Selecting no-install will skip the Release Runner installation. 
        Selecting local-install will install Release Runner from the local.
        Selecting cluster-install will install Release Runner from the cluster.
        The installation will start after Release is ready on the cluster."
    - name: RemoteRunnerInstall
      type: Confirm
      saveInXlvals: true
      value: !expr "(ServerType == 'dai-release' && ProcessType == 'install') ? (RemoteRunnerInstallType != 'no-install') : (ServerType == 'dai-release-runner')"
    - name: RemoteRunnerAdminPasswordEnvVar
      type: Input
      saveInXlvals: true
      value: "ADMIN_PASSWORD"
    - name: RepositoryNameReleaseRunner
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr "RemoteRunnerInstall && (ProcessType == 'install' || ProcessType == 'upgrade')"
      prompt: "Enter the Release Runner repository name (eg: <repositoryName> from <repositoryName>/<imageName>:<tagName>):"
      description: Enter the Release Runner repository name to use
    - name: ImageNameReleaseRunner
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr "RemoteRunnerInstall && (ProcessType == 'install' || ProcessType == 'upgrade')"
      prompt: "Enter the Release Runner image name (eg: <imageName> from <repositoryName>/<imageName>:<tagName>):"
      default: release-runner
      description: Enter the Release Runner image name to use
    - name: ImageTagReleaseRunner
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr "RemoteRunnerInstall && (ProcessType == 'install' || ProcessType == 'upgrade')"
      prompt: "Enter the Release Runner image tag (eg: <tagName> from <repositoryName>/<imageName>:<tagName>):"
      description: |
        Enter the Release Runner image tag to use. The default value is the latest version. 
        The available versions can be seen from docker hub repository tags for the image. Such as
        https://hub.docker.com/r/xebialabs/release-runner/tags
    - name: RemoteRunnerReleaseName
      type: Input
      saveInXlvals: true
      promptIf: !expr RemoteRunnerInstall && ServerType == 'dai-release-runner'
      prompt: "Enter the Release Runner Helm Chart release name:"
      ignoreIfSkipped: false
      overrideDefault: true
      description: Release Runner Helm Chart release name that will be used with helm command during installation.
      default: release-runner
    - name: RemoteRunnerUseDefaultLocation
      type: Confirm
      default: true
      saveInXlvals: true
      promptIf: !expr RemoteRunnerInstall && (ProcessType == 'install' || ProcessType == 'upgrade')
      prompt: "Use default version of the Release Runner helm chart:"
      description: "Type yes to use default internal version of the Release Runner helm chart, else you need to provide path to the helm chart."
    - name: RemoteRunnerHelmChartUrl
      type: Input
      saveInXlvals: true
      promptIf: !expr RemoteRunnerInstall && !RemoteRunnerUseDefaultLocation && (ProcessType == 'install' || ProcessType == 'upgrade')
      prompt: "Enter the Release Runner Helm Chart path (URL or local path):"
      ignoreIfSkipped: true
      overrideDefault: true
      description: Release Runner Helm Chart local filesystem path or URL to the Release Runner Helm Chart package.
    - name: RemoteRunnerGeneration
      type: Confirm
      saveInXlvals: true
      promptIf: !expr false
      prompt: "Do Release Runner generation:"
      ignoreIfSkipped: !expr false
      overrideDefault: !expr true
      default: false
      description: Generation date and time.
    - name: RemoteRunnerReleaseUrl
      type: Input
      saveInXlvals: true
      promptIf: !expr RemoteRunnerInstall && RemoteRunnerInstallType != 'cluster-install' && (ServerType == 'dai-release-runner' || RemoteRunnerGeneration) && (ProcessType == 'install' || ProcessType == 'upgrade')
      prompt: "Enter the Release URL that will be used by Release Runner:"
      overrideDefault: true
      default: !expr "'http://dai-xlr-digitalai-release.' + Namespace"
      description: The Release URL that will be used by Release Runner, it needs to be accessible from the Release Runner pod.
      validate: !expr "regex('^https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)$', RemoteRunnerReleaseUrl)"
    - name: RemoteRunnerUserEmail
      type: Input
      saveInXlvals: true
      overrideDefault: true
      prompt: "Provide release-runner user email (for the user on the Release to send PAT expiration notifications):"
      promptIf: !expr RemoteRunnerInstall && ServerType != 'dai-release-runner' && (ProcessType == 'install' || ProcessType == 'upgrade')
      description: |
        release-runner user is user on the Release, that will be used to generate Personal Access Token.
        The email will be used to send PAT expiration notifications.
      default: "release-runner@no.reply"
    - name: RemoteRunnerUserPassword
      type: Input
      saveInXlvals: true
      overrideDefault: true
      prompt: "Provide release-runner user password (user on the Release):"
      promptIf: !expr RemoteRunnerInstall && ServerType != 'dai-release-runner' && (ProcessType == 'install' || ProcessType == 'upgrade')
      description: release-runner user is user on the Release, that will be used to generate Personal Access Token.
      default: !expr "randPassword()"
    - name: RemoteRunnerTokenExpiration
      type: Select
      options:
        - label: No expiration
          value: 0
        - label: 30 days
          value: 30
        - label: 60 days
          value: 60
        - label: 1 year
          value: 365
      saveInXlvals: true
      overrideDefault: true
      prompt: "Release Runner token expiration:"
      promptIf: !expr RemoteRunnerInstall && ServerType != 'dai-release-runner' && (ProcessType == 'install' || ProcessType == 'upgrade')
      description: "Provide Release Runner token expiration"
      default: 0
    - name: RemoteRunnerToken
      type: Input
      saveInXlvals: true
      promptIf: !expr RemoteRunnerInstall && RemoteRunnerInstallType != 'cluster-install' && (ServerType == 'dai-release-runner' || RemoteRunnerGeneration) && (ProcessType == 'install' || ProcessType == 'upgrade')
      prompt: "Enter the Release Token that will be used by Release Runner:"
      overrideDefault: true
      description: !expr "'To get the Release Token you need to login on the Release and generate Personal access token. Check the Release URL: ' + RemoteRunnerReleaseUrl + '/#/personal-access-token'"
      validate: !expr "regex('^(rpa_[a-zA-Z0-9]{40})$', RemoteRunnerToken)"
    - name: RemoteRunnerCount
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr RemoteRunnerInstall && (ProcessType == 'install' || ProcessType == 'upgrade')
      prompt: "Enter the Release Runner replica count:"
      default: 1
      description: Enter the Release Runner replica count, it will spin given number of replicas
      validate: !expr "regex('^([1-9])+$', RemoteRunnerCount)"
    - name: IsRemoteRunnerTruststoreEnabled
      type: Confirm
      default: false
      saveInXlvals: true
      promptIf: !expr RemoteRunnerInstall && ServerType == 'dai-release-runner' && (ProcessType == 'install' || ProcessType == 'upgrade')
      prompt: "Enable truststore for Release Runner:"
      description: |
        Type yes to setup truststore for Release Runner. Will be required when Release Runner connects 
        with Release over ssl connection. The certificates will be used to establish a secure connection
        to the Release.
    - name: RemoteRunnerRestClientCa
      type: Editor
      saveInXlvals: true
      ignoreIfSkipped: true
      allowEmpty: true
      overrideDefault: true
      prompt: "Provide base64 encoded cert in pem format:"
      promptIf: !expr IsRemoteRunnerTruststoreEnabled && RemoteRunnerInstall && (ProcessType == 'install' || ProcessType == 'upgrade')
      description: |
        The Release Runner trusted certificates in pem format. Add the certificate of Release.
        Use openssl command to convert the certificate to pem format.
      default: ""
    - name: RemoteRunnerClean
      type: Confirm
      saveInXlvals: true
      promptIf: !expr ServerType == 'dai-release' && (CleanBefore || ProcessType == 'clean') && length(k8sResources(Namespace, 'sts', RemoteRunnerReleaseName)) > '0'
      prompt: "Clean Release Runner from Digital.ai Release?:"
      description: "Type yes to delete Digital.ai Release Runner. The cleanup will be performed alongside Release cleanup."
      default: false
  files:
    # Generic
    - path: digitalai/generated_answers.yaml.tmpl
      renameTo: !expr "'digitalai/generated_answers_' + ServerType + '_' +  Namespace + '_' + ProcessType + '-' + GenerationDateTime + '.yaml.tmpl'"
    # RabbitMQ
    - path: digitalai/rabbitmq-operator/111-rabbitmq-cluster-operator.yaml.tmpl
      writeIf: !expr (ServerType == 'dai-deploy' || ServerType == 'dai-release') && (((ProcessType == 'install' || ProcessType == 'upgrade') && K8sSetup != 'OpenshiftCertified' && RabbitmqInstall == 'operator') || (ProcessType == 'clean' && RabbitmqOperatorClean && K8sSetup != 'OpenshiftCertified'))
      renameTo: !expr "'digitalai/' + ServerType + '/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/111-rabbitmq-cluster-operator.yaml'"
    - path: digitalai/rabbitmq-operator/112-rabbitmq-validating-webhook.yaml.tmpl
      writeIf: !expr (ServerType == 'dai-deploy' || ServerType == 'dai-release') && (((ProcessType == 'install' || ProcessType == 'upgrade') && K8sSetup != 'OpenshiftCertified' && RabbitmqInstall == 'operator') || (ProcessType == 'clean' && RabbitmqOperatorClean && K8sSetup != 'OpenshiftCertified'))
      renameTo: !expr "'digitalai/' + ServerType + '/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/112-rabbitmq-validating-webhook.yaml'"
    - path: digitalai/rabbitmq-operator/113-rabbitmq-self-signed-job.yaml.tmpl
      writeIf: !expr (ServerType == 'dai-deploy' || ServerType == 'dai-release') && (((ProcessType == 'install' || ProcessType == 'upgrade') && K8sSetup != 'OpenshiftCertified' && RabbitmqInstall == 'operator') || (ProcessType == 'clean' && RabbitmqOperatorClean && K8sSetup != 'OpenshiftCertified'))
      renameTo: !expr "'digitalai/' + ServerType + '/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/113-rabbitmq-self-signed-job.yaml'"
    - path: digitalai/rabbitmq-operator/114-rabbitmq-topology-operator.yaml.tmpl
      writeIf: !expr (ServerType == 'dai-deploy' || ServerType == 'dai-release') && (((ProcessType == 'install' || ProcessType == 'upgrade') && K8sSetup != 'OpenshiftCertified' && RabbitmqInstall == 'operator') || (ProcessType == 'clean' && RabbitmqOperatorClean && K8sSetup != 'OpenshiftCertified'))
      renameTo: !expr "'digitalai/' + ServerType + '/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/114-rabbitmq-topology-operator.yaml'"
    # Postgresql
    - path: digitalai/postgresql-operator/131-postgresql-cluster-operator.yaml.tmpl
      writeIf: !expr (ServerType == 'dai-deploy' || ServerType == 'dai-release') && (((ProcessType == 'install' || ProcessType == 'upgrade') && K8sSetup != 'OpenshiftCertified' && PostgresqlInstall == 'operator') || (ProcessType == 'clean' && PostgresqlOperatorClean && K8sSetup != 'OpenshiftCertified'))
      renameTo: !expr "'digitalai/' + ServerType + '/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/131-postgresql-cluster-operator.yaml'"
    # Ingress Nginx
    - path: digitalai/ingress-nginx-controller/151-ingress-nginx-controller.yaml.tmpl
      writeIf: !expr (ServerType == 'dai-deploy' || ServerType == 'dai-release') && (((ProcessType == 'install' || ProcessType == 'upgrade') && K8sSetup != 'OpenshiftCertified' && IngressType == 'ingress-nginx-controller') || (ProcessType == 'clean' && IngressNginxControllerClean && K8sSetup != 'OpenshiftCertified'))
      renameTo: !expr "'digitalai/' + ServerType + '/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/151-ingress-nginx-controller.yaml'"
    # Deploy
    - path: digitalai/dai-deploy/kubernetes-generic/template/802-leader-election-role.yaml
      writeIf: !expr ServerType == 'dai-deploy' && (ProcessType == 'install' || ProcessType == 'upgrade') && K8sSetup != 'OpenshiftCertified'
      renameTo: !expr "'digitalai/dai-deploy/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/802-leader-election-role.yaml'"
    - path: digitalai/dai-deploy/kubernetes-generic/template/803-leader-election-rolebinding.yaml.tmpl
      writeIf: !expr ServerType == 'dai-deploy' && (ProcessType == 'install' || ProcessType == 'upgrade') && K8sSetup != 'OpenshiftCertified'
      renameTo: !expr "'digitalai/dai-deploy/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/803-leader-election-rolebinding.yaml.tmpl'"
    - path: digitalai/dai-deploy/kubernetes-generic/template/804-manager-clusterrole.yaml.tmpl
      writeIf: !expr ServerType == 'dai-deploy' && (IngressType == "nginx" || IngressType == "haproxy" || K8sSetup == 'Openshift') && (ProcessType == 'install' || ProcessType == 'upgrade')
      renameTo: !expr "'digitalai/dai-deploy/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/804-manager-clusterrole.yaml.tmpl'"
    - path: digitalai/dai-deploy/kubernetes-generic/template/805-manager-clusterrolebinding.yaml.tmpl
      writeIf: !expr ServerType == 'dai-deploy' && (IngressType == "nginx" || IngressType == "haproxy" || K8sSetup == 'Openshift') && (ProcessType == 'install' || ProcessType == 'upgrade')
      renameTo: !expr "'digitalai/dai-deploy/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/805-manager-clusterrolebinding.yaml.tmpl'"
    - path: digitalai/dai-deploy/kubernetes-generic/template/808-openshift-scc.yaml.tmpl
      writeIf: !expr ServerType == 'dai-deploy' && EnableSCC && regex('^Openshift.*', K8sSetup) && (ProcessType == 'install' || ProcessType == 'upgrade')
      renameTo: !expr "'digitalai/dai-deploy/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/808-openshift-scc.yaml.tmpl'"
    - path: digitalai/dai-deploy/kubernetes-generic/template/809-openshift-scc-postgresql.yaml.tmpl
      writeIf: !expr ServerType == 'dai-deploy' && EnableSCC && regex('^Openshift.*', K8sSetup) && (ProcessType == 'install' || ProcessType == 'upgrade')
      renameTo: !expr "'digitalai/dai-deploy/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/809-openshift-scc-postgresql.yaml.tmpl'"
    - path: digitalai/dai-deploy/kubernetes-generic/template/810-openshift-scc-rabbitmq.yaml.tmpl
      writeIf: !expr ServerType == 'dai-deploy' && EnableSCC && regex('^Openshift.*', K8sSetup) && (ProcessType == 'install' || ProcessType == 'upgrade')
      renameTo: !expr "'digitalai/dai-deploy/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/810-openshift-scc-rabbitmq.yaml.tmpl'"
    - path: digitalai/dai-deploy/kubernetes-generic/template/806-manager-role.yaml
      writeIf: !expr ServerType == 'dai-deploy' && (ProcessType == 'install' || ProcessType == 'upgrade') && K8sSetup != 'OpenshiftCertified'
      renameTo: !expr "'digitalai/dai-deploy/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/806-manager-role.yaml'"
    - path: digitalai/dai-deploy/kubernetes-generic/template/807-manager-rolebinding.yaml.tmpl
      writeIf: !expr ServerType == 'dai-deploy' && (ProcessType == 'install' || ProcessType == 'upgrade') && K8sSetup != 'OpenshiftCertified'
      renameTo: !expr "'digitalai/dai-deploy/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/807-manager-rolebinding.yaml.tmpl'"
    - path: digitalai/dai-deploy/kubernetes-generic/template/801-custom-resource-definition.yaml
      writeIf: !expr ServerType == 'dai-deploy' && (ProcessType == 'install' || ProcessType == 'upgrade') && K8sSetup != 'OpenshiftCertified'
      renameTo: !expr "'digitalai/dai-deploy/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/801-custom-resource-definition.yaml'"
    - path: digitalai/dai-deploy/kubernetes-generic/dai-deploy_cr_default.yaml.tmpl
      writeIf: !expr ServerType == 'dai-deploy' && (ProcessType == 'install' || ProcessType == 'upgrade')
      renameTo: !expr "'digitalai/dai-deploy/' + Namespace + '/' + GenerationDateTime + '/kubernetes/dai-deploy_cr_default.yaml.tmpl'"
    - path: digitalai/dai-deploy/kubernetes-generic/template/811-deployment.yaml.tmpl
      writeIf: !expr ServerType == 'dai-deploy' && (ProcessType == 'install' || ProcessType == 'upgrade') && K8sSetup != 'OpenshiftCertified'
      renameTo: !expr "'digitalai/dai-deploy/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/811-deployment.yaml.tmpl'"

    - path: digitalai/dai-deploy/kubernetes-generic/template/501-postgresql-admin-secret.yaml
      writeIf: !expr ServerType == 'dai-deploy' && (ProcessType == 'install' || ProcessType == 'upgrade') && K8sSetup != 'OpenshiftCertified' && PostgresqlInstall == 'operator'
      renameTo: !expr "'digitalai/dai-deploy/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/501-postgresql-admin-secret.yaml'"
    - path: digitalai/dai-deploy/kubernetes-generic/template/503-postgresql-cluster.yaml.tmpl
      writeIf: !expr ServerType == 'dai-deploy' && (ProcessType == 'install' || ProcessType == 'upgrade') && K8sSetup != 'OpenshiftCertified' && PostgresqlInstall == 'operator'
      renameTo: !expr "'digitalai/dai-deploy/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/503-postgresql-cluster.yaml'"
    - path: digitalai/dai-deploy/kubernetes-generic/template/502-postgresql-init-secret.yaml
      writeIf: !expr ServerType == 'dai-deploy' && (ProcessType == 'install' || ProcessType == 'upgrade') && K8sSetup != 'OpenshiftCertified' && PostgresqlInstall == 'operator'
      renameTo: !expr "'digitalai/dai-deploy/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/502-postgresql-init-secret.yaml'"

    - path: digitalai/dai-deploy/kubernetes-generic/template/301-rabbitmq-admin-secret.yaml
      writeIf: !expr ServerType == 'dai-deploy' && (ProcessType == 'install' || ProcessType == 'upgrade') && K8sSetup != 'OpenshiftCertified' && RabbitmqInstall == 'operator'
      renameTo: !expr "'digitalai/dai-deploy/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/301-rabbitmq-admin-secret.yaml'"
    - path: digitalai/dai-deploy/kubernetes-generic/template/302-rabbitmq-cluster.yaml.tmpl
      writeIf: !expr ServerType == 'dai-deploy' && (ProcessType == 'install' || ProcessType == 'upgrade') && K8sSetup != 'OpenshiftCertified' && RabbitmqInstall == 'operator'
      renameTo: !expr "'digitalai/dai-deploy/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/302-rabbitmq-cluster.yaml'"
    - path: digitalai/dai-deploy/kubernetes-generic/template/304-rabbitmq-cluster-admin.yaml
      writeIf: !expr ServerType == 'dai-deploy' && (ProcessType == 'install' || ProcessType == 'upgrade') && K8sSetup != 'OpenshiftCertified' && RabbitmqInstall == 'operator'
      renameTo: !expr "'digitalai/dai-deploy/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/304-rabbitmq-cluster-admin.yaml'"
    - path: digitalai/dai-deploy/kubernetes-generic/template/305-rabbitmq-cluster-admin-permissions.yaml
      writeIf: !expr ServerType == 'dai-deploy' && (ProcessType == 'install' || ProcessType == 'upgrade') && K8sSetup != 'OpenshiftCertified' && RabbitmqInstall == 'operator'
      renameTo: !expr "'digitalai/dai-deploy/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/305-rabbitmq-cluster-admin-permissions.yaml'"
    - path: digitalai/dai-deploy/kubernetes-generic/template/303-rabbitmq-cluster-vhost.yaml
      writeIf: !expr ServerType == 'dai-deploy' && (ProcessType == 'install' || ProcessType == 'upgrade') && K8sSetup != 'OpenshiftCertified' && RabbitmqInstall == 'operator'
      renameTo: !expr "'digitalai/dai-deploy/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/303-rabbitmq-cluster-vhost.yaml'"

    # Release
    - path: digitalai/dai-release/kubernetes-generic/template/802-leader-election-role.yaml
      writeIf: !expr ServerType == 'dai-release' && (ProcessType == 'install' || ProcessType == 'upgrade') && K8sSetup != 'OpenshiftCertified'
      renameTo: !expr "'digitalai/dai-release/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/802-leader-election-role.yaml'"
    - path: digitalai/dai-release/kubernetes-generic/template/803-leader-election-rolebinding.yaml.tmpl
      writeIf: !expr ServerType == 'dai-release' && (ProcessType == 'install' || ProcessType == 'upgrade') && K8sSetup != 'OpenshiftCertified'
      renameTo: !expr "'digitalai/dai-release/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/803-leader-election-rolebinding.yaml.tmpl'"
    - path: digitalai/dai-release/kubernetes-generic/template/804-manager-clusterrole.yaml.tmpl
      writeIf: !expr ServerType == 'dai-release' && (IngressType == "nginx" || IngressType == "haproxy" || K8sSetup == 'Openshift') && (ProcessType == 'install' || ProcessType == 'upgrade')
      renameTo: !expr "'digitalai/dai-release/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/804-manager-clusterrole.yaml.tmpl'"
    - path: digitalai/dai-release/kubernetes-generic/template/805-manager-clusterrolebinding.yaml.tmpl
      writeIf: !expr ServerType == 'dai-release' && (IngressType == "nginx" || IngressType == "haproxy" || K8sSetup == 'Openshift') && (ProcessType == 'install' || ProcessType == 'upgrade')
      renameTo: !expr "'digitalai/dai-release/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/805-manager-clusterrolebinding.yaml.tmpl'"
    - path: digitalai/dai-release/kubernetes-generic/template/808-openshift-scc.yaml.tmpl
      writeIf: !expr ServerType == 'dai-release' && EnableSCC && regex('^Openshift.*', K8sSetup) && (ProcessType == 'install' || ProcessType == 'upgrade')
      renameTo: !expr "'digitalai/dai-release/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/808-openshift-scc.yaml.tmpl'"
    - path: digitalai/dai-release/kubernetes-generic/template/809-openshift-scc-postgresql.yaml.tmpl
      writeIf: !expr ServerType == 'dai-release' && EnableSCC && regex('^Openshift.*', K8sSetup) && (ProcessType == 'install' || ProcessType == 'upgrade')
      renameTo: !expr "'digitalai/dai-release/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/809-openshift-scc-postgresql.yaml.tmpl'"
    - path: digitalai/dai-release/kubernetes-generic/template/806-manager-role.yaml.tmpl
      writeIf: !expr ServerType == 'dai-release' && (ProcessType == 'install' || ProcessType == 'upgrade') && K8sSetup != 'OpenshiftCertified'
      renameTo: !expr "'digitalai/dai-release/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/806-manager-role.yaml.tmpl'"
    - path: digitalai/dai-release/kubernetes-generic/template/807-manager-rolebinding.yaml.tmpl
      writeIf: !expr ServerType == 'dai-release' && (ProcessType == 'install' || ProcessType == 'upgrade') && K8sSetup != 'OpenshiftCertified'
      renameTo: !expr "'digitalai/dai-release/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/807-manager-rolebinding.yaml.tmpl'"
    - path: digitalai/dai-release/kubernetes-generic/template/801-custom-resource-definition.yaml
      writeIf: !expr ServerType == 'dai-release' && (ProcessType == 'install' || ProcessType == 'upgrade') && K8sSetup != 'OpenshiftCertified'
      renameTo: !expr "'digitalai/dai-release/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/801-custom-resource-definition.yaml'"
    - path: digitalai/dai-release/kubernetes-generic/dai-release_cr_default.yaml.tmpl
      writeIf: !expr ServerType == 'dai-release' && (ProcessType == 'install' || ProcessType == 'upgrade')
      renameTo: !expr "'digitalai/dai-release/' + Namespace + '/' + GenerationDateTime + '/kubernetes/dai-release_cr_default.yaml.tmpl'"
    - path: digitalai/dai-release/kubernetes-generic/template/810-deployment.yaml.tmpl
      writeIf: !expr ServerType == 'dai-release' && (ProcessType == 'install' || ProcessType == 'upgrade') && K8sSetup != 'OpenshiftCertified'
      renameTo: !expr "'digitalai/dai-release/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/810-deployment.yaml.tmpl'"

    - path: digitalai/dai-release/kubernetes-generic/template/501-postgresql-admin-secret.yaml
      writeIf: !expr ServerType == 'dai-release' && (ProcessType == 'install' || ProcessType == 'upgrade') && K8sSetup != 'OpenshiftCertified' && PostgresqlInstall == 'operator'
      renameTo: !expr "'digitalai/dai-release/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/501-postgresql-admin-secret.yaml'"
    - path: digitalai/dai-release/kubernetes-generic/template/503-postgresql-cluster.yaml.tmpl
      writeIf: !expr ServerType == 'dai-release' && (ProcessType == 'install' || ProcessType == 'upgrade') && K8sSetup != 'OpenshiftCertified' && PostgresqlInstall == 'operator'
      renameTo: !expr "'digitalai/dai-release/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/503-postgresql-cluster.yaml'"
    - path: digitalai/dai-release/kubernetes-generic/template/502-postgresql-init-secret.yaml
      writeIf: !expr ServerType == 'dai-release' && (ProcessType == 'install' || ProcessType == 'upgrade') && K8sSetup != 'OpenshiftCertified' && PostgresqlInstall == 'operator'
      renameTo: !expr "'digitalai/dai-release/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/502-postgresql-init-secret.yaml'"

    # Runner
    - path: digitalai/dai-release-runner/values-cli.yaml.tmpl
      writeIf: !expr RemoteRunnerInstall && (RemoteRunnerGeneration || ServerType == 'dai-release-runner')
      renameTo: !expr "'digitalai/' + ServerType + '/' + Namespace + '/' + GenerationDateTime + '/kubernetes/values-cli.yaml.tmpl'"
    - path: digitalai/dai-release-runner/install.yaml
      writeIf: !expr RemoteRunnerInstall && ServerType != 'dai-release-runner' || ServerType == 'dai-release-runner' && RemoteRunnerInstallType == 'cluster-install'
      renameTo: !expr "'digitalai/' + ServerType + '/' + Namespace + '/' + GenerationDateTime + '/kubernetes/install.yaml'"
    - path: digitalai/dai-release-runner/create-release-runner-user.yaml.tmpl
      writeIf: !expr RemoteRunnerInstall && ServerType != 'dai-release-runner' || ServerType == 'dai-release-runner' && RemoteRunnerInstallType == 'cluster-install'
      renameTo: !expr "'digitalai/' + ServerType + '/' + Namespace + '/' + GenerationDateTime + '/kubernetes/create-release-runner-user.yaml.tmpl'"
    - path: digitalai/dai-release-runner/openshift-scc-release-runner.yaml.tmpl
      writeIf: !expr EnableSCC && regex('^Openshift.*', K8sSetup) && ((RemoteRunnerInstall && ServerType != 'dai-release-runner') || (ServerType == 'dai-release-runner' && RemoteRunnerInstallType == 'cluster-install'))
      renameTo: !expr "'digitalai/' + ServerType + '/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/openshift-scc-release-runner.yaml.tmpl'"