akash-network / support

Akash Support and Issue Tracking
5 stars 4 forks source link

Case inconsistency inside lease-status #94

Open cloud-j-luna opened 1 year ago

cloud-j-luna commented 1 year ago

As per the documentation (haven't verified yet through the CLI) the response from the lease-status command has an inconsistency in the casing as shown in the example:

{
  "services": {
    "web": {
      "name": "web",
      "available": 1,
      "total": 1,
      "uris": [
        "bnd9dtb1rddsl6gfcn3q0j771g.www.nocixp1.iptestnet.akashian.io"
      ],
      "observed_generation": 1,
      "replicas": 1,
      "updated_replicas": 1,
      "ready_replicas": 1,
      "available_replicas": 1
    }
  },
  "forwarded_ports": null,
  "ips": {
    "web": [
      {
        "Port": 3000,
        "ExternalPort": 80,
        "Protocol": "TCP",
        "IP": "198.204.231.229"
      }
    ]
  }
}

As seen the ips object follows a PascalCase notation, different to the snake_cased used across all the other responses. It's important to keep the consistency for systems that integrate with the provider-services. If it makes sense some form of guidelines could be developed for future contributions to make sure a standard is followed that will allow integrations to be developed with less friction points such as these. 😄

Update: Based on this file there seems to be the "correct" json tags, although it is not reflected in the documentation:

type ProviderLeasedIPSpec struct {
    LeaseID      LeaseID `json:"lease_id"`
    ServiceName  string  `json:"service_name"`
    Port         uint32  `json:"port"`
    ExternalPort uint32  `json:"external_port"`
    SharingKey   string  `json:"sharing_key"`
    Protocol     string  `json:"protocol"`
}

I'm not sure whether this is the struct that is serialized by the CLI.

Update 2:

This seems to be the serialized structs but there is the IPs struct missing which confuses me https://github.com/ovrclk/provider-services/blob/main/cluster/types/v1beta2/types.go

cloud-j-luna commented 1 year ago

Addressed in PR akash-network/provider#57