Skip to content

Commit

Permalink
chore: update sonobuoy
Browse files Browse the repository at this point in the history
See vmware-tanzu/sonobuoy#1520.

Closes #4516.

Signed-off-by: Alexey Palazhchenko <alexey.palazhchenko@talos-systems.com>
  • Loading branch information
AlekSi committed Nov 11, 2021
1 parent efbae78 commit d6147eb
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 5 deletions.
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ require (
github.com/talos-systems/talos/pkg/machinery v0.0.0-00010101000000-000000000000
github.com/u-root/u-root v7.0.0+incompatible
github.com/vishvananda/netlink v1.1.1-0.20210330154013-f5de75959ad5
github.com/vmware-tanzu/sonobuoy v0.54.0
github.com/vmware-tanzu/sonobuoy v0.55.0
github.com/vmware/govmomi v0.27.1
github.com/vmware/vmw-guestinfo v0.0.0-20211006225857-cc1fd90d572c
github.com/vultr/metadata v1.0.3
Expand Down Expand Up @@ -144,7 +144,6 @@ require (
github.com/bits-and-blooms/bitset v1.2.0 // indirect
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/briandowns/spinner v1.6.1 // indirect
github.com/c2h5oh/datasize v0.0.0-20171227191756-4eba002a5eae // indirect
github.com/cenkalti/backoff/v4 v4.1.1 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5 // indirect
Expand Down
5 changes: 2 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx2
github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8=
github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50=
github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE=
github.com/c2h5oh/datasize v0.0.0-20171227191756-4eba002a5eae h1:2Zmk+8cNvAGuY8AyvZuWpUdpQUAXwfom4ReVMe/CTIo=
github.com/c2h5oh/datasize v0.0.0-20171227191756-4eba002a5eae/go.mod h1:S/7n9copUssQ56c7aAgHqftWO4LTf4xY6CGWt8Bc+3M=
github.com/cenkalti/backoff/v4 v4.1.1 h1:G2HAfAmvm/GcKan2oOQpBXOd2tT2G57ZnZGWa1PxPBQ=
github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw=
Expand Down Expand Up @@ -1112,8 +1111,8 @@ github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17
github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0=
github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f h1:p4VB7kIXpOQvVn1ZaTIVp+3vuYAXFe3OJEvjbUYJLaA=
github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0=
github.com/vmware-tanzu/sonobuoy v0.54.0 h1:UcEZgVtvnAKkSGTofWs6m3qLIZJr9ISwVKd+nP1PRz0=
github.com/vmware-tanzu/sonobuoy v0.54.0/go.mod h1:VN3+v6dc8g3rU25U+xgi28JATPSWQmNTfVRhg+Y2RBQ=
github.com/vmware-tanzu/sonobuoy v0.55.0 h1:EhSXf0jeEQHraX536ZqzJbqTBMWv3AKNX1aSto84pSE=
github.com/vmware-tanzu/sonobuoy v0.55.0/go.mod h1:VN3+v6dc8g3rU25U+xgi28JATPSWQmNTfVRhg+Y2RBQ=
github.com/vmware/govmomi v0.27.1 h1:Rf3o1btFrkJa9be5KtgJ4CyOO8mbFnBxmNtAVHNyFes=
github.com/vmware/govmomi v0.27.1/go.mod h1:daTuJEcQosNMXYJOeku0qdBJP9SOLLWB3Mqz8THtv6o=
github.com/vmware/vmw-guestinfo v0.0.0-20170707015358-25eff159a728/go.mod h1:x9oS4Wk2s2u4tS29nEaDLdzvuHdB19CvSGJjPgkZJNk=
Expand Down
34 changes: 34 additions & 0 deletions pkg/cluster/sonobuoy/sonobuoy.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ import (
"io/ioutil"
"os"
"path/filepath"
"runtime/debug"
"strings"
"time"

"github.com/coreos/go-semver/semver"
"github.com/vmware-tanzu/sonobuoy/cmd/sonobuoy/app"
"github.com/vmware-tanzu/sonobuoy/pkg/buildinfo"
"github.com/vmware-tanzu/sonobuoy/pkg/client"
"github.com/vmware-tanzu/sonobuoy/pkg/config"
sonodynamic "github.com/vmware-tanzu/sonobuoy/pkg/dynamic"
Expand Down Expand Up @@ -125,6 +127,11 @@ func CertifiedConformance(ctx context.Context, cluster cluster.K8sProvider) erro
//
//nolint:gocyclo,cyclop
func Run(ctx context.Context, cluster cluster.K8sProvider, options *Options) error {
// see init() function
if buildinfo.Version == "" {
return fmt.Errorf("failed to read sonobuoy version")
}

var waitOutput string

if options.UseSpinner {
Expand Down Expand Up @@ -340,3 +347,30 @@ func Run(ctx context.Context, cluster cluster.K8sProvider, options *Options) err

return cleanup()
}

// Workaround for https://github.com/vmware-tanzu/sonobuoy/issues/1520.
// Remove when this is fixed by upstream.
func init() {
buildinfo.Version = ""
config.DefaultImage = ""

buildInfo, ok := debug.ReadBuildInfo()
if !ok {
return
}

for _, dep := range buildInfo.Deps {
if dep.Path != "github.com/vmware-tanzu/sonobuoy" {
continue
}

if dep.Replace != nil {
panic("sonobuoy version replacement is not supported")
}

buildinfo.Version = dep.Version
config.DefaultImage = "sonobuoy/sonobuoy:" + dep.Version

return
}
}

0 comments on commit d6147eb

Please sign in to comment.