Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] cron.present duplicates entries when changing timespec to special #60997

Closed
1 of 6 tasks
asomers opened this issue Oct 4, 2021 · 0 comments · Fixed by #60998
Closed
1 of 6 tasks

[BUG] cron.present duplicates entries when changing timespec to special #60997

asomers opened this issue Oct 4, 2021 · 0 comments · Fixed by #60998
Assignees
Labels
Bug broken, incorrect, or confusing behavior Sulfur v3006.0 release code name and version
Milestone

Comments

@asomers
Copy link
Contributor

asomers commented Oct 4, 2021

Description
When you change the time specification in a cron.present entry from regular to special or vice versa, it will add the new job but not remove the old one. That results in two jobs with the same name,identifier, and user but different timespecs.

Setup
Please be as specific as possible and give set-up details.

  • on-prem machine
  • VM (Virtualbox, KVM, etc. please specify)
  • VM running on a cloud service, please be explicit and add details
  • container (Kubernetes, Docker, containerd, etc. please specify)
  • or a combination, please be explicit
  • jails if it is FreeBSD

Steps to Reproduce the behavior
Create a state like this in Pillar:

pwd:
  cron.present:
    - identifier: foo

apply state, then change the pillar to this:

pwd:
  cron.present:
    - identifier: foo
    - special: '@hourly'

Apply state again. There will now be two cron jobs in the crontab, that look like this:

Lines below here are managed by Salt, do not edit
# SALT_CRON_IDENTIFIER: foo
* * * * * pwd
# SALT_CRON_IDENTIFIER: foo
@hourly pwd

Expected behavior
cron.present should delete the old * * * * * pwd entry when it creates the new @hourly pwd one.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
          Salt: 3003.3
 
Dependency Versions:
          cffi: 1.14.6
      cherrypy: Not Installed
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: 4.0.7
     gitpython: 3.1.20
        Jinja2: 3.0.0
       libgit2: Not Installed
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: 2.20
      pycrypto: Not Installed
  pycryptodome: 3.10.1
        pygit2: Not Installed
        Python: 3.8.12 (default, Sep 13 2021, 18:37:45)
  python-gnupg: Not Installed
        PyYAML: 5.4.1
         PyZMQ: 22.2.1
         smmap: 4.0.0
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.3.4
 
System Versions:
          dist: freebsd 13.0 
        locale: utf-8
       machine: amd64
       release: 13.0-AXCIENT2
        system: FreeBSD
       version: FreeBSD 13.0</summary>
@asomers asomers added Bug broken, incorrect, or confusing behavior needs-triage labels Oct 4, 2021
@garethgreenaway garethgreenaway added Phosphorus v3005.0 Release code name and version and removed needs-triage labels Mar 29, 2022
@garethgreenaway garethgreenaway added this to the Approved milestone Mar 29, 2022
@garethgreenaway garethgreenaway added Sulfur v3006.0 release code name and version and removed Phosphorus v3005.0 Release code name and version labels Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Sulfur v3006.0 release code name and version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants