We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents da70c5d + fe6aebb commit 38d3e36Copy full SHA for 38d3e36
examples/multiple_contexts.py
@@ -0,0 +1,16 @@
1
+import openshift_client as oc
2
+
3
+if __name__ == '__main__':
4
+ context1 = {
5
+ 'context': 'cluster1',
6
+ }
7
+ context2 = {
8
+ 'context': 'cluster2',
9
10
+ with oc.client_host():
11
+ with oc.timeout(60 * 5):
12
+ for context in [context1, context2]:
13
+ with oc.options(context):
14
+ with oc.project('my-project'):
15
+ jobs_list = oc.selector('pods').objects()
16
+ print(f'Found: {len(jobs_list)} pods in: {context["context"]}')
0 commit comments