Uploaded image for project: 'TrueNAS'
  1. TrueNAS
  2. NAS-110751

Allow show_if and show_subquestions_if to evaluate values from parent variables

    XMLWordPrintable

Details

    • Suggestion
    • Status: Gathering Interest (View Workflow)
    • Low
    • Resolution: Unresolved
    • None
    • None
    • None
    • Security Level: Public
    • None

    Description

      If this option becomes available it will help clean up the app installation UI. 
      One example is the following.

      In the following code block, when service.main.type = "ClusterIP"
      i want to hide the `- variable: nodePort` block.

      show_if: [["service.main.type","=","ClusterIP"]] does not work.

        - variable: service
          group: "Networking"
          label: "Configure Service(s)"
          schema:
            type: dict
            attrs:
              - variable: main
                label: "Main Service"
                description: "The Primary service on which the healthcheck runs, often the webUI"
                schema:
                  type: dict
                  attrs:
                    - variable: enabled
                      label: "Enable the service"
                      schema:
                        type: boolean
                        default: true
                        hidden: true
                    - variable: type
                      label: "Service Type"
                      description: "ClusterIP's are only internally available, nodePorts expose the container to the host node System, Loadbalancer exposes the service using the system loadbalancer"
                      schema:
                        type: string
                        default: "NodePort"
                        enum:
                          - value: "NodePort"
                            description: "NodePort"
                          - value: "ClusterIP"
                            description: "ClusterIP"
                          - value: "LoadBalancer"
                            description: "LoadBalancer"
                    - variable: loadBalancerIP
                      label: "LoadBalancer IP"
                      description: "LoadBalancerIP"
                      schema:
                        show_if: [["type", "=", "LoadBalancer"]]
                        type: string
                        default: ""
                        required: true
                    - variable: exetrnalIPs
                      label: "External IP's"
                      description: "External IP's"
                      schema:
                        show_if: [["type", "=", "LoadBalancer"]]
                        type: list
                        default: []
                        items:
                          - variable: externalIP
                            label: "External IP"
                            required: true
                            schema:
                              type: string
                    - variable: ports
                      label: "Service's Port(s) Configuration"
                      schema:
                        type: dict
                        attrs:
                          - variable: main
                            label: "Main Service Port Configuration"
                            schema:
                              type: dict
                              attrs:
                                - variable: protocol
                                  label: "Port Type"
                                  schema:
                                    type: string
                                    default: "HTTP"
                                    hidden: false
                                    enum:
                                      - value: HTTP
                                        description: "HTTP"
                                      - value: "HTTPS"
                                        description: "HTTPS"
                                      - value: TCP
                                        description: "TCP"
                                      - value: "UDP"
                                        description: "UDP"
                                - variable: port
                                  label: "Container Port"
                                  schema:
                                    type: int
                                    default: 9091
                                    editable: false
                                    hidden: true
                                - variable: targetport
                                  label: "Target Port"
                                  description: "This port exposes the container port on the service"
                                  schema:
                                    type: int
                                    default: 9091
                                    editable: true
                                    hidden: false
                                    required: true
                                - variable: nodePort
                                  label: "Node Port (Optional)"
                                  description: "This port gets exposed to the node. Only considered when service type is NodePort"
                                  schema:
                                    type: int
                                    min: 9000
                                    max: 65535
                                    default: 36019
                                    required: true

       

      Attachments

        Attachments

          JEditor

            Activity

              People

                releng Triage Team
                StavrosMadK Stavros Kois
                Votes:
                7 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated: