# Copyright 2018 TriggerMesh, Inc
#
# 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.

apiVersion: batch/v1
kind: Job
metadata:
  name: registry-test-kaniko-push
spec:
  template:
    spec:
      containers:
      - name: kaniko
        image: gcr.io/kaniko-project/executor:debug-v0.7.0@sha256:661f9f2e7555ab1a692d50eb645cbb843f2b0de4fea8eb228c46aef7f89ce5e7
        command:
        - /busybox/sh
        - -ce
        - |
          date > ./timestamp;
          echo "FROM scratch" > Dockerfile;
          echo "COPY timestamp" >> /timestamp;
          /kaniko/executor --destination=knative.registry.svc.cluster.local/registrytest/kanikopush:latest
      restartPolicy: Never
  backoffLimit: 4
