Uh oh!
There was an error while loading. Please reload this page.
utils and utils.create_from_yaml improvements - #783
Conversation
k8s-ci-robot
commented
Mar 18, 2019
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: oz123 If they are not already assigned, you can assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| performe an action from a valid parsed yaml object (as dict). | ||
| :param k8s_client: an ApiClient objcet initialized with the client args | ||
| :yml_object dict: a parsed yaml object |
There was a problem hiding this comment.
I don't think one needs to explicitly reference yaml here as what the function wants is a kubernetes manifest in python dictionary form
though it probably also does not harm as yaml is the most common representation form of that data.
There was a problem hiding this comment.
this is why I added create_from_map
roycaihw
commented
Mar 19, 2019
/cc @micw523 |
Uh oh!
There was an error while loading. Please reload this page.
micw523
commented
Mar 19, 2019
I think I'm still holding my original position in #722: we don't need many function names. We should be able to do everything in Also, we're pushing to merge 673, so it's likely that you'll need a rebase soon... |
92ed9d4 to
c257a38CompareThere was a problem hiding this comment.
I think I'm still holding my original position in #722: we don't need many function names. We should be able to do everything in
create_from_yaml(potentially with an extra input parameter), since the wordyamlisn't specific to a file anyway. If absolutely needed we can make an alias oncreate_from_yaml.Also, we're pushing to merge 673, so it's likely that you'll need a rebase soon...
I agree with you about creating an alias. IMHO it's better to be explicit . Since "yaml" isn't necessary a file it's better to specify when expect a file\stream and specify when we don't.
Concerning backwards compatibility, I now suggest the following, check if yaml_path is a file on the filesystem, if it is, proceed as in the past. If it is a string, try and parse it to yaml object.
| autopep8 | ||
| isort No newline at end of file | ||
| isort | ||
| adal |
There was a problem hiding this comment.
I checked again:
$ grep -nr adal kubernetes | grep -v \.pyc
kubernetes/base/config/kube_config.py:24:import adal
kubernetes/base/config/kube_config.py:223: context = adal.AuthenticationContext(
jwt is a dependency of adal, and I'm not sure adal is specifically required here.
I removed jwt. How do you want me to proceed with adal?
36de28b to
ce11548Comparemicw523
commented
Mar 19, 2019
Which branch did you fork it from? If you forked it from the current master I’ll need to do some investigation. Adal as a requirement got moved to optional in a previous PR so that might be the problem. |
oz123
commented
Mar 19, 2019
I forked from the master on a fresh clone I did yesterday. |
micw523
commented
Mar 20, 2019
I just had a fresh fork from the master branch. adal is not required for testing. Is it breaking anything that you submitted? |
micw523
commented
Mar 20, 2019
I checked your past Travis builds. It doesn't seem like adal is affecting you. Please remove the added packages. |
micw523
commented
Mar 20, 2019
/assign |
This keeps the function backwords compatible. Changed the parameter yaml to yml in order not to mask the imported module.
oz123
commented
Mar 20, 2019
done. I completely removed that commit. |
oz123
commented
Mar 20, 2019
@micw523 the new master branch includes |
micw523
commented
Mar 20, 2019
I’m not sure. The Do you still want to work on this, or you’re going to leave it in my hands? |
oz123
commented
Mar 20, 2019
@micw523 I would prefer starting on a clean branch and a clean PR. This has become too opaque for me. Do you mind if I submit a new PR? |
micw523
commented
Mar 20, 2019
That’s cool, go for it :) |
As discussed in #722.
Seems this had quite some positive feedback.