-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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 template node to pod name. Fixes #1319 #6712
Conversation
Signed-off-by: Alex Collins <alex_collins@intuit.com>
Signed-off-by: J.P. Zivalich <j.p.zivalich@gmail.com>
Signed-off-by: J.P. Zivalich <j.p.zivalich@gmail.com>
Signed-off-by: J.P. Zivalich <j.p.zivalich@gmail.com>
Signed-off-by: J.P. Zivalich <j.p.zivalich@gmail.com>
Signed-off-by: J.P. Zivalich <j.p.zivalich@gmail.com>
Signed-off-by: J.P. Zivalich <j.p.zivalich@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #6712 +/- ##
==========================================
+ Coverage 48.57% 48.67% +0.10%
==========================================
Files 262 264 +2
Lines 18991 19080 +89
==========================================
+ Hits 9224 9287 +63
- Misses 8739 8750 +11
- Partials 1028 1043 +15
Continue to review full report at Codecov.
|
Signed-off-by: J.P. Zivalich <j.p.zivalich@gmail.com>
Signed-off-by: J.P. Zivalich <j.p.zivalich@gmail.com>
Signed-off-by: J.P. Zivalich <j.p.zivalich@gmail.com>
Signed-off-by: J.P. Zivalich <j.p.zivalich@gmail.com>
Signed-off-by: J.P. Zivalich <j.p.zivalich@gmail.com>
Signed-off-by: J.P. Zivalich <j.p.zivalich@gmail.com>
docs/environment-variables.md
Outdated
@@ -32,6 +32,7 @@ Note that these environment variables may be removed at any time. | |||
| `RETRY_BACKOFF_STEPS` | `int` | `5` | The retry backoff steps when retrying API calls. | | |||
| `RETRY_HOST_NAME_LABEL_KEY` | `string` | `kubernetes.io/hostname` | The label key for host name used when retrying templates. | | |||
| `TRANSIENT_ERROR_PATTERN` | `string` | `""` | The regular expression that represents additional patterns for transient errors. | | |||
| `USE_LEGACY_POD_NAMES` | `bool` | `false` | Whether to have pod names contain the template name (false) or be the node id (true). | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about POD_NAMES=v1
default is v2
testNodePodExists(t, woc) | ||
} | ||
|
||
func testNodePodExists(t *testing.T, woc *wfOperationCtx) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be Test
uppercase T
workflow/controller/workflowpod.go
Outdated
Namespace: woc.wf.ObjectMeta.Namespace, | ||
Labels: map[string]string{ | ||
common.LabelKeyWorkflow: woc.wf.ObjectMeta.Name, // Allows filtering by pods related to specific workflow | ||
common.LabelKeyCompleted: "false", // Allows filtering by incomplete workflow pods | ||
}, | ||
Annotations: map[string]string{ | ||
common.AnnotationKeyNodeName: nodeName, | ||
common.AnnotationKeyNodeID: nodeID, // TODO - test annotation is applied |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO
workflow/util/util.go
Outdated
@@ -1054,3 +1061,31 @@ func GetNodeType(tmpl *wfv1.Template) wfv1.NodeType { | |||
} | |||
return "" | |||
} | |||
|
|||
// PodName return a deterministic pod name | |||
func PodName(workflowName, nodeName, templateName, nodeID string) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please put this func into own file
workflow/util/util_test.go
Outdated
@@ -839,3 +840,34 @@ func TestToUnstructured(t *testing.T) { | |||
assert.Equal(t, workflow.Version, gv.Version) | |||
} | |||
} | |||
|
|||
func TestPodName(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
own file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some small changes
Signed-off-by: J.P. Zivalich <j.p.zivalich@gmail.com>
LGTM. Passing to @sarabala1979 for him to review. |
@sarabala1979 I'm going to assume you're lack of reply means you are not able to review this. I'll merge. |
Signed-off-by: J.P. Zivalich <j.p.zivalich@gmail.com> Signed-off-by: kriti-sc <kathuriakriti1@gmail.com>
Signed-off-by: kriti-sc <kathuriakriti1@gmail.com>
I am using v3.2.8 and not seeing this behaviour. |
This PR is a continuation of Alex's PoC #6647 that fixes #1319. It:
USE_LEGACY_POD_NAMES
is set to trueSample terminal output: