1

The doc https://docs.openshift.com/container-platform/3.9/dev_guide/cron_jobs.html provides details of creating a cron job.

To start a scheduled task that executes a build every 10 mins I use the command:

oc run run-build 161/my-app --image=myimage --restart=OnFailure --schedule='*/10 * * * *' 

Which returns:

cronjob.batch/run-build created

But the job fails to start:

The log of pod displays:

Error: unknown command "161/my-app" for "openshift-deploy"
Run 'openshift-deploy --help' for usage.

Have I configured the command ( oc run run-build 161/my-app --image=myimage --restart=OnFailure --schedule='*/10 * * * *' ) to start the cron job incorrectly ?

1
  • 1
    What is the command that your job needs to run? Apr 19, 2021 at 15:09

1 Answer 1

1

According the documentation you're giving, you need to remove run-build from the command :

$ oc run NAME --image=<image> \
    [--generator=<resource>] \
    [--port=<port>] \
    [--replicas=<replicas>] \
    [--dry-run=<bool>] \
    [--overrides=<inline_json>] \
    [options]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.