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.
    - 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: RepositoryName
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr "ServerType != 'dai-release-remote-runner' && (ProcessType == 'install' || ProcessType == 'upgrade')"
      prompt: "Enter the repository name for the application and operator images (eg: <repositoryName> from <repositoryName>/<imageName>:<tagName>):"
      default: xebialabs
      description: Enter the repository name to use for the application and operator images
    - name: ImageNameDeploy
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr ServerType == 'dai-deploy' && (ProcessType == 'install' || ProcessType == 'upgrade')
      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
    - name: ImageNameRelease
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr ServerType == 'dai-release' && (ProcessType == 'install' || ProcessType == 'upgrade')
      prompt: "Enter the Release image name (eg: <imageName> from <repositoryName>/<imageName>:<tagName>):"
      default: xl-release
      description: Enter the application image name to use
    - name: ImageTag
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr "ServerType != 'dai-release-remote-runner' && (ProcessType == 'install' || ProcessType == 'upgrade')"
      prompt: "Enter the application image tag (eg: <tagName> from <repositoryName>/<imageName>:<tagName>):"
      default: 23.3.1
      description: Enter the application image tag to use
    - name: ImageNameDeployTaskEngine
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr "ServerType == 'dai-deploy' && !regex('^10.*$', ImageTag) && (ProcessType == 'install' || ProcessType == 'upgrade')"
      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
    - name: ImageNameCc
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr "ServerType == 'dai-deploy' && !regex('^10.*$', ImageTag) && (ProcessType == 'install' || ProcessType == 'upgrade')"
      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
    - name: LicenseSource
      type: Select
      options:
        - label: Generate the license (this is only for temporary license that is used for evaluation)
          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-remote-runner' && ProcessType == "install"
      description: "Provide source of the license file"
      default: generate
    - name: LicenseEditor
      type: Editor
      saveInXlvals: true
      ignoreIfSkipped: true
      prompt: "Provide license for the server:"
      promptIf: !expr ServerType != 'dai-release-remote-runner' && ProcessType == "install" && LicenseSource == "editor"
      description: "Provide license for the server"
      default: ""
    - name: LicenseFile
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide license file for the server:"
      promptIf: !expr ServerType != 'dai-release-remote-runner' && ProcessType == "install" && LicenseSource == "file"
      description: "Provide license file for the server"
      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: !expr "LicenseSource == 'generate' ? 'Enter the deploy master server replica count (use 1 in case of license will be generated):' : 'Enter the deploy master server replica count:'"
      default: !expr "LicenseSource == 'generate' ? '1' : '3'"
      description: "Enter the Deploy master server replica count. For production use 3 or above. \nIn case you selected license generation, for now it is not possible to replicate the license between pods, so it is recommended to use 1 pod, or manually replicate the generated license between pods."
      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 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.
    - 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: PvcSizeCc
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr "ServerType == 'dai-deploy' && ProcessType == 'install'"
      prompt: "Enter PVC size for Central Configuration (Gi):"
      default: 0.5
      description: "Enter PVC size for Central Configuration"
      validate: !expr "regex('^([0-9])+(\\.)?([0-9])*$', PvcSizeCc)"
    - 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, the pods are sharing volumes.
    - name: Http2EnabledRelease
      type: Confirm
      prompt: "Do you want to enable http2 for release:"
      default: false
      promptIf: !expr "ServerType == 'dai-release' && ProcessType == 'install'"
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      description: Select yes to enable http2 for the release backend
    - name: ReleaseKeystoreSource
      type: Select
      options:
        - label: Path to the keystore file (the file can be in the raw format or base64 encoded)
          value: file
        - label: Copy/Paste the keystore to editor (the content needs to be base64 encoded)
          value: editor
        - label: Generic Secret containing keystore file with key as ssl-keystore.p12
          value: secret
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Select source of the keystore for the server:"
      promptIf: !expr ServerType == 'dai-release' && ProcessType == "install" && Http2EnabledRelease
      description: "Provide source of the keystore"
      default: ""
    - name: ReleaseKeystoreEditor
      type: Editor
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide keystore for the server:"
      promptIf: !expr "ServerType == 'dai-release' && ProcessType == 'install' && ReleaseKeystoreSource == 'editor'"
      description: "Provide keystore for the server in pkcs12 format, generated with openssl"
      default: ""
    - name: ReleaseKeystoreFile
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide keystore file for the server:"
      promptIf: !expr ServerType == 'dai-release' && ProcessType == 'install' && ReleaseKeystoreSource == 'file'
      description: Provide the keystore file for the server
      validate: !expr "isFile(ReleaseKeystoreFile)"
      default: ""
    - name: ReleaseKeystoreSecretName
      type: Select
      options:
        - !expr k8sResources(Namespace, 'secrets')
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide the generic secret name with the release server keystore added as key ssl-keystore.p12:"
      promptIf: !expr ServerType == 'dai-release' && ProcessType == "install" && ReleaseKeystoreSource == 'secret'
      description: Provide the Generic secret name with the keystore release server
    - name: ReleaseKeystore
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      description: Provide the keystore for the server
      value: !expr "ReleaseKeystoreSource == 'editor' ? ifBase64(ReleaseKeystoreEditor) : ifBase64(ifFileReadBytes(ReleaseKeystoreFile))"
      default: ""
    - name: ReleaseKeystorePassword
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      allowEmpty: true
      overrideDefault: true
      prompt: "Provide the server keystore password:"
      promptIf: !expr ServerType == 'dai-release' && ProcessType == "install" && Http2EnabledRelease
      description: Keystore passphrase for the server
      default: ""
    - name: ReleaseKeystoreKeyPassword
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      allowEmpty: true
      overrideDefault: true
      prompt: "Provide the server keystore key passphrase:"
      promptIf: !expr ServerType == 'dai-release' && ProcessType == "install" && Http2EnabledRelease
      description: Keystore key passphrase for the server
      default: ""
    - name: IngressTypeGeneric
      type: Select
      prompt: "Select between supported ingress types:"
      options:
        - label: NGINX
          value: nginx
        - label: HAProxy
          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 "K8sSetup != 'Openshift' && ServerType != 'dai-release-remote-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: NGINX
          value: nginx
        - label: HAProxy
          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 "K8sSetup == 'Openshift' && ServerType != 'dai-release-remote-runner' && ProcessType == 'install'"
      saveInXlvals: true
      default: route
      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.*', IngressTypeOpenshift) ? length(k8sResources(Namespace, 'ingressclasses')) > '0' : true"
    - name: IngressType
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      value: !expr "K8sSetup == 'Openshift' ? 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: ExternalIngressClass
      type: Select
      options:
        - !expr k8sResources(Namespace, 'ingressclasses')
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide external ingress class:"
      promptIf: !expr ProcessType == "install" && K8sSetup != 'Openshift' && IngressType == "external"
      description: External ingress class
    - name: EnableIngressTls
      type: Confirm
      default: false
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Do you want to enable an TLS/SSL configuration (if yes, requires existing TLS secret in the namespace):"
      promptIf: !expr ServerType != 'dai-release-remote-runner' && ProcessType == "install" && K8sSetup != 'Openshift' && IngressType != "none"
      description: "Enable TLS/SSL in the Ingress configuration if you already have the TLS secret with the key and certificate created in the working namespace."
      validate: !expr "EnableIngressTls ? length(k8sResources(Namespace, 'secrets')) > '0' : true"
    - 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-remote-runner' && ProcessType == "install" && IngressType != "none"
      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: 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 EnableIngressTls && ProcessType == "install" && K8sSetup != 'Openshift' && IngressType != "none"
      description: Provide the TLS secret name with the key and certificate
    - name: AdminPassword
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide administrator password:"
      promptIf: !expr ServerType != 'dai-release-remote-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-remote-runner' && ProcessType == "install"
      description: Provide the type of 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-remote-runner' && ProcessType == "upgrade"
      description: Provide the type of the 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"]'
    - 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"]'
    - name: ExternalOidcConfGeneric
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      value: !expr "OidcConfigType == 'external' ? (ServerType == 'dai-deploy' ? ExternalOidcConfGenericDeploy : ExternalOidcConfGenericRelease) : ''"
      description: The type of the 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"]
    - 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"]
    - name: IdentityServiceConf
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      value: !expr "OidcConfigType == 'identity-service' ? (ServerType == 'dai-deploy' ? IdentityServiceConfDeploy : IdentityServiceConfRelease) : ''"
      description: The type of the 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 ServerType == 'dai-deploy' && (ProcessType == 'install' || ProcessType == 'upgrade')
      default: deploy-operator
      description: Enter the operator image to use
    - 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 ServerType == 'dai-release' && (ProcessType == 'install' || ProcessType == 'upgrade')
      default: release-operator
      description: Enter the operator image to use
    - name: OperatorImageTag
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr "ServerType != 'dai-release-remote-runner' && (ProcessType == 'install' || ProcessType == 'upgrade')"
      prompt: "Enter the operator image tag (eg: <tagName> from <repositoryName>/<imageName>:<tagName>):"
      default: 23.3.1
      description: Enter the operator image tag to use
    - 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
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Select source of the repository keystore:"
      promptIf: !expr ServerType != 'dai-release-remote-runner' && ProcessType == "install"
      description: "Provide source of the license file"
      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 == 'editor' ? ifBase64(RepositoryKeystoreEditor) : ifBase64(ifFileReadBytes(RepositoryKeystoreFile))"
    - name: KeystorePassphrase
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide keystore passphrase:"
      promptIf: !expr ServerType != 'dai-release-remote-runner' && ProcessType == "install"
      description: Keystore passphrase for the server
      default: !expr "RepositoryKeystoreSource == 'generate' ? randPassword() : ''"
    - 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-remote-runner' && ProcessType == "install"
      description: Provide storage class for the server
    - name: EnablePostgresql
      type: Confirm
      default: !expr ServerType != 'dai-release-remote-runner'
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Do you want to install a new PostgreSQL on the cluster:"
      promptIf: !expr ServerType != 'dai-release-remote-runner' && ProcessType == "install"
      description: "Enable PostgreSQL by using new PostgreSQL installation from the subchart, or use existing DB installation that is supported. Select y for new PostgreSQL installation, or press n for seting up connection to existing DB instance."
    - 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" && EnablePostgresql
      description: Provide Storage Class to be defined for PostgreSQL
    - name: PostgresqlPvcSize
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide PVC size for PostgreSQL (Gi):"
      promptIf: !expr ProcessType == "install" && EnablePostgresql
      default: 8
      description: Provide PVC size for PostgreSQL
      validate: !expr "regex('^([0-9])+(\\.)?([0-9])*$', PostgresqlPvcSize)"
    - name: PostgresqlExternalConfigRelease
      type: Editor
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Edit database external setup:"
      promptIf: !expr "ServerType == 'dai-release' && ProcessType == 'install' && EnablePostgresql == false"
      description: Setup the PostgreSQL external parameters (JDBC URL, username, password)
      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' && EnablePostgresql == false"
      description: Setup the PostgreSQL external parameters (JDBC URL, username, password)
      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: EnableRabbitmq
      type: Confirm
      default: !expr ServerType != 'dai-release-remote-runner'
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Do you want to install a new RabbitMQ on the cluster:"
      promptIf: !expr ServerType != 'dai-release-remote-runner' && ProcessType == "install"
      description: "Enable RabbitMQ by using new RabbitMQ installation from the subchart, or use existing MQ installation that is supported. Select y for new RabbitMQ installation, or press n for seting up connection to existing MQ instance."
    - name: RabbitmqReplicaCount
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Replica count to be defined for RabbitMQ:"
      default: 3
      promptIf: !expr "ProcessType == 'install' && EnableRabbitmq"
      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' && EnableRabbitmq"
      description: Storage Class to be defined for RabbitMQ
    - name: RabbitmqPvcSize
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide PVC size for RabbitMQ (Gi):"
      default: 8
      promptIf: !expr "ProcessType == 'install' && EnableRabbitmq"
      description: Provide PVC size for RabbitMQ
      validate: !expr "regex('^([0-9])+(\\.)?([0-9])*$', RabbitmqPvcSize)"
    - name: RabbitmqExternalConfigRelease
      type: Editor
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Edit RabbitMQ external setup:"
      promptIf: !expr "ServerType == 'dai-release' && ProcessType == 'install' && EnableRabbitmq == false"
      description: Setup the RabbitMQ external parameters
      default: |-
        url: <queue-url>
        queueName: <queue-name>
        username: <username>
        password: |-
          <password>
    - name: RabbitmqExternalConfigDeploy
      type: Editor
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Edit RabbitMQ external setup:"
      promptIf: !expr "ServerType == 'dai-deploy' && ProcessType == 'install' && EnableRabbitmq == false"
      description: Setup the RabbitMQ external parameters
      default: |-
        url: <queue-url>
        queueName: <queue-name>
        username: <username>
        password: |-
          <password>
        driverClassName: <driver-class-name>
    - name: CrdName
      type: Select
      options:
        - !expr k8sResources(Namespace, 'crd')
      saveInXlvals: true
      promptIf: !expr "ServerType != 'dai-release-remote-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-remote-runner' && (CleanBefore || ProcessType == 'clean' || (ProcessType == 'upgrade' && UpgradeType == 'operatorToOperator')) ? k8sResource(Namespace, 'crd', ShortServerName) : ''"
    - name: IsCrdReused
      type: Confirm
      saveInXlvals: true
      promptIf: !expr "ServerType != 'dai-release-remote-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-remote-runner' && ProcessType == 'upgrade' && UpgradeType == 'OperatorToOperator'"
    - name: CrName
      type: Select
      options:
        - !expr k8sResources(Namespace, CrdName)
      saveInXlvals: true
      promptIf: !expr "ServerType != 'dai-release-remote-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-remote-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 Deploy CR"
      default: ".metadata.name: .\n.spec.centralConfiguration.persistence.storageClass: \n  0.0: .spec.Persistence.StorageClass\n  23.3: .\n.spec.master.persistence.storageClass: \n  0.0: .spec.Persistence.StorageClass\n  23.3: .\n.spec.worker.persistence.storageClass: \n  0.0: .spec.Persistence.StorageClass\n  23.3: .\n.spec.auth.adminPassword: \n  0.0: .spec.AdminPassword\n  23.3: .\n.spec.centralConfiguration.replicaCount: .\n.spec.centralConfiguration.persistence.accessModes[0]:\n  0.0: .spec.Persistence.AccessMode\n  23.3: \n.spec.centralConfiguration.persistence.accessModes:\n  0.0: \n  23.3: .\n.spec.centralConfiguration.persistence.size: \n  0.0: .spec.centralConfiguration.persistence.pvcSize\n  23.3: .\n.spec.centralConfiguration.persistence.existingClaim: \n  0.0: \n    existance: .spec.deploy.centralConfiguration.persistence.existingClaim\n    expression: .spec.deploy.centralConfiguration.persistence.existingClaim\n  23.3: .\n.spec.centralConfiguration.migrateFromEmbedded: .\n.spec.master.replicaCount: \n  0.0: .spec.XldMasterCount\n  23.3: .\n.spec.master.persistence.accessModes[0]:\n  0.0: .spec.Persistence.AccessMode\n  23.3:\n.spec.master.persistence.accessModes:\n  0.0: \n  23.3: .\n.spec.master.persistence.size: \n  0.0: .spec.Persistence.XldMasterPvcSize\n  23.3: .\n.spec.master.persistence.existingClaim: \n  0.0: \n    existance: .spec.deploy.master.persistence.existingClaim\n    expression: .spec.deploy.master.persistence.existingClaim\n  23.3: .\n.spec.worker.replicaCount: \n  0.0: .spec.XldWorkerCount\n  23.3: .\n.spec.worker.persistence.accessModes[0]: \n  0.0: .spec.Persistence.AccessMode\n  23.3:\n.spec.worker.persistence.accessModes:\n  0.0:\n  23.3: .\n.spec.worker.persistence.size: \n  0.0: .spec.Persistence.XldWorkerPvcSize\n  23.3: .\n.spec.worker.persistence.existingClaim: \n  0.0: \n    existance: .spec.deploy.worker.persistence.existingClaim\n    expression: .spec.deploy.worker.persistence.existingClaim\n  23.3: .\n.spec.oidc: .\n.spec.external.db: \n  0.0: \n  23.3: .\n.spec.external.db.enabled: \n  0.0: .spec.UseExistingDB.Enabled\n  23.3: \n.spec.external.db.main.url: \n  0.0: .spec.UseExistingDB.XL_DB_URL\n  23.3:\n.spec.external.db.main.username: \n  0.0: .spec.UseExistingDB.XL_DB_USERNAME\n  23.3:\n.spec.external.db.main.password: \n  0.0: .spec.UseExistingDB.XL_DB_PASSWORD\n  23.3:\n.spec.external.db.report.url: \n  0.0: .spec.UseExistingDB.XL_REPORT_DB_URL // .spec.UseExistingDB.XL_DB_URL\n  23.3:\n.spec.external.db.report.username: \n  0.0: .spec.UseExistingDB.XL_REPORT_DB_USER // .spec.UseExistingDB.XL_REPORT_DB_USERNAME // .spec.UseExistingDB.XL_DB_USERNAME\n  23.3:\n.spec.external.db.report.password: \n  0.0: .spec.UseExistingDB.XL_REPORT_DB_PASS // .spec.UseExistingDB.XL_REPORT_DB_PASSWORD // .spec.UseExistingDB.XL_DB_PASSWORD\n  23.3:\n.spec.external.mq:\n  0.0: \n  23.3: .\n.spec.external.mq.enabled: \n  0.0: .spec.UseExistingMQ.Enabled\n  23.3: \n.spec.external.mq.url: \n  0.0: .spec.UseExistingMQ.XLD_TASK_QUEUE_URL\n  23.3: \n.spec.external.mq.username: \n  0.0: .spec.UseExistingMQ.XLD_TASK_QUEUE_USERNAME\n  23.3: \n.spec.external.mq.password: \n  0.0: .spec.UseExistingMQ.XLD_TASK_QUEUE_PASSWORD\n  23.3: \n.spec.external.mq.driverClassName: \n  0.0: .spec.UseExistingMQ.XLD_TASK_QUEUE_DRIVER_CLASS_NAME\n  23.3: \n.spec.ingress.enabled: \n  0.0: .spec.ingress.Enabled\n  23.3: .\n.spec.ingress.hostname: \n  0.0: .spec.ingress.hosts.[0]\n  23.3: .\n.spec.ingress.path: .\n.spec.ingress.annotations: .\n.spec.ingress.extraTls: \n  0.0: .spec.ingress.tls\n  23.3: .\n.spec.keystore.passphrase: \n  0.0: .spec.KeystorePassphrase\n  23.3: .\n.spec.keystore.keystore: \n  0.0: .spec.RepositoryKeystore\n  23.3: .\n.spec.postgresql.install: .\n.spec.postgresql.primary.persistence.size: \n  0.0: .spec.postgresql.persistence.size\n  23.3: .\n.spec.postgresql.global.storageClass: \n  0.0: .spec.postgresql.persistence.storageClass\n  23.3: .\n.spec.postgresql.primary.persistence.storageClass: \n  0.0: .spec.postgresql.persistence.storageClass\n  23.3: .\n.spec.postgresql.primary.extendedConfiguration: \n  0.0:\n    existance: .spec.postgresql.postgresqlMaxConnections\n    expression: .spec.postgresql.postgresqlMaxConnections as $maxConnection | \"max_connections = \" + $maxConnection\n  23.3: .\n.spec.postgresql.hasReport: \n  0.0: .spec.postgresql.hasReport // false\n  23.3: .\n# preserve current DB version\n.spec.postgresql.image.tag: .\n.spec.haproxy-ingress.install: .\n.spec.nginx-ingress-controller.install: .\n.spec.rabbitmq.install: .\n.spec.rabbitmq.persistence.storageClass: .\n.spec.rabbitmq.persistence.size: .\n.spec.rabbitmq.replicaCount: .\n.spec.rabbitmq.persistence.replicaCount: .\n# upgrade to next supported MQ version (do the manual upgrade later)\n.spec.rabbitmq.image.tag:\n  0.0:\n    existance: .spec.rabbitmq.image.tag\n    expression: .spec.rabbitmq.image.updateTag // \"3.10.25\"\n  23.3: .\n.spec.route.hostname: \n  0.0: .spec.route.hosts.[0]\n  23.3: .\n.spec.route.path: .\n.spec.route.annotations: .\n.spec.route.tls: .\n.spec.route.enabled: \n  0.0: .spec.route.Enabled\n  23.3: .\n.spec.license: \n  0.0: .spec.xldLicense\n  23.3: .\n.spec.licenseAcceptEula: \n  0.0:\n  23.3: ."
    - 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 Release CR
      default: ".metadata.name: .\n.spec.persistence.storageClass: \n  0.0: .spec.Persistence.StorageClass\n  23.3: .\n.spec.auth.adminPassword: \n  0.0: .spec.AdminPassword\n  23.3: .\n.spec.replicaCount: .\n.spec.persistence.accessModes.[0]: \n  0.0: .spec.Persistence.AccessMode\n  23.3: \n.spec.persistence.accessModes:\n  0.0: \n  23.3: .\n.spec.persistence.size: \n  0.0: .spec.Persistence.Size\n  23.3: .\n.spec.persistence.existingClaim: \n  0.0: \n    existance: .spec.Persistence.ExistingClaim\n    expression: .spec.Persistence.ExistingClaim \n  23.3: .\n.spec.oidc: .\n.spec.external.db: \n  0.0: \n  23.3: .\n.spec.external.db.enabled: \n  0.0: .spec.UseExistingDB.Enabled\n  23.3: \n.spec.external.db.main.url: \n  0.0: .spec.UseExistingDB.XLR_DB_URL\n  23.3:\n.spec.external.db.main.username: \n  0.0: .spec.UseExistingDB.XLR_DB_USER\n  23.3:\n.spec.external.db.main.password: \n  0.0: .spec.UseExistingDB.XLR_DB_PASS\n  23.3:\n.spec.external.db.report.url: \n  0.0: .spec.UseExistingDB.XLR_REPORT_DB_URL\n  23.3:\n.spec.external.db.report.username: \n  0.0: .spec.UseExistingDB.XLR_REPORT_DB_USER\n  23.3:\n.spec.external.db.report.password: \n  0.0: .spec.UseExistingDB.XLR_REPORT_DB_PASS\n  23.3:\n.spec.external.mq:\n  0.0: \n  23.3: .\n.spec.external.mq.enabled: \n  0.0: .spec.UseExistingMQ.Enabled\n  23.3: \n.spec.external.mq.url: \n  0.0: .spec.UseExistingMQ.XLR_TASK_QUEUE_URL\n  23.3: \n.spec.external.mq.queueName: \n  0.0: .spec.UseExistingMQ.XLR_TASK_QUEUE_NAME\n  23.3: \n.spec.external.mq.username: \n  0.0: .spec.UseExistingMQ.XLR_TASK_QUEUE_USERNAME\n  23.3: \n.spec.external.mq.password: \n  0.0: .spec.UseExistingMQ.XLR_TASK_QUEUE_PASSWORD\n  23.3: \n.spec.ingress.enabled: \n  0.0: .spec.ingress.Enabled\n  23.3: .\n.spec.ingress.hostname: \n  0.0: .spec.ingress.hosts.[0]\n  23.3: .\n.spec.ingress.path: .\n.spec.ingress.annotations: .\n.spec.ingress.extraTls: \n  0.0: .spec.ingress.tls\n  23.3: .\n.spec.keystore.passphrase: \n  0.0: .spec.KeystorePassphrase\n  23.3: .\n.spec.keystore.keystore: \n  0.0: .spec.RepositoryKeystore\n  23.3: .\n.spec.postgresql.install: .\n.spec.postgresql.primary.persistence.size: \n  0.0: .spec.postgresql.persistence.size\n  23.3: .\n.spec.postgresql.global.storageClass: \n  0.0: .spec.postgresql.persistence.storageClass\n  23.3: .\n.spec.postgresql.primary.persistence.storageClass: \n  0.0: .spec.postgresql.persistence.storageClass\n  23.3: .\n.spec.postgresql.primary.extendedConfiguration: \n  0.0:\n    existance: .spec.postgresql.postgresqlMaxConnections\n    expression: .spec.postgresql.postgresqlMaxConnections as $maxConnection | \"max_connections = \" + $maxConnection\n  23.3: .\n# preserve current DB version\n.spec.postgresql.image.tag: .\n.spec.haproxy-ingress.install: .\n.spec.nginx-ingress-controller.install: .\n.spec.rabbitmq.install: .\n.spec.rabbitmq.persistence.storageClass: .\n.spec.rabbitmq.persistence.size: .\n.spec.rabbitmq.replicaCount: .\n.spec.rabbitmq.persistence.replicaCount: .\n# upgrade to next supported MQ version (do the manual upgrade later)\n.spec.rabbitmq.image.tag:\n  0.0:\n    existance: .spec.rabbitmq.image.tag\n    expression: .spec.rabbitmq.image.updateTag // \"3.10.25\"\n  23.3: .\n.spec.route.hostname: \n  0.0: .spec.route.hosts.[0]\n  23.3: .\n.spec.route.path: .\n.spec.route.annotations: .\n.spec.route.tls: .\n.spec.route.enabled: \n  0.0: .spec.route.Enabled\n  23.3: .\n.spec.license: \n  0.0: .spec.xlrLicense\n  23.3: .\n.spec.licenseAcceptEula: \n  0.0:\n  23.3: .\n.spec.http2.enabled: .\n.spec.ssl: ."
    - name: PreservePvc
      type: Confirm
      saveInXlvals: true
      promptIf: !expr "(ProcessType == 'clean' || CleanBefore) && ServerType != 'dai-release-remote-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-remote-runner' && UpgradeType == 'helmToOperator' && ProcessType == 'upgrade'
      prompt: "Enter the helm release name:"
      ignoreIfSkipped: true
      overrideDefault: true
      description: The name of your custom resource definition.
    - name: RemoteRunnerInstallConfirm
      type: Confirm
      saveInXlvals: true
      promptIf: !expr ServerType == 'dai-release' && ProcessType == 'install'
      prompt: "Install Remote Runner for Digital.ai Release:"
      description: "Type yes to install Remote Runner for Digital.ai Release. The installation will start after Release is ready on the cluster."
    - name: RemoteRunnerInstall
      type: Confirm
      saveInXlvals: true
      value: !expr "(ServerType == 'dai-release' && ProcessType == 'install') ? RemoteRunnerInstallConfirm : (ServerType == 'dai-release-remote-runner')"
    - name: RemoteRunnerRepositoryName
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr "RemoteRunnerInstall && (ProcessType == 'install' || ProcessType == 'upgrade')"
      prompt: "Enter the Remote Runner repository name (eg: <repositoryName> from <repositoryName>/<imageName>:<tagName>):"
      default: xebialabs
      description: Enter the Remote Runner repository name to use
    - name: ImageNameRemoteRunner
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr "RemoteRunnerInstall && (ProcessType == 'install' || ProcessType == 'upgrade')"
      prompt: "Enter the Remote Runner image name (eg: <imageName> from <repositoryName>/<imageName>:<tagName>):"
      default: release-remote-runner
      description: Enter the Remote Runner image name to use
    - name: ImageTagRemoteRunner
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      promptIf: !expr "RemoteRunnerInstall && (ProcessType == 'install' || ProcessType == 'upgrade')"
      prompt: "Enter the Release Remote Runner image tag (eg: <tagName> from <repositoryName>/<imageName>:<tagName>):"
      default: 23.3.0
      description: Enter the Release Remote Runner image tag to use
    - name: RemoteRunnerReleaseName
      type: Input
      saveInXlvals: true
      promptIf: !expr RemoteRunnerInstall && ServerType == 'dai-release-remote-runner'
      prompt: "Enter the Remote Runner Helm Chart release name:"
      ignoreIfSkipped: false
      overrideDefault: true
      description: Remote Runner Helm Chart release name that will be used with helm command during installation.
      default: remote-runner
    - name: RemoteRunnerUseDefaultLocation
      type: Confirm
      default: true
      saveInXlvals: true
      promptIf: !expr RemoteRunnerInstall && (ProcessType == 'install' || ProcessType == 'upgrade')
      prompt: "Use default version of the Remote Runner helm chart:"
      description: "Type yes to use default internal version of the Remote Runner helm chart, in other way 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 Remote Runner Helm Chart path (URL or local path):"
      ignoreIfSkipped: true
      overrideDefault: true
      description: Remote Runner Helm Chart local filesystem path or URL to the Remote Runner Helm Chart package.
    - name: RemoteRunnerGeneration
      type: Confirm
      saveInXlvals: true
      promptIf: !expr false
      prompt: "Do Remote Runner generation:"
      ignoreIfSkipped: !expr false
      overrideDefault: !expr true
      default: false
      description: Generation date and time.
    - name: RemoteRunnerReleaseUrl
      type: Input
      saveInXlvals: true
      promptIf: !expr RemoteRunnerInstall && (ServerType == 'dai-release-remote-runner' || RemoteRunnerGeneration) && (ProcessType == 'install' || ProcessType == 'upgrade')
      prompt: "Enter the Release URL that will be used by Remote Runner:"
      ignoreIfSkipped: true
      overrideDefault: true
      default: !expr "'http://dai-xlr-digitalai-release.' + Namespace"
      description: The Release URL that will be used by Release Remote Runner, it needs to be accessible from the Remote Runner pod.
      validate: !expr "regex('^https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)$', RemoteRunnerReleaseUrl)"
    - name: RemoteRunnerUserEmail
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide remote-runner user email (for the user on the Release to send PAT expiration notifications):"
      promptIf: !expr RemoteRunnerInstall && ServerType != 'dai-release-remote-runner' && (ProcessType == 'install' || ProcessType == 'upgrade')
      description: remote-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: "remote-runner@no.reply"
    - name: RemoteRunnerUserPassword
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Provide remote-runner user password (user on the Release):"
      promptIf: !expr RemoteRunnerInstall && ServerType != 'dai-release-remote-runner' && (ProcessType == 'install' || ProcessType == 'upgrade')
      description: remote-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
      ignoreIfSkipped: true
      overrideDefault: true
      prompt: "Remote Runner token expiration:"
      promptIf: !expr RemoteRunnerInstall && ServerType != 'dai-release-remote-runner' && (ProcessType == 'install' || ProcessType == 'upgrade')
      description: "Provide Remote Runner token expiration"
      default: 0
    - name: RemoteRunnerToken
      type: Input
      saveInXlvals: true
      promptIf: !expr RemoteRunnerInstall && (ServerType == 'dai-release-remote-runner' || RemoteRunnerGeneration) && (ProcessType == 'install' || ProcessType == 'upgrade')
      prompt: "Enter the Release Token that will be used by Remote Runner:"
      ignoreIfSkipped: true
      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 Remote Runner replica count:"
      default: 1
      description: Enter the Remote 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-remote-runner' && (ProcessType == 'install' || ProcessType == 'upgrade')
      prompt: "Enable truststore for Remote Runner:"
      description: "Type yes to setup truststore for Remote Runner"
    - name: RemoteRunnerTruststore
      type: Editor
      saveInXlvals: true
      ignoreIfSkipped: true
      allowEmpty: true
      overrideDefault: true
      prompt: "Provide base64 encoded PKCS12 truststore:"
      promptIf: !expr IsRemoteRunnerTruststoreEnabled && RemoteRunnerInstall && (ProcessType == 'install' || ProcessType == 'upgrade')
      description: The Remote Runner truststore with the trusted certificates. Accepted is PKCS12 format.
      default: ""
    - name: RemoteRunnerTruststorePassword
      type: Input
      saveInXlvals: true
      ignoreIfSkipped: true
      allowEmpty: true
      overrideDefault: true
      prompt: "Provide truststore password:"
      promptIf: !expr IsRemoteRunnerTruststoreEnabled && RemoteRunnerInstall && (ProcessType == 'install' || ProcessType == 'upgrade')
      description: The Remote Runner truststore password
      default: ""
  files:
    # Generic
    - path: digitalai/generated_answers.yaml.tmpl
      renameTo: !expr "'digitalai/generated_answers_' + ServerType + '_' +  Namespace + '_' + ProcessType + '-' + GenerationDateTime + '.yaml.tmpl'"
    # Deploy
    - path: digitalai/dai-deploy/kubernetes-generic/template/leader-election-role.yaml
      writeIf: !expr ServerType == 'dai-deploy' && (ProcessType == 'install' || ProcessType == 'upgrade')
      renameTo: !expr "'digitalai/dai-deploy/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/leader-election-role.yaml'"
    - path: digitalai/dai-deploy/kubernetes-generic/template/leader-election-rolebinding.yaml.tmpl
      writeIf: !expr ServerType == 'dai-deploy' && (ProcessType == 'install' || ProcessType == 'upgrade')
      renameTo: !expr "'digitalai/dai-deploy/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/leader-election-rolebinding.yaml.tmpl'"
    - path: digitalai/dai-deploy/kubernetes-generic/template/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/manager-clusterrole.yaml.tmpl'"
    - path: digitalai/dai-deploy/kubernetes-generic/template/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/manager-clusterrolebinding.yaml.tmpl'"
    - path: digitalai/dai-deploy/kubernetes-generic/template/manager-role.yaml
      writeIf: !expr ServerType == 'dai-deploy' && (ProcessType == 'install' || ProcessType == 'upgrade')
      renameTo: !expr "'digitalai/dai-deploy/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/manager-role.yaml'"
    - path: digitalai/dai-deploy/kubernetes-generic/template/manager-rolebinding.yaml.tmpl
      writeIf: !expr ServerType == 'dai-deploy' && (ProcessType == 'install' || ProcessType == 'upgrade')
      renameTo: !expr "'digitalai/dai-deploy/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/manager-rolebinding.yaml.tmpl'"
    - path: digitalai/dai-deploy/kubernetes-generic/template/proxy-role.yaml
      writeIf: !expr ServerType == 'dai-deploy' && (ProcessType == 'install' || ProcessType == 'upgrade')
      renameTo: !expr "'digitalai/dai-deploy/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/proxy-role.yaml'"
    - path: digitalai/dai-deploy/kubernetes-generic/template/proxy-rolebinding.yaml.tmpl
      writeIf: !expr ServerType == 'dai-deploy' && (ProcessType == 'install' || ProcessType == 'upgrade')
      renameTo: !expr "'digitalai/dai-deploy/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/proxy-rolebinding.yaml.tmpl'"
    - path: digitalai/dai-deploy/kubernetes-generic/template/custom-resource-definition.yaml
      writeIf: !expr ServerType == 'dai-deploy' && (ProcessType == 'install' || ProcessType == 'upgrade')
      renameTo: !expr "'digitalai/dai-deploy/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/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/controller-manager-metrics-service.yaml
      writeIf: !expr ServerType == 'dai-deploy'  && (ProcessType == 'install' || ProcessType == 'upgrade')
      renameTo: !expr "'digitalai/dai-deploy/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/controller-manager-metrics-service.yaml'"
    - path: digitalai/dai-deploy/kubernetes-generic/template/deployment.yaml.tmpl
      writeIf: !expr ServerType == 'dai-deploy' && (ProcessType == 'install' || ProcessType == 'upgrade')
      renameTo: !expr "'digitalai/dai-deploy/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/deployment.yaml.tmpl'"
    # Release
    - path: digitalai/dai-release/kubernetes-generic/template/leader-election-role.yaml
      writeIf: !expr ServerType == 'dai-release' && (ProcessType == 'install' || ProcessType == 'upgrade')
      renameTo: !expr "'digitalai/dai-release/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/leader-election-role.yaml'"
    - path: digitalai/dai-release/kubernetes-generic/template/leader-election-rolebinding.yaml.tmpl
      writeIf: !expr ServerType == 'dai-release' && (ProcessType == 'install' || ProcessType == 'upgrade')
      renameTo: !expr "'digitalai/dai-release/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/leader-election-rolebinding.yaml.tmpl'"
    - path: digitalai/dai-release/kubernetes-generic/template/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/manager-clusterrole.yaml.tmpl'"
    - path: digitalai/dai-release/kubernetes-generic/template/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/manager-clusterrolebinding.yaml.tmpl'"
    - path: digitalai/dai-release/kubernetes-generic/template/manager-role.yaml
      writeIf: !expr ServerType == 'dai-release' && (ProcessType == 'install' || ProcessType == 'upgrade')
      renameTo: !expr "'digitalai/dai-release/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/manager-role.yaml'"
    - path: digitalai/dai-release/kubernetes-generic/template/manager-rolebinding.yaml.tmpl
      writeIf: !expr ServerType == 'dai-release' && (ProcessType == 'install' || ProcessType == 'upgrade')
      renameTo: !expr "'digitalai/dai-release/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/manager-rolebinding.yaml.tmpl'"
    - path: digitalai/dai-release/kubernetes-generic/template/proxy-role.yaml
      writeIf: !expr ServerType == 'dai-release' && (ProcessType == 'install' || ProcessType == 'upgrade')
      renameTo: !expr "'digitalai/dai-release/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/proxy-role.yaml'"
    - path: digitalai/dai-release/kubernetes-generic/template/proxy-rolebinding.yaml.tmpl
      writeIf: !expr ServerType == 'dai-release' && (ProcessType == 'install' || ProcessType == 'upgrade')
      renameTo: !expr "'digitalai/dai-release/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/proxy-rolebinding.yaml.tmpl'"
    - path: digitalai/dai-release/kubernetes-generic/template/custom-resource-definition.yaml
      writeIf: !expr ServerType == 'dai-release' && (ProcessType == 'install' || ProcessType == 'upgrade')
      renameTo: !expr "'digitalai/dai-release/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/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/controller-manager-metrics-service.yaml
      writeIf: !expr ServerType == 'dai-release' && (ProcessType == 'install' || ProcessType == 'upgrade')
      renameTo: !expr "'digitalai/dai-release/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/controller-manager-metrics-service.yaml'"
    - path: digitalai/dai-release/kubernetes-generic/template/deployment.yaml.tmpl
      writeIf: !expr ServerType == 'dai-release' && (ProcessType == 'install' || ProcessType == 'upgrade')
      renameTo: !expr "'digitalai/dai-release/' + Namespace + '/' + GenerationDateTime + '/kubernetes/template/deployment.yaml.tmpl'"
    # Remote runner
    - path: digitalai/dai-release-remote-runner/values-cli.yaml.tmpl
      writeIf: !expr RemoteRunnerInstall && (RemoteRunnerGeneration || ServerType == 'dai-release-remote-runner')
      renameTo: !expr "'digitalai/' + ServerType + '/' + Namespace + '/' + GenerationDateTime + '/kubernetes/values-cli.yaml.tmpl'"
    - path: digitalai/dai-release-remote-runner/install.yaml
      writeIf: !expr RemoteRunnerInstall && ServerType != 'dai-release-remote-runner'
      renameTo: !expr "'digitalai/' + ServerType + '/' + Namespace + '/' + GenerationDateTime + '/kubernetes/install.yaml'"
    - path: digitalai/dai-release-remote-runner/create-remote-runner-user.yaml.tmpl
      writeIf: !expr RemoteRunnerInstall && ServerType != 'dai-release-remote-runner'
      renameTo: !expr "'digitalai/' + ServerType + '/' + Namespace + '/' + GenerationDateTime + '/kubernetes/create-remote-runner-user.yaml.tmpl'"
