Skip to content

Commit

Permalink
Merge pull request #14493 from barrettj12/kr-pretty-replace
Browse files Browse the repository at this point in the history
#14493

This pulls through a fix for issue kr/pretty#77 which was causing some of our logs to format like this:
```
[LOG] 0:00.001 DEBUG juju.kubernetes.provider.application creating storage class for gitlab filesystem database: &v1.StorageClass{
%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference)
[LOG] 0:00.001 DEBUG juju.kubernetes.provider.application using persistent volume claim for gitlab filesystem database: v1.PersistentVolumeClaim{
%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference)
```

We've pushed the patch upstream, but [kr/pretty](https://github.com/kr/pretty) doesn't look actively maintained anymore. Until they accept our patch, we will use our fork at [canonical/pretty](https://github.com/canonical/pretty) instead.

## QA steps

```sh
go test -v ./caas/kubernetes/provider/application -check.f applicationSuite.TestEnsureStateful -check.vv
```
Verify that the structs are printed correctly in the logs.
  • Loading branch information
jujubot committed Aug 22, 2022
2 parents 9b01338 + 92ea061 commit 6eedc6f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -255,3 +255,5 @@ replace gopkg.in/yaml.v2 => github.com/juju/yaml/v2 v2.0.0
replace github.com/dustin/go-humanize v1.0.0 => github.com/dustin/go-humanize v0.0.0-20141228071148-145fabdb1ab7

replace github.com/hashicorp/raft-boltdb => github.com/juju/raft-boltdb v0.0.0-20200518034108-40b112c917c5

replace github.com/kr/pretty => github.com/canonical/pretty v0.3.1-0.20220821212646-771f4dc6714f
9 changes: 3 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ github.com/bmizerany/pat v0.0.0-20160217103242-c068ca2f0aac h1:X5YRFJiteUM3rajAB
github.com/bmizerany/pat v0.0.0-20160217103242-c068ca2f0aac/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c=
github.com/canonical/pebble v0.0.0-20220729021256-d9b6b8c3b562 h1:6AaAlZ1RTap/3tM875FDAPWdQUtvNrh3OV5XksgRhgo=
github.com/canonical/pebble v0.0.0-20220729021256-d9b6b8c3b562/go.mod h1:qAIw8HY2rZZZ7QOhG9wD/4rtXvPJfvaOg+uWbhSABpc=
github.com/canonical/pretty v0.3.1-0.20220821212646-771f4dc6714f h1:Fm69JbIBVe7mbpAhQPSCGcFO3enqhX8+mdRsCcGnc8g=
github.com/canonical/pretty v0.3.1-0.20220821212646-771f4dc6714f/go.mod h1:tMVdMxJgEKAzwkfAW0q3SaFOCR2tWN+TwNnOvolaR+Q=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY=
Expand Down Expand Up @@ -657,11 +659,6 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv
github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8=
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
Expand Down Expand Up @@ -830,7 +827,7 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So
github.com/rogpeppe/fastuuid v1.2.0 h1:Ppwyp6VYCF1nvBTXL3trRso7mXMlRrw9ooo375wvi2s=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg=
github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
Expand Down

0 comments on commit 6eedc6f

Please sign in to comment.