apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

## global namespace must be set due to:
## https://github.com/kubernetes-sigs/kustomize/issues/1301#issuecomment-1308228710
namespace: kubeflow

resources:
  ## upstream
  - upstream/apps/volumes-web-app/upstream/overlays/istio

  ## local
  {{<- if .Values.kubeflow_tools.volumes.extraManifests >}}
  - resources/extra-manifests.yaml
  {{<- end >}}

patchesStrategicMerge:
  - patches/patch-volumes-web-app-authorizationpolicy.yaml
  - patches/patch-volumes-web-app-virtualservice.yaml

configMapGenerator:
  - name: parameters
    behavior: merge
    literals:
      - VWA_PREFIX="/volumes"
      - VWA_CLUSTER_DOMAIN="cluster.local"
      - VWA_USERID_HEADER="kubeflow-userid"
      - VWA_USERID_PREFIX=""
      - VWA_APP_SECURE_COOKIES="true"

images:
  - name: docker.io/kubeflownotebookswg/volumes-web-app
    newName: {{< .Values.kubeflow_tools.volumes.images.volumesWebApp.repository | quote >}}
    {{<- if .Values.kubeflow_tools.volumes.images.volumesWebApp.tag >}}
    newTag: {{< .Values.kubeflow_tools.volumes.images.volumesWebApp.tag | quote >}}
    {{<- end >}}
