Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions examples/multiple_contexts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import openshift_client as oc

if __name__ == '__main__':
context1 = {
'context': 'cluster1',
}
context2 = {
'context': 'cluster2',
}
with oc.client_host():
with oc.timeout(60 * 5):
for context in [context1, context2]:
with oc.options(context):
with oc.project('my-project'):
jobs_list = oc.selector('pods').objects()
print(f'Found: {len(jobs_list)} pods in: {context["context"]}')