Open ghost opened 8 years ago
Good idea, thats easy enough, just add a check here and "continue" if service.status
is stopped.
I'm pretty busy at the moment, I plan to certainly address it in the future, otherwise PRs are welcome!
I took a quick look at this. At first glance I'd say the major hangup is that the rancher-metadata service does not expose the state of the service. It only does so for containers and that's not helpful because the containers themselves are naturally going to be stopped most of the time.
Yeah, metadata might not be the best option for this - its great to quickly get a container with a specific label, but not much else (for this use case). Rancher API does have ability to get Service
by Id
(service.uuid
) and Service
has HealthState
Any chance of rolling out a new release so that these changes are available in the official image?
While debugging (or calming backend services) I sometimes need to temporarily disable a cron-ed service.
I tried setting the service to "Stopped" but rancher-cron runs the service anyway. My current workaround is to "upgrade" services and change the rancher-cron label to something like 'off....' to preserve the crontab entry format but disable.
It would be ideal if rancher-cron could poll the api and not start cron services if they are "Stopped"