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: use env when pod version annotation is missing. Fixes #10237 #10457

Merged
merged 3 commits into from
Feb 13, 2023

Conversation

isubasinghe
Copy link
Member

@isubasinghe isubasinghe commented Feb 3, 2023

Signed-off-by: Isitha Subasinghe isitha@pipekit.io

Fixes #10237

Please do not open a pull request until you have checked ALL of these:

  • Create the PR as draft .
  • Run make pre-commit -B to fix codegen and lint problems.
  • Sign-off your commits (otherwise the DCO check will fail).
  • Use a conventional commit message (otherwise the commit message check will fail).
  • "Fixes #" is in both the PR title (for release notes) and this description (to automatically link and close the issue).
  • [] Add unit or e2e tests. Say how you tested your changes. If you changed the UI, attach screenshots.
  • Github checks are green.
  • Once required tests have passed, mark your PR "Ready for review".

If changes were requested, and you've made them, dismiss the review to get it reviewed again.

Signed-off-by: Isitha Subasinghe <isitha@pipekit.io>
@isubasinghe isubasinghe changed the title fix: use env when pod version annotation is missing fix: use env when pod version annotation is missing. Fixes #10237 Feb 3, 2023
@isubasinghe isubasinghe marked this pull request as ready for review February 3, 2023 04:16
@@ -79,8 +79,10 @@ func ensurePodNamePrefixLength(prefix string) string {
// given workflow
func GetWorkflowPodNameVersion(wf *v1alpha1.Workflow) PodNameVersion {
annotations := wf.GetAnnotations()
version := annotations[common.AnnotationKeyPodNameVersion]

version, ok := annotations[common.AnnotationKeyPodNameVersion]
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the default in the switch case below still valid? Otherwise this could potentially be rewritten so that GetPodNameVersion() is the default case?

Copy link
Member Author

@isubasinghe isubasinghe Feb 9, 2023

Choose a reason for hiding this comment

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

I was tempted to implement this fix that way but that default switch case will be hit if the annotation is invalid. That is a different behaviour to the GetPodNameVersion call.

But yeah I was on the fence on this about what the "right behaviour" is. This is why I went with the current approach, at least it will always be consistent when the user makes a wrong annotation (default to v2).

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, sounds good!

Copy link
Contributor

@NikeNano NikeNano left a comment

Choose a reason for hiding this comment

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

LGTM

@alexec alexec added this pull request to the merge queue Feb 12, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Feb 12, 2023
@alexec alexec added this pull request to the merge queue Feb 12, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Feb 13, 2023
@alexec alexec added this pull request to the merge queue Feb 13, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Feb 13, 2023
@alexec alexec enabled auto-merge (squash) February 13, 2023 19:41
@alexec alexec disabled auto-merge February 13, 2023 19:43
@alexec alexec enabled auto-merge (squash) February 13, 2023 20:05
@alexec alexec merged commit 08c8500 into argoproj:master Feb 13, 2023
terrytangyuan pushed a commit that referenced this pull request Mar 29, 2023
…0457)

Signed-off-by: Isitha Subasinghe <isitha@pipekit.io>
Co-authored-by: Alex Collins <alexec@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent pod name with parallelization enabled
3 participants