Skip to content

Job is not deleted when AnalysisRun is deleted if there is no ownerReference #4600

@snuggie12

Description

@snuggie12

Checklist:

  • I've included steps to reproduce the bug.
  • I've included the version of argo rollouts.

Describe the bug

We only use rollouts in conjunction with kargo and the Job is created on a separate cluster than the AnalysisRun.

Kargo is cleaning up the AnalysisRun resources, but the Jobs still remain. This is because the Job does not receive a .metadata.ownerReference field.

To Reproduce

Since I use kargo, I imagine the steps without it are:

  • Create an AnalysisRun on one cluster and have another cluster use ARGO_ROLLOUTS_ANALYSIS_JOB_KUBECONFIG set to in-cluster
  • Delete the AnalysisRun after completion

Expected behavior

The cluster running the Job notices the AnalysisRun is deleted and the Job is either deleted or marked for deletion. I believe this could be achieved by scanning the jobs and looking at the labels and annotations on them to identify which one belonged to the AnalysisRun.

Screenshots

Version

v1.8.3

Logs

# Paste the logs from the rollout controller

# Logs for the entire controller:
kubectl logs -n argo-rollouts deployment/argo-rollouts

# Logs for a specific rollout:
kubectl logs -n argo-rollouts deployment/argo-rollouts | grep rollout=<ROLLOUTNAME

Message from the maintainers:

Impacted by this bug? Give it a 👍. We prioritize the issues with the most 👍.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions