[FLINK-40639][kubernetes] Deprecated kubernetes.pod-template-file takes precedence over kubernetes.pod-template-file.default - #29167
Open
SEPURI-SAI-KRISHNA wants to merge 1 commit into
Conversation
…es precedence over kubernetes.pod-template-file.default The legacy key was registered via withFallbackKeys(getDeprecatedKeys(...)), which rebuilds the keys as non-deprecated. That both dropped the deprecation flag and placed the legacy key ahead of kubernetes.pod-template-file.default, so the deprecated key won and no deprecation warning was ever logged. Generated-by: Claude Code (Claude Opus 5)
Collaborator
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
JOB_MANAGER_POD_TEMPLATEandTASK_MANAGER_POD_TEMPLATEregister the deprecatedkubernetes.pod-template-filethroughwithFallbackKeys(getDeprecatedKeys(defaultPodTemplate)).getDeprecatedKeysreturns keys whoseFallbackKey#isDeprecatedis true, butwithFallbackKeysrebuilds them withFallbackKey#createFallbackKey, dropping the flag. Two problems follow.The deprecated key wins over the current one.
withFallbackKeysprepends ("put fallback keys first so that they are prioritized") whilewithDeprecatedKeysappends ("put deprecated keys last so that they are de-prioritized"), so the legacy key is checked ahead ofkubernetes.pod-template-file.default. A user who moves to the new key but leaves the old one in their configuration silently keeps running the old pod template.No deprecation warning is logged.
Configuration#loggingFallbacklogs WARN only for deprecated keys and INFO otherwise. The only option still carrying the flag isKUBERNETES_POD_TEMPLATE, which no main source reads (KubernetesJobManagerParametersreadsJOB_MANAGER_POD_TEMPLATE,PodTemplateMountDecoratorreadsTASK_MANAGER_POD_TEMPLATE), so users of the legacy key have never seen a deprecation warning.Brief change log
withDeprecatedKeysinstead ofwithFallbackKeys, restoring both the precedence and the deprecation flagKubernetesConfigOptionsTestVerifying this change
This change added tests and can be verified as follows:
testPodTemplateDefaultKeyTakesPrecedenceOverDeprecatedKeyresolves to/deprecated.yamlbefore the change and/default.yamlaftertestPodTemplateLegacyKeyIsRegisteredAsDeprecatedis false before and true aftertestPodTemplateDeprecatedKeyIsStillHonoredOnItsOwnpasses either way and guards the legacy pathBoth failing cases were confirmed red against unmodified master before the fix. Existing Kubernetes suites stay green locally (199 tests across
*PodTemplate*,Kubernetes{JobManager,TaskManager}Parameters*,Kubernetes{JobManager,TaskManager}Factory*,*Decorator*). Generated config docs are unaffected: the options' key, type, default and description do not change, and the docs generator does not render fallback or deprecated keys.Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Claude Opus 5)