apiVersion: v1
kind: Template
metadata:
  name: address-space
objects:
  - apiVersion: v1
    kind: ConfigMap
    metadata:
      name: ${NAMESPACE}.${NAME}
      labels:
        type: address-space
    data:
      config.json: |-
        {
          "apiVersion": "enmasse.io/v1",
          "kind": "AddressSpace",
          "metadata": {
            "name": "${NAME}",
            "annotations": {
              "enmasse.io/namespace": "${NAMESPACE}"
            }
          },
          "spec": {
            "type": "${TYPE}",
            "plan": "${PLAN}"
          }
        }
parameters:
  - name: NAME
    description: Name of address space
    required: true
  - name: NAMESPACE
    description: Namespace to deploy address space to
    required: true
  - name: TYPE
    description: Type of address space
    required: true
  - name: PLAN
    description: Plan to use for address space
    required: true

apiVersion: v1
kind: Template
metadata:
  name: address-space
objects:
  - apiVersion: v1
    kind: ConfigMap
    metadata:
      name: ${NAMESPACE}.${NAME}
      labels:
        type: address-space
    data:
      config.json: |-
        {
          "apiVersion": "enmasse.io/v1",
          "kind": "AddressSpace",
          "metadata": {
            "name": "${NAME}",
            "namespace": "${NAMESPACE}",
            "annotations": {
              "enmasse.io/namespace": "${NAMESPACE}",
              "enmasse.io/realm-name": "${NAMESPACE}"
            }
          },
          "spec": {
            "type": "${TYPE}",
            "plan": "${PLAN}"
          }
        }
parameters:
  - name: NAME
    description: Name of address space
    required: true
  - name: NAMESPACE
    description: Namespace to deploy address space to
    required: true
  - name: TYPE
    description: Type of address space
    required: true
  - name: PLAN
    description: Plan to use for address space
    required: true

Update address space template to include namespace
Update address space template to include namespace
