-
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: allow cross-namespace locking for semaphore and mutex #11096
feat: allow cross-namespace locking for semaphore and mutex #11096
Conversation
b17f284
to
5d79538
Compare
5d79538
to
13feff6
Compare
a82df3e
to
ab7b89a
Compare
@terrytangyuan @jessesuen @alexec highly appreciate your feedback on this. Is there anything missing, to have this merged? Thanks! |
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.
Looks good to me. I think this PR should also implement this support for mutexes though.
It would be somewhat odd if semaphores supported this while mutexes didn't.
The tests pass for me locally, might just be flaky tests, give it a re-run |
ab7b89a
to
abb4f0b
Compare
Thanks for your feedback @isubasinghe I just added the namespace for mutex, too. |
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.
No worries @woehrl01, I am just undecided if "Namespace is the namespace of the configmap ..." is okay for the mutex.
I mean technically the mutex is backed by a configmap so it is technically correct.
I'm going to approve and leave that to the discretion of yourself and @terrytangyuan
Yes, you're right, I rephrase the comment. Thank you! |
abb4f0b
to
4e526ea
Compare
docs/executor_swagger.md
Outdated
@@ -2468,6 +2468,7 @@ than the MaxAge, it will be ignored. | | | |||
| Name | Type | Go type | Required | Default | Description | Example | | |||
|------|------|---------|:--------:| ------- |-------------|---------| | |||
| name | string| `string` | | | name of the mutex | | | |||
| namespace | string| `string` | | `"namespace of workflow)"`| | | |
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.
fix default here
docs/executor_swagger.md
Outdated
@@ -4229,6 +4230,7 @@ Note that this field cannot be set when spec.os.name is windows. | |||
| Name | Type | Go type | Required | Default | Description | Example | | |||
|------|------|---------|:--------:| ------- |-------------|---------| | |||
| configMapKeyRef | [ConfigMapKeySelector](#config-map-key-selector)| `ConfigMapKeySelector` | | | | | | |||
| namespace | string| `string` | | `"namespace of workflow)"`| | | |
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.
also here, there is a right paren and its inside `` and "".
Should just be:
namespace of workflow
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.
typo in docs, I made two comments
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.
Apoligies: meant to request changes not comment, see previous comment.
Signed-off-by: Lukas Wöhrl <lukas.woehrl@plentymarkets.com>
4e526ea
to
a2038a7
Compare
Just renamed the default again and put it in brackets to be more visible of a "variable" argument. Unfortunately, I can't remove the quotes, they are added automatically. Alternative would be to put the default into the description, but I'm not a fan of that either. |
Thanks for the changes @woehrl01 |
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.
LGTM
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.
This would be great enhancement. Thanks!
…#11096) Signed-off-by: Jeremy Hager <47301461+jeremyhager@users.noreply.github.com>
…#11096) Signed-off-by: Lukas Wöhrl <lukas.woehrl@plentymarkets.com>
This Pull Request introduces the functionality to specify a namespace for the semaphore configmap references, allowing for locking on shared resources across namespaces.
Motivation
Enhancing the semaphore configuration with a namespace property enables better resource management in environments with shared resources across multiple namespaces.
Modifications
Introduced a
namespace
property to the semaphore configuration. This property is designed to specify the namespace in which the semaphore configmap resides.Design choices:
ConfigMapKeyRef
in an attempt to avoid violating the official definition and to prevent potential misunderstandings. This design decision was made to keep the definition ofConfigMapKeyRef
as standard and clear as possible.Verification
Added a unit test