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

feat: add WorkflowTemplate name as label when using workflowTemplateRef. Fixes #12670 #12677

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

eduardodbr
Copy link
Member

@eduardodbr eduardodbr commented Feb 17, 2024

Fixes #12670

Motivation

Modifications

Verification

Create a workflow Template

apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
  name: workflow-template-submittable
spec:
  entrypoint: whalesay
  templates:
    - name: whalesay
      container:
        image: argoproj/argosay:v2
        command: [/argosay]

Launch a Workflow or a CronWorkflow from the workflowTemplate

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  name: workflow-template-hello-world
spec:
  workflowTemplateRef:
    name: workflow-template-submittable
apiVersion: argoproj.io/v1alpha1
kind: CronWorkflow
metadata:
  name: cron-from-template
spec:
  schedule: "* * * * *"
  startingDeadlineSeconds: 30
  concurrencyPolicy: Replace
  workflowSpec:
    workflowTemplateRef:
      name: workflow-template-submittable

The workflow should have the label:

labels:
    workflows.argoproj.io/workflow-template: workflow-template-submittable

…kflow is submitted from a WorkflowTemplate

Signed-off-by: eduardodbr <eduardodbr@hotmail.com>
Signed-off-by: eduardodbr <eduardodbr@hotmail.com>
Signed-off-by: eduardodbr <eduardodbr@hotmail.com>
Signed-off-by: eduardodbr <eduardodbr@hotmail.com>
@agilgur5 agilgur5 changed the title feat: add the WorkflowTemplate name as label when Workflow or CronWorkflow is submitted from a WorkflowTemplate Fixes #12670 feat: add WorkflowTemplate name as label when Workflow submitted from WorkflowTemplate. Fixes #12670 Feb 17, 2024
@agilgur5 agilgur5 changed the title feat: add WorkflowTemplate name as label when Workflow submitted from WorkflowTemplate. Fixes #12670 feat: add WorkflowTemplate name as label when using workflowTemplateRef. Fixes #12670 Feb 17, 2024
@sarabala1979 sarabala1979 self-assigned this Feb 17, 2024
@eduardodbr eduardodbr closed this Feb 17, 2024
@agilgur5 agilgur5 reopened this Jul 21, 2024
Copy link
Contributor

@agilgur5 agilgur5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small comments, but otherwise LGTM. There are also some merge conflicts now as well to resolve

workflow/common/convert.go Outdated Show resolved Hide resolved
workflow/controller/operator.go Outdated Show resolved Hide resolved
@agilgur5 agilgur5 assigned agilgur5 and unassigned sarabala1979 Jul 21, 2024
@agilgur5 agilgur5 modified the milestones: v3.5.x patches, v3.6.0 Jul 21, 2024
@tooptoop4
Copy link
Contributor

@eduardodbr would you be able to include cronworkflow name too?

Signed-off-by: Eduardo Rodrigues <eduardodbr@hotmail.com>
Signed-off-by: Eduardo Rodrigues <eduardodbr@hotmail.com>
Signed-off-by: Eduardo Rodrigues <eduardodbr@hotmail.com>
Signed-off-by: Eduardo Rodrigues <eduardodbr@hotmail.com>
@eduardodbr
Copy link
Member Author

@eduardodbr would you be able to include cronworkflow name too?

If a cronworkflow uses a templateRef, the child workflow will have a label with the cron workflow name and other label with the template name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add WorkflowTemplate name as label when using workflowTemplateRef
4 participants