apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./network_v1beta1_netconfig.yaml
- ./vlan-config.yaml
namespace: openstack
labels:
- pairs:
    created-by: install_yamls
patches:
- patch: |-
    - op: replace
      path: /spec/secret
      value: osp-secret
    - op: replace
      path: /spec/storageClass
      value: "local-storage"
    - op: replace
      path: /spec/networks/0/mtu
      value: 1500
    - op: replace
      path: /spec/networks/1/mtu
      value: 1500
    - op: replace
      path: /spec/networks/2/mtu
      value: 1500
    - op: replace
      path: /spec/networks/3/mtu
      value: 1500
    - op: replace
      path: /spec/networks/4/mtu
      value: 1500
    - op: replace
      path: /spec/networks/5/mtu
      value: 1500
  target:
    kind: NetConfig

replacements:
- source:
    fieldPath: data.internalapi
    kind: ConfigMap
    name: vlan-config
  targets:
  - fieldPaths:
    - spec.networks.[name=internalapi].subnets.0.vlan
    select:
      kind: NetConfig
- source:
    fieldPath: data.storage
    kind: ConfigMap
    name: vlan-config
  targets:
  - fieldPaths:
    - spec.networks.[name=storage].subnets.0.vlan
    select:
      kind: NetConfig
- source:
    fieldPath: data.storagemgmt
    kind: ConfigMap
    name: vlan-config
  targets:
  - fieldPaths:
    - spec.networks.[name=storagemgmt].subnets.0.vlan
    select:
      kind: NetConfig
- source:
    fieldPath: data.tenant
    kind: ConfigMap
    name: vlan-config
  targets:
  - fieldPaths:
    - spec.networks.[name=tenant].subnets.0.vlan
    select:
      kind: NetConfig
