Repository navigation
Conversation
…config (apache#14810) ### Description 1. `CloudInitUserDataProvider` typed multipart parts by their `#` header only, so a `## template: jinja` part (e.g. the CKS `k8s-control-node.yml`) was sent as `text/cloud-config`. cloud-init only renders jinja for `text/jinja2` parts, so it parsed the raw template as YAML and dropped the whole control-node user data, leaving CKS clusters stuck in Starting. Parts whose first line is `## template: jinja` are now typed `text/jinja2`. Added a unit test covering this. 2. `registerCniConfiguration` with no `cniconfig` saved a null CNI config that later NPE'd in `KubernetesClusterStartWorker`; it now rejects blank `cniconfig` with `InvalidParameterValueException`. ### Types of changes - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] New feature (non-breaking change which adds functionality) - [x] Bug fix (non-breaking change which fixes an issue) - [ ] Enhancement (improves an existing feature and functionality) - [ ] Cleanup (Code refactoring and cleanup, that may add test cases) - [ ] Build/CI - [ ] Test (unit or integration test code) ### Bug Severity - [ ] BLOCKER - [x] Critical - [ ] Major - [ ] Minor - [ ] Trivial ### How Has This Been Tested? Added `testAppendJinjaCloudConfigWithShellScriptTypesJinjaPart` to `CloudInitUserDataProviderTest` asserting the jinja-headed part is emitted as `text/jinja2`. Existing tests use non-jinja fixtures for content-type assertions and are unaffected. Unit tests run in PR CI (no JDK in the working environment). Closes apache#14810 Co-authored-by: ravening <ravening@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #14945 +/- ##
======================================
Coverage 3.86% 3.86%
======================================
Files 494 494
Lines 42890 42890
Branches 8142 8142
======================================
Hits 1657 1657
Misses 41001 41001
Partials 232 232
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
(#14810)
Description
CloudInitUserDataProvidertyped multipart parts by their#header only, so a## template: jinjapart (e.g. the CKSk8s-control-node.yml) was sent astext/cloud-config. cloud-init only renders jinja fortext/jinja2parts, so it parsed the raw template as YAML and dropped the whole control-node user data, leaving CKS clusters stuck in Starting. Parts whose first line is## template: jinjaare now typedtext/jinja2. Added a unit test covering this.registerCniConfigurationwith nocniconfigsaved a null CNI config that later NPE'd inKubernetesClusterStartWorker; it now rejects blankcniconfigwithInvalidParameterValueException.Types of changes
Bug Severity
How Has This Been Tested?
Added
testAppendJinjaCloudConfigWithShellScriptTypesJinjaParttoCloudInitUserDataProviderTestasserting the jinja-headed part is emitted astext/jinja2. Existing tests use non-jinja fixtures for content-type assertions and are unaffected. Unit tests run in PR CI (no JDK in the working environment).Closes #14810