redhat-cop / openshift-toolkit

A collection of code samples to help you get started with OpenShift
Apache License 2.0
234 stars 150 forks source link

Capacity decoupling #88

Closed etsauer closed 5 years ago

etsauer commented 5 years ago

This is a refactoring and enhancement to the capacity management script. It now has several components:

View instructions in capacity-management/README.md for testing.

sabre1041 commented 5 years ago

@etsauer hitting the following error on OCP4 and OCP3 environments

new namespace quota
{'cluster': {'quota': {'cpu': '', 'memory': ''}}, 'namespaces': {'esauer-sbx': {'quota': {'cpu': 4, 'memory': 17179869184}}}}
existing namespace quota
{'cluster': {'quota': {'cpu': '', 'memory': ''}}, 'namespaces': {'esauer-sbx': {'quota': {'cpu': 2, 'memory': 12884901888}}}}
Traceback (most recent call last):
  File "./cli.py", line 79, in <module>
    do_print(capacity)
  File "./cli.py", line 8, in do_print
    cluster_memory = capacity["cluster"]["totals"]["memory"]
KeyError: 'totals'
etsauer commented 5 years ago

@sabre1041 fixed.

sabre1041 commented 5 years ago

@etsauer looks good. One additional change is to add the application/json Content-Type for the hosted solution. We should be good to merge at that point

sabre1041 commented 5 years ago

LGTM