forked from apache/pulsar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- make sure when 'jobName' used for custom runtime options that there…
… are no collisions with pod name. to do this make sure tenant, namespace, and function name are used with 'jobName' to create unique reproduceable job name (apache#8508) Fixes apache#8507 ### Motivation As part of the closed issue: apache#8012 a customRuntimeOption of "jobName" was added in order to allow an override of the pod name for the function in the Kubernetes runtime. While it covers most issues one was discovered where a jobName could be re-used for a different function and it would cause collisions with the pod and potentially statefulset. In order to alleviate this make sure that a short hash is added to the pod name to avoid collisions like is done when job names are converted when illegal characters are added. ### Modifications - Make sure when 'jobName' used for custom runtime options that there are no collisions with pod name. To do this make sure tenant, namespace, and function name are used with 'jobName' to create unique reproducible job name (KubernetesRuntime.java) - Updated unit tests (KubernetesRuntimeTest.java) to make sure pod name will be unique when given various scenarios ### Verifying this change This change added tests and can be verified as follows: Updated KubernetesRuntimeTest.java - Added test to check various scenarios when 'jobName' used in custom runtime options 1. custom job name contains unique hash for pod name 2. when custom job name already exists but function tenant & namespace are different make sure no collisions with different hash 3. when custom job name already exists but function name is different make sure no collisions with different hash - Added test to check correct exception thrown if custom 'jobName' option exceeds max character limit
- Loading branch information
Showing
2 changed files
with
60 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters