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

Lagoon API lists bytesUsed when it is actually kiloBytesUsed #2245

Closed
seanhamlin opened this issue Oct 14, 2020 · 1 comment · Fixed by #3658
Closed

Lagoon API lists bytesUsed when it is actually kiloBytesUsed #2245

seanhamlin opened this issue Oct 14, 2020 · 1 comment · Fixed by #3658
Labels
8-automation-helpers Automation, Services & Helpers subsystem bug

Comments

@seanhamlin
Copy link
Contributor

seanhamlin commented Oct 14, 2020

Describe the bug

The storage calculator incorrectly (and confusingly) captures KB instead of Bytes. It looks like this was introduced in e59e3a0 but never reflected in the API.

To Reproduce

Install the latest version of du, on Mac, this is GNU gdu. The command used to count the storage space is listed in the code.

du -s /storage/${PVC} | cut -f1

Reading up on the -s switch

   -s, --summarize
        display only a total for each argument

Here is an example from my local laptop of a large directory of log files:

  1. Current command
$ gdu -s ~/largedir/ | cut -f1
109611500
  1. Forcing Bytes
$ gdu -b ~/largedir/ | cut -f1
111982025079
  1. Forcing KB
$ gdu -sk ~/largedir/ | cut -f1
109611500
  1. Human readable
$ gdu -h ~/largedir/ | cut -f1
105G

Expected behavior

One of 2 options:

  1. That the bytesUsed matches up to actual bytes used.
  2. The API is changed to kiloBytesUsed and the -k flag added for clarity

Either way, this is likely a breaking API change, and possibly better suited to Lagoon 2.0.

@seanhamlin seanhamlin added bug 8-automation-helpers Automation, Services & Helpers subsystem labels Oct 14, 2020
@seanhamlin seanhamlin changed the title Lagoon API lists bytesUsed when it is actually KBUsed Lagoon API lists bytesUsed when it is actually kiloBytesUsed Oct 14, 2020
@shreddedbacon
Copy link
Member

The storage calculator is being updated to include the kilobyte field, while retaining the old one for backwards compatability. The data in both fields remains the same though, just simply making it clear that the data is kilobytes not bytes. We will need to update the actions-handler to consume the new field if it is present, and announce a deprecation of the old one (minimum lagoon-remote chart version required to get the new field)

The API is a different story, we can expose the data in a new field that just displays the same data with kiloBytesUsed and deprecate bytesUsed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8-automation-helpers Automation, Services & Helpers subsystem bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants