apiVersion: batch/v1
kind: Job
metadata:
  name: remindmebot-init
  labels:
    job: remindmebot-init
spec:
  template:
    spec:
      restartPolicy: OnFailure
      imagePullSecrets:
        - name: registry.internal.aleemhaji.com
      containers:
        - name: remindmebot-init
          image: registry.internal.aleemhaji.com/curl:7.72.0
          command:
            - sh
            - -c
            - |
              curl \
                  -u "${BOT_NAME}:${BOT_API_KEY}" \
                  -H "Content-Type: application/json" \
                  -X "POST" \
                  -d '{"webhook":"https://remindmebot.aleemhaji.com/receive","features":{"receiveReadReceipts":false,"receiveIsTyping":false,"manuallySendReadReceipts":false,"receiveDeliveryReceipts":false}}' \
                  https://api.kik.com/v1/config
          env:
            - name: BOT_NAME
              valueFrom:
                configMapKeyRef:
                  name: remindmebot-config
                  key: bot_username
            - name: BOT_API_KEY
              valueFrom:
                secretKeyRef:
                  name: remindmebot-secrets
                  key: bot_api_key
