---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: syndesis-operator
  labels:
    app: syndesis
    syndesis.io/app: syndesis
    syndesis.io/type: operator
    syndesis.io/component: syndesis-operator
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
  name: syndesis-operator
  labels:
    app: syndesis
    syndesis.io/app: syndesis
    syndesis.io/type: operator
    syndesis.io/component: syndesis-operator
rules:
- apiGroups:
  - syndesis.io
  resources:
  - syndesises
  - syndesises/finalizers
  verbs: [ get, list, create, update, delete, deletecollection, watch ]
- apiGroups:
  - ""
  resources:
  - pods
  - services
  - endpoints
  - persistentvolumeclaims
  - configmaps
  - secrets
  - serviceaccounts
  verbs: [ get, list, create, update, delete, deletecollection, watch]
- apiGroups:
  - ""
  resources:
  - events
  verbs: [ get, list ]
- apiGroups:
  - rbac.authorization.k8s.io
  resources:
  - rolebindings
  verbs: [ get, list, create, update, delete, deletecollection, watch]
- apiGroups:
  - template.openshift.io
  resources:
  - processedtemplates
  verbs: [ get, list, create, update, delete, deletecollection, watch]
- apiGroups:
  - image.openshift.io
  resources:
  - imagestreams
  verbs: [ get, list, create, update, delete, deletecollection, watch]
- apiGroups:
  - apps.openshift.io
  resources:
  - deploymentconfigs
  verbs: [ get, list, create, update, delete, deletecollection, watch]
- apiGroups:
  - build.openshift.io
  resources:
  - buildconfigs
  verbs:
  verbs: [ get, list, create, update, delete, deletecollection, watch]
- apiGroups:
  - authorization.openshift.io
  resources:
  - rolebindings
  verbs: [ get, list, create, update, delete, deletecollection, watch]
- apiGroups:
  - route.openshift.io
  resources:
  - routes
  - routes/custom-host
  verbs: [ get, list, create, update, delete, deletecollection, watch]
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
  name: syndesis-operator:install
  labels:
    app: syndesis
    syndesis.io/app: syndesis
    syndesis.io/type: operator
    syndesis.io/component: syndesis-operator
subjects:
- kind: ServiceAccount
  name: syndesis-operator
roleRef:
  kind: Role
  name: syndesis-operator
  apiGroup: rbac.authorization.k8s.io
---
kind: RoleBinding
apiVersion: authorization.openshift.io/v1
metadata:
  name: syndesis-operator:view
  labels:
    app: syndesis
    syndesis.io/app: syndesis
    syndesis.io/type: operator
    syndesis.io/component: syndesis-operator
subjects:
- kind: ServiceAccount
  name: syndesis-operator
roleRef:
  name: view
---
kind: RoleBinding
apiVersion: authorization.openshift.io/v1
metadata:
  name: syndesis-operator:edit
  labels:
    app: syndesis
    syndesis.io/app: syndesis
    syndesis.io/type: operator
    syndesis.io/component: syndesis-operator
subjects:
- kind: ServiceAccount
  name: syndesis-operator
roleRef:
  name: edit
---
apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
  annotations:
    openshift.io/image.insecureRepository: "false"
  labels:
    app: syndesis
    syndesis.io/app: syndesis
    syndesis.io/type: operator
    syndesis.io/component: syndesis-operator
  name: fuse-online-operator
spec:
  lookupPolicy:
    local: false
  tags:
  - from:
      kind: DockerImage
      # Keep tag 'latest' here, its used as an anchor in the release script
      name: registry.access.redhat.com/fuse7/fuse-online-operator:1.2-7
    importPolicy:
      scheduled: true
    name: "1.5"
---
apiVersion: v1
kind: DeploymentConfig
metadata:
  name: syndesis-operator
  labels:
    app: syndesis
    syndesis.io/app: syndesis
    syndesis.io/type: operator
    syndesis.io/component: syndesis-operator
spec:
  strategy:
    type: Recreate
  replicas: 1
  selector:
      syndesis.io/app: syndesis
      syndesis.io/type: operator
      syndesis.io/component: syndesis-operator
  template:
    metadata:
      labels:
        syndesis.io/app: syndesis
        syndesis.io/type: operator
        syndesis.io/component: syndesis-operator
    spec:
      serviceAccountName: syndesis-operator
      containers:
        - name: syndesis-operator
          image: ' '
          imagePullPolicy: IfNotPresent
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
          volumeMounts:
            - mountPath: /conf
              name: syndesis-template-vol
      volumes:
      - name: syndesis-template-vol
        configMap:
          name: syndesis-template
  triggers:
  - imageChangeParams:
      automatic: true
      containerNames:
      - syndesis-operator
      from:
        kind: ImageStreamTag
        name: fuse-online-operator:1.5
    type: ImageChange
  - type: ConfigChange
