Uploaded image for project: 'OpenShift GitOps'
  1. OpenShift GitOps
  2. GITOPS-4133

Creating Job from CronJob using ArgoCD UI fails with - cannot set blockOwnerDeletion

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 1.11.3
    • 1.11.0, 1.11.1
    • ArgoCD
    • 3
    • False
    • None
    • False
    • With the fix in this issue, users can now go to Argo CD UI and create job executions from cron job defined in a deployed Argo CD application.
    • Bug Fix
    • Proposed
    • Hide
      • Create Role like following

       

      apiVersion: rbac.authorization.k8s.io/v1
      kind: Role
      metadata:
        name: openshift-gitops-argocd-server-addon
      rules:
      - apiGroups:
        - batch
        resources:
        - cronjobs
        - jobs
        - cronjobs/finalizers
        verbs:
        - create
        - update
      • Create RoleBinding like following which will provide the resource access to openshift-gitops-argocd-server
      apiVersion: rbac.authorization.k8s.io/v1
      kind: RoleBinding
      metadata:
        name: openshift-gitops-argocd-server-addon
      roleRef:
        apiGroup: rbac.authorization.k8s.io
        kind: Role
        name: openshift-gitops-argocd-server-addon
      subjects:
      - kind: ServiceAccount
        name: openshift-gitops-argocd-server
        namespace: openshift-gitops 

       

      Show
      Create Role like following   apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: openshift-gitops-argocd-server-addon rules: - apiGroups: - batch resources: - cronjobs - jobs - cronjobs/finalizers verbs: - create - update Create RoleBinding like following which will provide the resource access to openshift-gitops-argocd-server apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: openshift-gitops-argocd-server-addon roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: openshift-gitops-argocd-server-addon subjects: - kind: ServiceAccount name: openshift-gitops-argocd-server namespace: openshift-gitops  
    • GITOPS Sprint 3253, GITOPS Sprint 3254

    Description

      Description of problem:

      When attempting to Create Job from a CronJob in ArgoCD UI, following error is observed:

       

      Unable to execute resource action: jobs.batch "hello-202402250648" is forbidden: cannot set blockOwnerDeletion if an ownerReference refers to a resource you can't set finalizers on: , <nil> 

      Note: The initial error is as mentioned in GITOPS-3617 . The above error occurs only after applying workaround for GITOPS-3617 .

       

       

       

      Workaroud:

      Adding cronjobs/finalizers resource update access to openshift-gitops-argocd-server service account helps resolve the issue.

      Prerequisites (if any, like setup, operators/versions):

      Steps to Reproduce

      • Install Red Hat Openshift Gitops v1.11.x
      • Create an Application with a Cronjob
      • Apply workaround of GITOPS-3617
      • Try to start the CronJob using ArgoCD UI - select the created Application in ArgoCD UI, find the CronJob object and start the cronjob using Create Job 

      Actual results:

      • The CronJob fails to create the Job instance

      Expected results:

      • The CronJob should be able to create the Job instance

      Reproducibility (Always/Intermittent/Only Once): Always

      Acceptance criteria: 

       

      Definition of Done:

      Build Details:

      Additional info (Such as Logs, Screenshots, etc):

      Screenshot attached : Screenshot from 2024-02-25 12-19-04.png

       *

      Attachments

        Issue Links

          Activity

            People

              cfang@redhat.com Cheng Fang
              rhn-support-rissingh Rishabh Singh
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: