apiVersion: batch/v1
kind: Job
metadata:
  name: postiz-temporal-namespace-1-2-0-1
  labels:
    app.kubernetes.io/component: database
    app.kubernetes.io/name: temporal
    helm.sh/chart: temporal-1.2.0
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/instance: postiz
    app.kubernetes.io/version: "1.31.0"
    app.kubernetes.io/part-of: temporal
spec:
  backoffLimit: 100
  ttlSecondsAfterFinished: 86400
  template:
    metadata:
      name: postiz-temporal-namespace-1-2-0-1
      labels:
        app.kubernetes.io/component: database
        app.kubernetes.io/name: temporal
        helm.sh/chart: temporal-1.2.0
        app.kubernetes.io/managed-by: Helm
        app.kubernetes.io/instance: postiz
        app.kubernetes.io/version: "1.31.0"
        app.kubernetes.io/part-of: temporal
    spec:
      serviceAccountName: default
      restartPolicy: OnFailure
      initContainers:
        - name: create-default-namespace
          image: "temporalio/admin-tools:1.31.0@sha256:3e68adcd54195a7c1222e99f2dbc32a4fdbf44ad69e3bb48e21e85c4bf417c2e"
          imagePullPolicy: IfNotPresent
          command: ['/bin/sh', '-c']
          args: ['temporal operator namespace describe -n default || temporal operator namespace create -n default --retention 30d']
          env:
            - name: TEMPORAL_ADDRESS
              value: "postiz-temporal-frontend.postiz.svc:7233"
      containers:
        - name: done
          image: "temporalio/admin-tools:1.31.0@sha256:3e68adcd54195a7c1222e99f2dbc32a4fdbf44ad69e3bb48e21e85c4bf417c2e"
          imagePullPolicy: IfNotPresent
          command: ['sh', '-c', 'echo "Namespace setup completed"']
