Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add usage units fallback for OCP on GCP storage endpoint #4975

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

esebesto
Copy link
Contributor

@esebesto esebesto commented Mar 14, 2024

Jira Ticket

COST-4392

Description

This PR attempts to fix missing usage units in OCP on GCP storage endpoint when we have no OCP on GCP storage data. The missing units are apparent in UI so it would be better to fix it.

Testing

  1. hit ocp on gcp storage endpoint without having any ocp on gcp storage data (make sure that the db schema is created, e.g., by creating ocp source):
    http://localhost:8000/api/cost-management/v1/reports/openshift/infrastructures/gcp/storage/
  2. check metadata - you will see that usage units are missing
"total": {
            "usage": {
                "value": 0,
                "units": 0
            }
  1. Checkout Branch
  2. hit ocp on gcp storage endpoint again - but this time add a limit to invalidate the cache:
    http://localhost:8000/api/cost-management/v1/reports/openshift/infrastructures/gcp/storage/?limit=102
  3. check metadata - you will see that usage units are now filled
"total": {
            "usage": {
                "value": 0,
                "units": "GB-Mo"
            }

Copy link

codecov bot commented Mar 14, 2024

Codecov Report

Merging #4975 (f754f06) into main (9a88d07) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #4975   +/-   ##
=====================================
  Coverage   94.1%   94.1%           
=====================================
  Files        375     375           
  Lines      31170   31170           
  Branches    3704    3704           
=====================================
  Hits       29327   29327           
  Misses      1176    1176           
  Partials     667     667           

@esebesto esebesto added the gcp-smoke-tests pr_check will build the image and run gcp + ocp on gcp smoke tests label Mar 15, 2024
@esebesto
Copy link
Contributor Author

/retest

Copy link
Contributor

@bacciotti bacciotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@esebesto
Copy link
Contributor Author

/retest

1 similar comment
@esebesto
Copy link
Contributor Author

/retest

@esebesto esebesto removed the gcp-smoke-tests pr_check will build the image and run gcp + ocp on gcp smoke tests label Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants