8000 Update example for remote cluster without override of default client · abhinavcoder/python@8b2b3cd · GitHub
[go: up one dir, main page]

Skip to content

Commit 8b2b3cd

Browse files
committed
Update example for remote cluster without override of default client
1 parent a3f6195 commit 8b2b3cd

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

examples/remote_cluster.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,27 @@ def main():
2626
aToken = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
2727

2828
# Create a configuration object
29-
configuration = client.Configuration()
29+
aConfiguration = client.Configuration()
3030

3131
# Specify the endpoint of your Kube cluster
32-
configuration.host = "https://XXX.XXX.XXX.XXX:443"
32+
aConfiguration.host = "https://XXX.XXX.XXX.XXX:443"
3333

3434
# Security part.
3535
# In this simple example we are not going to verify the SSL certificate of
3636
# the remote cluster (for simplicity reason)
37-
configuration.verify_ssl = False
37+
aConfiguration.verify_ssl = False
3838
# Nevertheless if you want to do it you can with these 2 parameters
3939
# configuration.verify_ssl=True
4040
# ssl_ca_cert is the filepath to the file that contains the certificate.
4141
# configuration.ssl_ca_cert="certificate"
4242

43-
configuration.api_key = {"authorization": "Bearer " + aToken}
43+
aConfiguration.api_key = {"authorization": "Bearer " + aToken}
4444

45-
# Use our configuration
46-
client.Configuration.set_default(configuration)
< 66D5 code>45+
# Create a ApiClient with our config
46+
aApiClient = client.ApiClient(aConfiguration)
4747

4848
# Do calls
49-
v1 = client.CoreV1Api()
49+
v1 = client.CoreV1Api(aApiClient)
5050
print("Listing pods with their IPs:")
5151
ret = v1.list_pod_for_all_namespaces(watch=False)
5252
for i in ret.items:

0 commit comments

Comments
 (0)
0