This repository has been archived by the owner on Oct 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 172
[COPS-5211] Fix marathon constraint parser bug #3160
Merged
Merged
Conversation
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
takirala
commented
Aug 21, 2019
@@ -22,7 +24,8 @@ | |||
|
|||
private final String image; | |||
|
|||
private final WriteOnceLinkedHashMap<String, RawNetwork> networks; | |||
@JsonSetter(contentNulls = Nulls.AS_EMPTY) |
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.
@@ -2,7 +2,7 @@ name: "invalid-image-null-test" | |||
pods: | |||
server: | |||
count: 1 | |||
image: | |||
image: "" |
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.
I feel this is more accurate, meaning:
image: ""
is invalid, but
image:
is valid.
If we want to keep the old behaviour, we can use ""
as default value for image
in RawPod.java
but i like this better. I don't have a strong opinion though.
takirala
changed the title
Fix marathon constraint parser bug
[COPS-5211] Fix marathon constraint parser bug
Aug 21, 2019
kaiwalyajoshi
approved these changes
Aug 21, 2019
takirala
added a commit
that referenced
this pull request
Aug 21, 2019
* Upgrade jackson to 2.9 to use DeserializationFeature.FAIL_ON_TRAILING_TOKENS * Add/update unit tests
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
COPS-5211 With the current logic around parsing the placement constraint string, there may be a case where only the first few characters in the string are parsed in to json object.
For e.g.:
would be parsed as
with the trailing tokens being ignored. This PR upgrades the
jackson.core:jackson-databind
(along with other jackson libraries) to a newer version which has the provision to specify sth likeDeserializationFeature.FAIL_ON_TRAILING_TOKENS
in order to make sure the entire string is a valid json array before we try to parse it.