Skip to content

changes in label swarm.cronjob.schedule are not seen by swarm-cronjob #422

@francescor

Description

@francescor

Something similare to #23

We are using docker in Swarm mode (version 27.5.1)

We have swarm-cronjob:1.15 deployed in one of the three managers (we use the ARM image)

We have noted that changes in the label: swarm.cronjob.schedule in a stack service have no effects on swarm-cronjob (we see nothing in its logs, indeed changes become irrelevant).

Our workaround is to execute, every time:

docker service update --force swarm-cronjob_app

This is our swarm-cronjob.yml

services:
  app:
    image: crazymax/swarm-cronjob:1.15
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"
    environment:
      - "TZ=Europe/Rome"
      - "LOG_LEVEL=info"
      - "LOG_JSON=true"
    deploy:
      mode: replicated
      replicas: 1
      placement:
        constraints:
          - node.role == manager
          - node.platform.arch == aarch64

and this is an example of the labels of a service we want to cron

    deploy:
      placement:
        constraints:
          - node.role == worker
          - engine.labels.jobs-type == cron
      replicas: 1
      labels:
        swarm.cronjob.enable: "true"
        swarm.cronjob.schedule: "10 23 * * *"
        swarm.cronjob.skip-running: "true"
        swarm.cronjob.replicas: 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions