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

fix: Apply the creator labels about the user who resubmitted a Workflow #11415

Merged
merged 3 commits into from Jul 22, 2023

Conversation

umi0410
Copy link
Contributor

@umi0410 umi0410 commented Jul 22, 2023

Fixes #11414

Motivation

There was a problem related to creator labels of a resubmitted Workflow.

When the creators of an existing Workflow and a new Workflow, created by resubmission, are different, incorrect creator labels are propagated to the new Workflow. A detailed illustration is in #11414.

Modifications

I modified FormulateResubmitWorkflow to apply the creator labels for the actual user who resubmits a Workflow by adding a context argument to the FormulateResubmitWorkflow function.

Verification

  1. Submit a Workflow and resubmit one based on the just-submitted Workflow.
    # Submit a Workflow as the user 'foo'
    $ argo submit wf-whalesay.yaml --token ${FOO_TOKEN}
    Name:                hello-world-p485h
    Namespace:           argo
    ServiceAccount:      unset (will run with the default ServiceAccount)
    Status:              Pending
    Created:             Sat Jul 22 11:51:58 +0900 (now)
    Progress:
    
    # Resubmit a Workflow as the user 'bar'
    $ argo resubmit hello-world-p485h --token ${BAR_TOKEN}
    Name:                hello-world-tfbp9
    Namespace:           argo
    ServiceAccount:      unset (will run with the default ServiceAccount)
    Status:              Pending
    Created:             Sat Jul 22 11:52:30 +0900 (now)
    Progress:
    
    # Resubmit a Workflow without authentication
    $ argo resubmit hello-world-p485h
    Name:                hello-world-tdv6r
    Namespace:           argo
    ServiceAccount:      unset (will run with the default ServiceAccount)
    Status:              Pending
    Created:             Sat Jul 22 14:13:58 +0900 (now)
    Progress:
  2. Compare the creator labels of the two Workflows. Now, we can see the creator labels of the second Workflow are correctly associated with user bar and the third Workflow doesn't have the creator labels.
    $ kubectl get wf -o yaml | yq '.items[] | [{"name": .metadata.name, "labels": .metadata.labels}]'
    - name: hello-world-p485h
      labels:
        workflows.argoproj.io/completed: "true"
        workflows.argoproj.io/creator: 0af436c4-faee-418a-8f0d-860ba852c87b
        workflows.argoproj.io/creator-email: foo.at.example.com
        workflows.argoproj.io/creator-preferred-username: foo
        workflows.argoproj.io/phase: Succeeded
    - name: hello-world-tfbp9
      labels:
        workflows.argoproj.io/completed: "true"
        workflows.argoproj.io/creator: b8caf2ac-22ef-4947-b917-03201fc950b7
        workflows.argoproj.io/creator-email: bar.at.example.com
        workflows.argoproj.io/creator-preferred-username: bar
        workflows.argoproj.io/phase: Succeeded
        workflows.argoproj.io/resubmitted-from-workflow: hello-world-p485h
    - name: hello-world-tdv6r
      labels:
        workflows.argoproj.io/phase: Running
        workflows.argoproj.io/resubmitted-from-workflow: hello-world-p485h

If any additional test code are needed, I can write some. -> I added some.

@umi0410 umi0410 force-pushed the fix-11414 branch 3 times, most recently from d1a57c6 to becb751 Compare July 22, 2023 07:16
…ow on resubmitting the Workflow

Signed-off-by: Jinsu Park <dev.umijs@gmail.com>
Signed-off-by: Jinsu Park <dev.umijs@gmail.com>
Signed-off-by: Jinsu Park <dev.umijs@gmail.com>
@terrytangyuan terrytangyuan merged commit c6a2a4f into argoproj:master Jul 22, 2023
23 checks passed
@agilgur5 agilgur5 added the area/api Argo Server API label Oct 6, 2023
dpadhiar pushed a commit to dpadhiar/argo-workflows that referenced this pull request May 9, 2024
…ow (argoproj#11415)

Signed-off-by: Dillen Padhiar <dillen_padhiar@intuit.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Argo Server API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect creator labels on a resubmitted Workflow
3 participants