Untitled

mail@pastecode.io avatarunknown
python
a month ago
850 B
3
Indexable
Never
(venv) zp2849@PL-KRK-MAC0054 src % python3 main.py
{'routeTables': [{'labels': {'delegate': 'integration'}, 'workspace': 'shop-k8s-dev-product-checkout'}], 'sortMethod': 'TABLE_WEIGHT'}
{'routeTables': [{'labels': {'delegate': 'release'}, 'workspace': 'shop-k8s-dev-product-checkout'}], 'sortMethod': 'TABLE_WEIGHT'}
Traceback (most recent call last):
  File "/Users/zp2849/projects/shop-master-route-table-monitoring/src/main.py", line 35, in <module>
    main()
  File "/Users/zp2849/projects/shop-master-route-table-monitoring/src/main.py", line 28, in main
    route_table_statuses = k8s_reader.scrap_data()
  File "/Users/zp2849/projects/shop-master-route-table-monitoring/src/k8s_reader.py", line 44, in scrap_data
    print(route_table["spec"]["http"][0]['delegate']) #["delegate"]["routeTables"][0]["labels"]["delegate"])
KeyError: 'delegate'