Skip to content

Yaml output loosing UsedValues or MaxValues when they are 0 #196

Description

@rkutin

Bug Summary

Yaml output in some OKS calls loosing UsedValues or MaxValues when they are 0

Steps to Reproduce

  1. Open terminal
  2. Run: octl oks project list
  3. Grab project ID
  4. Run: octl oks project quotas 3db8f214-xxxx-4b56-a1e7-1b18927c7285 -o json | head -15
  5. Run: octl oks project quotas 3db8f214-xxxx-4b56-a1e7-1b18927c7285 -o yaml | head -15
  6. Run: octl iaas quota list -o yaml | head -15
  7. UsedValues must be same in all outputs (or at least in both yaml outputs)

Expected Behavior

Same yaml output for OKS calls as on IaaS.

Actual Behavior

On OKS call:

~ $ octl --profile oks-snc oks project quotas 3db8f214-xxxx-4b56-a1e7-1b18927c7285 -o json | head -15
Resolving alias to [octl kube api GetProjectQuotas 3db8f214-xxxx-4b56-a1e7-1b18927c7285 --output=json --profile=oks-snc]
{
  "data": {
    "quotas": [
      {
        "AccountId": "123456789123",
        "Description": "Maximum number of VM this user can own",
        "MaxValue": 150,
        "Name": "vm_limit",
        "QuotaCollection": "Compute",
        "ShortDescription": "VM Limit",
        "UsedValue": 0
      },
      {
        "AccountId": "123456789123",
        "Description": "Maximum number of total cores (virtual core)",
~ $ octl --profile oks-snc oks project quotas 3db8f214-xxxx-4b56-a1e7-1b18927c7285 -o yaml | head -15
Resolving alias to [octl kube api GetProjectQuotas 3db8f214-xxxx-4b56-a1e7-1b18927c7285 --output=yaml --profile=oks-snc]
data:
  quotas:
  - AccountId: 123456789123
    Description: Maximum number of VM this user can own
    MaxValue: 150
    Name: vm_limit
    QuotaCollection: Compute
    ShortDescription: VM Limit
  - AccountId: 123456789123
    Description: Maximum number of total cores (virtual core)
    MaxValue: 200
    Name: core_limit
    QuotaCollection: Compute
    ShortDescription: Core Limit
  - AccountId: 123456789123

Weird when MaxValue is 0:

  - AccountId: 123456789123
    Description: Maximum number of GPU the user can allocate
    Name: gpu_limit
    QuotaCollection: Compute
    ShortDescription: GPU Limit
  - AccountId: 123456789123

In same time on IaaS call we can see UsedValue: 0 ..:

$ octl --profile oks-snc iaas quota list -o yaml | head -15
Resolving alias to [octl iaas api ReadQuotas --output=yaml --profile=oks-snc]
- QuotaType: global
  Quotas:
  - AccountId: '123456789124'
    Description: Maximum number of VM this user can own
    MaxValue: 0
    Name: vm_limit
    QuotaCollection: Compute
    ShortDescription: VM Limit
    UsedValue: 0
  - AccountId: '123456789124'
    Description: Maximum number of total cores (virtual core)
    MaxValue: 0
    Name: core_limit
    QuotaCollection: Compute
    ShortDescription: Core Limit 

Project Version

octl version v0.0.22

Environment Info

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions