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: Use WorkflowTemplate/ClusterWorkflowTemplate Informers when validating CronWorkflows #11470

Merged
merged 9 commits into from
Jul 29, 2023

Conversation

juliev0
Copy link
Contributor

@juliev0 juliev0 commented Jul 28, 2023

Fixes #11372

Motivation

When a CronWorkflow gets run it first gets validated. If it contains a WorkflowTemplate or CronWorkflowTemplate, it goes to the K8S API to get the spec to do the validation, rather than using what's already been stored locally in the Informer caches.

Modifications

Uses the WorkflowTemplate Informer and ClusterWorkflowTemplate Informer instead.

Verification

  • Ran locally with a CronWorkflow which uses a WorkflowTemplate, as well as one which uses a CronWorkflowTemplate.

Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>
Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>
Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>
Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>
@@ -135,7 +135,7 @@ kind: ClusterWorkflowTemplate
metadata:
name: cluster-workflow-template-submittable
spec:
entryPoint: whalesay-template
entrypoint: whalesay-template
arguments:
parameters:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not related but this is a typo

Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>
}

func NewClusterWorkflowTemplateFromInformerGetter(cwftmplInformer wfextvv1alpha1.ClusterWorkflowTemplateInformer) templateresolution.ClusterWorkflowTemplateGetter {
return &ClusterWorkflowTemplateFromInformerGetter{cwftmplInformer: cwftmplInformer}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

let me know if there's a better place to put this struct...

Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>
Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>
Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>
@juliev0 juliev0 changed the title Use WorkflowTemplate/ClusterWorkflowTemplate Informers when validating CronWorkflows feat: Use WorkflowTemplate/ClusterWorkflowTemplate Informers when validating CronWorkflows Jul 28, 2023
Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>
@juliev0 juliev0 marked this pull request as ready for review July 28, 2023 22:45
Copy link
Member

@terrytangyuan terrytangyuan left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you!

@terrytangyuan terrytangyuan merged commit 6b36200 into argoproj:master Jul 29, 2023
22 checks passed
terrytangyuan pushed a commit that referenced this pull request Nov 27, 2023
…idating CronWorkflows (#11470)

Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>
dpadhiar pushed a commit to dpadhiar/argo-workflows that referenced this pull request May 9, 2024
…idating CronWorkflows (argoproj#11470)

Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cron Workflow Controller should use WorkflowTemplateInformer and ClusterWorkflowTemplateInformer
3 participants