# Copyright 2020 The Tekton Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

patches:
- target:
    kind: Deployment
    name: tekton-operator
  patch: |-
    - op: replace
      path: /metadata/name
      value: openshift-pipelines-operator
- path: operator.yaml
  target:
    kind: Deployment
    name: tekton-operator
- path: webhook.yaml
  target:
    kind: Deployment
    name: tekton-operator-webhook
- path: role.yaml
  target:
    kind: ClusterRole
    name: tekton-operator
- path: role_binding.yaml
  target:
    kind: ClusterRoleBinding
    name: tekton-operator

patchesStrategicMerge:
- 100-namespace.yaml

resources:
- ../../base/
- ../../webhooks
- 300-operator_v1alpha1_addon_crd.yaml
- operator_service.yaml
- operator_servicemonitor.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

configMapGenerator:
- name: tekton-config-defaults
  literals:
  - DEFAULT_TARGET_NAMESPACE=openshift-pipelines
  behavior: merge