signadot / community

Issue tracker for Signadot
2 stars 1 forks source link

[bug] Sandbox response does not expose `updatedAt` property and CLI does not show the correct TTL for `offsetFrom: updatedAt` #33

Closed gamino-brex closed 1 year ago

gamino-brex commented 1 year ago

Describe the bug In a recent release:

Sandboxes now support new TTL with respect to updatedAt.

The feature works as expected, but there is currently no way to get the correct sandbox TTL/expiration time or even calculate it, because the API and CLI only expose the createdAt attribute of a sandbox, but not the updatedAt timestamp attribute.

The Dashboard UI, API, and CLI signadot sandbox list/signadot sandbox get show erroneous TTL information not respecting the offsetFrom if it's set to updatedAt.

To Reproduce Environment:

  1. Create a sandbox with TTL duration: <any> and offsetFrom: updatedAt;
  2. Update the sandbox (e.g., adding a new fork, changing the image);
  3. Use signadot sandbox get SANDBOX_NAME and check the TTL info is being calculated from createdAt;

Expected behavior

Observed behavior

This sandbox was created with a 1d TTL and should be marked for deletion in 10 hours, but it shows ~1hr

Additional context Code path for CLI: https://github.com/signadot/cli/blob/1f243c1a7aacf8cf57f4f70b0fba60888819e14f/internal/command/sandbox/printers.go#L83C43-L116