This repository has been archived by the owner on Mar 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 185
Support false values in configuration file #161
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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.
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.
s/False/"false" in consistent with the test case below
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.
@roycaihw Thanks for the suggestion! I've just tried to replace
False
with"false"
and faced an issue - the unit test fails. I think the cause is in how "insecure-skip-tls-verify" property is handled inkube_config.py
(https://github.com/kubernetes-client/python-base/blob/master/config/kube_config.py#L443). The code by the link casts a string to a boolean. Both"true"
and"false"
are casted toTrue
. What do you think if I replace"true"
withTrue
in the older test?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.
"true"
and"false"
are the original values in kubeconfig yaml files (e.g.insecure-skip-tls-verify: false
). The test cases are testing values stored in theKubeConfigLoader
object.Could you verify what's the behavior in the yaml loader? Does it load
"false"
into a booleanFalse
, or does it keep the string value"false"
?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 verified the behavior on the configuration file which has the following lines:
The following code snippet was used for the verification:
Debug showed the following value for the property:
'insecure-skip-tls-verify' (4523129968) = {bool} False
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.
Thanks. Let's use
True
andFalse
in the test cases then