diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..b69d0c9 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog + +## 0.9.2: Fixed JSON and YAML marshalling + +In the previous version the JSON and YAML configuration marshalling / unmarshalling created an unnecessary sub-map, which was incompatible to ContainerSSH 0.3. This release fixes that and restores compatibility. + +## 0.9.1: Updating GeoIP to 0.9.3 + +This release updates the [GeoIP dependency](https://github.com/containerssh/geoip) to version 0.9.3 for a cleaner API. + +## 0.9.0: Initial release + +This is the initial port from ContainerSSH 0.3 \ No newline at end of file diff --git a/go.mod b/go.mod index 1e47269..492c2df 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.14 require ( github.com/containerssh/geoip v0.9.3 github.com/containerssh/http v0.9.1 - github.com/containerssh/log v0.9.2 + github.com/containerssh/log v0.9.5 github.com/containerssh/service v0.9.0 github.com/stretchr/testify v1.6.1 ) diff --git a/go.sum b/go.sum index d4233ee..3bd27e7 100644 --- a/go.sum +++ b/go.sum @@ -4,6 +4,8 @@ github.com/containerssh/http v0.9.1 h1:n7fNwRoZR+HsuAinuIdDbSl28O/d9O7raoUUYyeQk github.com/containerssh/http v0.9.1/go.mod h1:rKeRa8glbNsA08etU2HkRAsQ5Wn9J6Ht8Ly/aSNXC/I= github.com/containerssh/log v0.9.2 h1:QngZdg3EFvFxthpJY4X2qgVwqSHFTzHJ2kCiQkR7FLQ= github.com/containerssh/log v0.9.2/go.mod h1:05pgNm7IgFKt+qbZiUhtuJw2B4j3ynn2vSv5j2JA7hA= +github.com/containerssh/log v0.9.5 h1:uXBtOr0ao/0plopnIz0trAH7VmIYQUDhKwoZsZ20ufM= +github.com/containerssh/log v0.9.5/go.mod h1:P/tea/If6kzzfqlZdmqNp5SOpD6CD/OvmvcOK+vbweI= github.com/containerssh/service v0.9.0 h1:JUHqiK12tclq7EWQYGRTfgKKw6fhHs0gxlKWTvVwFlQ= github.com/containerssh/service v0.9.0/go.mod h1:otAKYF1MWy2eB0K7Sk7YQIECQMTHR3yikbyS1UstGpY= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= diff --git a/server_config.go b/server_config.go index 7fea02e..b051278 100644 --- a/server_config.go +++ b/server_config.go @@ -5,7 +5,7 @@ import ( ) type Config struct { - http.ServerConfiguration + http.ServerConfiguration `json:",inline" yaml:",inline"` Enable bool `yaml:"enable" json:"enable" comment:"Enable metrics server." default:"false"` Path string `yaml:"path" json:"path" comment:"Path to run the Metrics endpoint on." default:"/metrics"` diff --git a/server_test.go b/server_test.go index 6d9b833..4312ad1 100644 --- a/server_test.go +++ b/server_test.go @@ -5,11 +5,12 @@ import ( "io/ioutil" "net" goHttp "net/http" + "os" "strings" "testing" "github.com/containerssh/http" - "github.com/containerssh/log/standard" + "github.com/containerssh/log" "github.com/containerssh/service" "github.com/stretchr/testify/assert" @@ -18,7 +19,11 @@ import ( func TestFetchMetrics(t *testing.T) { geoip := &geoIpLookupProvider{} - logger := standard.New() + logger, err := log.New(log.Config{ + Level: log.LevelDebug, + Format: "text", + }, "metrics", os.Stdout) + assert.NoError(t, err) m := metrics.New(geoip) counter, err := m.CreateCounter("test", "pc", "Test metric") assert.Nil(t, err)