upbound / up

The @upbound CLI
Apache License 2.0
49 stars 42 forks source link

Inject new user agent into all kube rest configs #511

Closed RedbackThomson closed 1 month ago

RedbackThomson commented 1 month ago

Description of your changes

Example user agent: up-cli/v0.30.0-rc.0.15.g18bb4f5.dirty (darwin; arm64)

I have:

How has this code been tested

Running up ctx <path> makes multiple calls to spaces, and we can see the requests in the envoy logs:

{"downstreamLocalAddress":"10.88.4.252:8443","downstreamRemoteAddress":"10.138.0.37:0","protocol":"HTTP/1.1","startTime":"2024-05-09T23:03:29.593Z","upstreamHost":"10.96.29.179:8443","userAgent":"up-cli/v0.30.0-rc.0.15.g18bb4f5.dirty (darwin; arm64)","upstreamServiceTime":"14","path":"/api/v1","responseCode":200,"requestId":"","downstreamRequestTTLB":0,"bytesSent":192,"responseHeadersBytes":193,"authority":"upbound-gcp-us-west-1.space.mxe.upbound.services","responseFlags":"-","httpMethod":"GET","responseCodeDetails":"via_upstream","upstreamCluster":"mxe-api","upstreamDuration":16,"upstreamRequestTTLB":11,"downstreamResponseTTLB":0,"routeName":"mxe-api","responseTrailersBytes":0,"bytesReceived":0,"xForwardedFor":"10.138.0.37","clientDuration":16