fix mpb compilation error; stick to yaml.v2
Signed-off-by: Rui Yang <ruiya@vmware.com>
This commit is contained in:
parent
091b31d875
commit
57e50564b6
|
@ -18,6 +18,11 @@
|
|||
{
|
||||
"matchPackageNames": ["k8s.io/client-go"],
|
||||
"allowedVersions": "!/1\\.(4\\.0|5\\.0|5\\.1|5\\.2)$/"
|
||||
},
|
||||
{
|
||||
"matchPackageNames": ["gopkg.in/yaml.v2"],
|
||||
"allowedVersions": "<3.0.0",
|
||||
"_context": "v3 will cause indent problem when marshalling, which requires test updates and we dont know the full impact. See https://github.com/go-yaml/yaml/issues/661."
|
||||
}
|
||||
],
|
||||
"ignoreDeps": ["elm", "client-go"],
|
||||
|
|
|
@ -72,7 +72,7 @@ import (
|
|||
"golang.org/x/crypto/acme/autocert"
|
||||
"golang.org/x/oauth2"
|
||||
"golang.org/x/time/rate"
|
||||
"gopkg.in/yaml.v3"
|
||||
"gopkg.in/yaml.v2"
|
||||
|
||||
// dynamically registered metric emitters
|
||||
_ "github.com/concourse/concourse/atc/metric/emitter"
|
||||
|
|
|
@ -22,9 +22,9 @@ func New() *Progress {
|
|||
}
|
||||
|
||||
func (prog *Progress) Go(name string, f func(*mpb.Bar) error) {
|
||||
bar := prog.progress.AddSpinner(
|
||||
bar := prog.progress.New(
|
||||
0,
|
||||
mpb.SpinnerOnLeft,
|
||||
mpb.SpinnerStyle().PositionLeft(),
|
||||
mpb.PrependDecorators(
|
||||
decor.Name(
|
||||
name,
|
||||
|
@ -33,11 +33,11 @@ func (prog *Progress) Go(name string, f func(*mpb.Bar) error) {
|
|||
),
|
||||
mpb.AppendDecorators(
|
||||
decor.OnComplete(
|
||||
decor.AverageSpeed(decor.UnitKiB, "(%.1f)"),
|
||||
decor.AverageSpeed(decor.SizeB1024(0), "(%.1f)"),
|
||||
" "+ui.Embolden("done"),
|
||||
),
|
||||
),
|
||||
mpb.BarClearOnComplete(),
|
||||
mpb.BarFillerClearOnComplete(),
|
||||
)
|
||||
|
||||
prog.errs.Go(func() error {
|
||||
|
|
4
go.mod
4
go.mod
|
@ -90,7 +90,7 @@ require (
|
|||
golang.org/x/sys v0.13.0
|
||||
golang.org/x/time v0.3.0
|
||||
google.golang.org/grpc v1.58.3
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
gopkg.in/yaml.v2 v2.4.0
|
||||
k8s.io/api v0.28.2
|
||||
k8s.io/apimachinery v0.28.2
|
||||
k8s.io/client-go v0.28.2
|
||||
|
@ -237,5 +237,5 @@ require (
|
|||
google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d // indirect
|
||||
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
yaml "gopkg.in/yaml.v3"
|
||||
yaml "gopkg.in/yaml.v2"
|
||||
|
||||
"os/signal"
|
||||
"syscall"
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
"strings"
|
||||
|
||||
"github.com/hashicorp/go-multierror"
|
||||
"gopkg.in/yaml.v3"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
type Template struct {
|
||||
|
@ -72,17 +72,6 @@ var (
|
|||
|
||||
func (i interpolator) Interpolate(node interface{}, tracker varsTracker) (interface{}, error) {
|
||||
switch typedNode := node.(type) {
|
||||
case map[string]interface{}:
|
||||
for k, v := range typedNode {
|
||||
evaluatedValue, err := i.Interpolate(v, tracker)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
delete(typedNode, k) // delete in case key has changed
|
||||
typedNode[k] = evaluatedValue
|
||||
}
|
||||
|
||||
case map[interface{}]interface{}:
|
||||
for k, v := range typedNode {
|
||||
evaluatedValue, err := i.Interpolate(v, tracker)
|
||||
|
|
Loading…
Reference in New Issue