File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -4437,6 +4437,10 @@ def describe_desktop_byname( self, name:str )->dict:
4437
4437
"""
4438
4438
self .logger .debug ('' )
4439
4439
assert isinstance (name , str ), f"name has invalid type { type (str )} "
4440
+ # Looking at the source code for core_v1_api.py.
4441
+ # The method calls accept a kwarg named _preload_content.
4442
+ # Setting the argument _preload_content to False instructs the method to return the urllib3.HTTPResponse object instead of a processed str.
4443
+ # You can then work directly with the data, which cooperates with json.loads().
4440
4444
myPod = self .kubeapi .read_namespaced_pod (namespace = self .namespace , name = name , _preload_content = False )
4441
4445
if isinstance ( myPod , urllib3 .response .HTTPResponse ) :
4442
4446
myPod = json .loads ( myPod .data )
You can’t perform that action at this time.
0 commit comments