如何等到在 jelastic 清单安装中为 appid 创建 env?

How to wait until env for appid is created in jelastic manifest installation?

我有以下 manifest:

jpsVersion: 1.3
jpsType: install
application:
  id: shopozor-k8s-cluster
  name: Shopozor k8s cluster
  version: 0.0

  baseUrl: https://raw.githubusercontent.com/shopozor/services/dev

  settings:
    fields:
      - name: envName
        caption: Env Name
        type: string
        default: shopozor
      - name: topo
        type: radio-fieldset
        values:
          0-dev: '<b>Development:</b> one master (1) and one scalable worker (1+)'
          1-prod: '<b>Production:</b> multi master (3) with API balancers (2+) and scalable workers (2+)'
        default: 0-dev
      - name: version
        type: string
        caption: Version
        default: v1.16.3

  onInstall:
    - installKubernetes
    - enableSubDomains

  actions:
    installKubernetes:
      install:
        jps: https://github.com/jelastic-jps/kubernetes/blob/${settings.version}/manifest.jps
        envName: ${settings.envName}
        displayName: ${settings.envName}
        settings:
          deploy: cmd
          cmd: |-
            curl -fsSL ${baseUrl}/scripts/install_k8s.sh | /bin/bash
          topo: ${settings.topo}
          dashboard: version2
          ingress-controller: Nginx
          storage: true
          api: true
          monitoring: true
          version: ${settings.version}
          jaeger: false
    enableSubDomains:
      - jelastic.env.binder.AddDomains[cp]:
          domains: staging,api-staging,assets-staging,api,assets

不幸的是,当我 运行 清单时,k8s 集群已安装,但无法创建子域(还),因为:

[15:26:28 Shopozor.cluster:3]: enableSubDomains:  {"action":"enableSubDomains","params":{}}
[15:26:29 Shopozor.cluster:4]: api [cp]:  {"method":"jelastic.env.binder.AddDomains","params":{"domains":"staging,api-staging,assets-staging,api,assets"},"nodeGroup":"cp"}
[15:26:29 Shopozor.cluster:4]: ERROR: api.response: {"result":2303,"source":"JEL","error":"env for appid [5ce25f5a6988fbbaf34999b08dd1d47c] not created."}

我可以使用哪些 jelastic API 方法来执行必要的等待,直到可以创建子域?

我目前的解决方法是将该清单拆分为两个清单:一个集群安装清单和一个创建子域的更新清单。但是,我希望所有内容都在同一个清单中。

请更改:

enableSubDomains:
  - jelastic.env.binder.AddDomains[cp]:
      domains: staging,api-staging,assets-staging,api,assets

至:

enableSubDomains:
  - jelastic.env.binder.AddDomains[cp]:
      envName: ${settings.envName}
      domains: staging,api-staging,assets-staging,api,assets