11[ ![ Build] ( https://github.com/jthomperoo/k8shorizmetrics/workflows/main/badge.svg )] ( https://github.com/jthomperoo/k8shorizmetrics/actions )
2- [ ![ go.dev] ( https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat )] ( https://pkg.go.dev/github.com/jthomperoo/k8shorizmetrics/v3 )
2+ [ ![ go.dev] ( https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat )] ( https://pkg.go.dev/github.com/jthomperoo/k8shorizmetrics/v4 )
33[ ![ Go Report
4- Card] ( https://goreportcard.com/badge/github.com/jthomperoo/k8shorizmetrics/v3 )] ( https://goreportcard.com/report/github.com/jthomperoo/k8shorizmetrics/v3 )
4+ Card] ( https://goreportcard.com/badge/github.com/jthomperoo/k8shorizmetrics/v4 )] ( https://goreportcard.com/report/github.com/jthomperoo/k8shorizmetrics/v4 )
55[ ![ License] ( https://img.shields.io/:license-apache-blue.svg )] ( https://www.apache.org/licenses/LICENSE-2.0.html )
66
77# k8shorizmetrics
@@ -13,7 +13,7 @@ to work out the target replica count that the HPA does.
1313## Install
1414
1515``` bash
16- go get -u github.com/jthomperoo/k8shorizmetrics/v3@v3 .0.0
16+ go get -u github.com/jthomperoo/k8shorizmetrics/v4@v4 .0.0
1717```
1818
1919## Features
@@ -89,7 +89,7 @@ func main() {
8989
9090## Documentation
9191
92- See the [ Go doc] ( https://pkg.go.dev/github.com/jthomperoo/k8shorizmetrics/v3 ) .
92+ See the [ Go doc] ( https://pkg.go.dev/github.com/jthomperoo/k8shorizmetrics/v4 ) .
9393
9494## Migration
9595
@@ -138,6 +138,17 @@ if err != nil {
138138
139139You can use similar code for the ` Evaluate ` method of the ` Evaluater ` .
140140
141+ ### From v3 to v4
142+
143+ To update to ` v4 ` you will need to update all references in your code that refer to
144+ ` github.com/jthomperoo/k8shorizmetrics/v3 ` to use ` github.com/jthomperoo/k8shorizmetrics/v4 ` .
145+
146+ The only behaviour change is around serialisation into JSON. Fields are now serialised using camel case rather
147+ than snake case to match the Kubernetes conventions.
148+
149+ If you are relying on JSON serialised values you need to use camel case now. For example the Resource Metric field
150+ ` PodMetricsInfo ` is now serialised as ` podMetricsInfo ` ratherthan ` pod_metrics_info ` .
151+
141152## Examples
142153
143154See the [ examples directory] ( ./examples/ ) for some examples, [ cpuprint] ( ./examples/cpuprint/ ) is a good start.
0 commit comments