`apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  annotations:
    acorn.io/app-generation: "0"
  creationTimestamp: null
  labels:
    acorn.io/app-name: app-name
    acorn.io/app-namespace: app-namespace
    acorn.io/app-public-name: app-name
    acorn.io/job-name: oneimage
    acorn.io/managed: "true"
    acorn.io/project-name: app-namespace
  name: oneimage-app-name-app-namespace-1234567890ab
rules:
- apiGroups:
  - foo.io
  resources:
  - bar
  verbs:
  - create

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  annotations:
    acorn.io/app-generation: "0"
  creationTimestamp: null
  labels:
    acorn.io/app-name: app-name
    acorn.io/app-namespace: app-namespace
    acorn.io/app-public-name: app-name
    acorn.io/job-name: oneimage
    acorn.io/managed: "true"
    acorn.io/project-name: app-namespace
  name: oneimage-app-name-app-namespace-1234567890ab
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: oneimage-app-name-app-namespace-1234567890ab
subjects:
- kind: ServiceAccount
  name: oneimage
  namespace: app-created-namespace

---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  annotations:
    acorn.io/app-generation: "0"
  creationTimestamp: null
  labels:
    acorn.io/app-name: app-name
    acorn.io/app-namespace: app-namespace
    acorn.io/app-public-name: app-name
    acorn.io/job-name: oneimage
    acorn.io/managed: "true"
    acorn.io/project-name: app-namespace
  name: oneimage-app-name-app-namespace-1234567890ab-app-namespace
  namespace: app-namespace
rules:
- apiGroups:
  - bar.io
  resources:
  - foo
  verbs:
  - patch

---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  annotations:
    acorn.io/app-generation: "0"
  creationTimestamp: null
  labels:
    acorn.io/app-name: app-name
    acorn.io/app-namespace: app-namespace
    acorn.io/app-public-name: app-name
    acorn.io/job-name: oneimage
    acorn.io/managed: "true"
    acorn.io/project-name: app-namespace
  name: oneimage-app-name-app-namespace-1234567890ab-app-namespace
  namespace: app-namespace
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: oneimage-app-name-app-namespace-1234567890ab-app-namespace
subjects:
- kind: ServiceAccount
  name: oneimage
  namespace: app-created-namespace

---
apiVersion: v1
kind: ServiceAccount
metadata:
  annotations:
    acorn.io/app-generation: "0"
    acorn.io/permissions: '{"serviceName":"oneimage","rules":[{"verbs":["create"],"apiGroups":["foo.io"],"resources":["bar"],"scopes":["account"]},{"verbs":["patch"],"apiGroups":["bar.io"],"resources":["foo"]}]}'
  creationTimestamp: null
  labels:
    acorn.io/app-name: app-name
    acorn.io/app-namespace: app-namespace
    acorn.io/app-public-name: app-name
    acorn.io/job-name: oneimage
    acorn.io/managed: "true"
    acorn.io/project-name: app-namespace
  name: oneimage
  namespace: app-created-namespace

---
apiVersion: batch/v1
kind: Job
metadata:
  annotations:
    acorn.io/app-generation: "0"
    apply.acorn.io/prune: "false"
    apply.acorn.io/update: "true"
  creationTimestamp: null
  labels:
    acorn.io/app-name: app-name
    acorn.io/app-namespace: app-namespace
    acorn.io/app-public-name: app-name
    acorn.io/job-name: oneimage
    acorn.io/managed: "true"
    acorn.io/project-name: app-namespace
  name: oneimage
  namespace: app-created-namespace
spec:
  backoffLimit: 1000
  template:
    metadata:
      annotations:
        acorn.io/container-spec: '{"build":{"context":".","dockerfile":"Dockerfile"},"image":"image-name","metrics":{},"ports":[{"port":80,"protocol":"http","targetPort":81}],"probes":null,"sidecars":{"left":{"image":"foo","metrics":{},"ports":[{"port":90,"protocol":"tcp","targetPort":91}],"probes":null}}}'
      creationTimestamp: null
      labels:
        acorn.io/app-name: app-name
        acorn.io/app-namespace: app-namespace
        acorn.io/app-public-name: app-name
        acorn.io/job-name: oneimage
        acorn.io/managed: "true"
        acorn.io/project-name: app-namespace
    spec:
      containers:
      - env:
        - name: ACORN_EVENT
          value: create
        image: image-name
        name: oneimage
        ports:
        - containerPort: 81
          protocol: TCP
        readinessProbe:
          tcpSocket:
            port: 81
        resources: {}
        volumeMounts:
        - mountPath: /run/secrets
          name: acorn-job-output-helper
      - env:
        - name: ACORN_EVENT
          value: create
        image: foo
        name: left
        ports:
        - containerPort: 91
          protocol: TCP
        readinessProbe:
          tcpSocket:
            port: 91
        resources: {}
        volumeMounts:
        - mountPath: /run/secrets
          name: acorn-job-output-helper
      - command:
        - /usr/local/bin/acorn-job-helper-init
        env:
        - name: ACORN_EVENT
          value: create
        image: ghcr.io/acorn-io/runtime:main
        imagePullPolicy: IfNotPresent
        name: acorn-job-output-helper
        resources: {}
        volumeMounts:
        - mountPath: /run/secrets
          name: acorn-job-output-helper
      enableServiceLinks: false
      imagePullSecrets:
      - name: oneimage-pull-1234567890ab
      restartPolicy: Never
      serviceAccountName: oneimage
      terminationGracePeriodSeconds: 5
      volumes:
      - emptyDir:
          medium: Memory
          sizeLimit: 1M
        name: acorn-job-output-helper
status: {}

---
apiVersion: v1
data:
  .dockerconfigjson: eyJhdXRocyI6eyJnaGNyLmlvIjp7ImF1dGgiOiJPZz09In0sImluZGV4LmRvY2tlci5pbyI6eyJhdXRoIjoiT2c9PSJ9fX0=
kind: Secret
metadata:
  creationTimestamp: null
  labels:
    acorn.io/managed: "true"
    acorn.io/pull-secret: "true"
  name: oneimage-pull-1234567890ab
  namespace: app-created-namespace
type: kubernetes.io/dockerconfigjson

---
apiVersion: internal.acorn.io/v1
kind: AppInstance
metadata:
  creationTimestamp: null
  name: app-name
  namespace: app-namespace
  uid: 1234567890abcdef
spec:
  image: test
  permissions:
  - rules:
    - apiGroups:
      - foo.io
      resources:
      - bar
      scopes:
      - account
      verbs:
      - create
    - apiGroups:
      - bar.io
      resources:
      - foo
      verbs:
      - patch
    serviceName: oneimage
status:
  appImage:
    id: test
    imageData: {}
    vcs: {}
  appSpec:
    jobs:
      oneimage:
        build:
          context: .
          dockerfile: Dockerfile
        image: image-name
        metrics: {}
        ports:
        - port: 80
          protocol: http
          targetPort: 81
        probes: null
        sidecars:
          left:
            image: foo
            metrics: {}
            ports:
            - port: 90
              protocol: tcp
              targetPort: 91
            probes: null
  appStatus:
    jobs:
      oneimage: {}
  columns: {}
  conditions:
    reason: Success
    status: "True"
    success: true
    type: defined
  defaults: {}
  namespace: app-created-namespace
  staged:
    appImage:
      imageData: {}
      vcs: {}
  summary: {}
`
