From a9c343e954f65835ca3cec8886071488058fb73b Mon Sep 17 00:00:00 2001 From: "francois.samin" Date: Thu, 14 Mar 2024 13:42:40 +0000 Subject: [PATCH] chore: upgrade yaml lib to sigs.k8s.io/yaml Signed-off-by: francois.samin --- LICENSES/LICENSES.txt | 1 - LICENSES/go/github.com/ghodss/yaml/LICENSE | 15 --------------- api/bind.go | 2 +- api/yamlrender.go | 2 +- engine/engine.go | 2 +- engine/engine_test.go | 2 +- engine/functions/functions.go | 2 +- engine/step/executor/executor.go | 2 +- engine/values/values_test.go | 2 +- models/tasktemplate/fromdir.go | 2 +- models/tasktemplate/fromdir_test.go | 2 +- pkg/plugins/builtin/echo/echo.go | 2 +- 12 files changed, 10 insertions(+), 26 deletions(-) delete mode 100644 LICENSES/go/github.com/ghodss/yaml/LICENSE diff --git a/LICENSES/LICENSES.txt b/LICENSES/LICENSES.txt index bf791b0d..74746891 100644 --- a/LICENSES/LICENSES.txt +++ b/LICENSES/LICENSES.txt @@ -19,7 +19,6 @@ github.com/fabienm/go-logrus-formatters; MIT github.com/facebookgo/httpcontrol; BSD-3-Clause github.com/fsnotify/fsnotify; BSD-3-Clause github.com/gabriel-vasile/mimetype; MIT -github.com/ghodss/yaml; BSD-3-Clause github.com/gin-contrib/sse; MIT github.com/gin-gonic/gin; MIT github.com/go-gorp/gorp; MIT diff --git a/LICENSES/go/github.com/ghodss/yaml/LICENSE b/LICENSES/go/github.com/ghodss/yaml/LICENSE deleted file mode 100644 index bf1b4cac..00000000 --- a/LICENSES/go/github.com/ghodss/yaml/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -== github.com/ghodss/yaml == - -Copyright (c) 2014 Sam Ghods -Copyright (c) 2012 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/api/bind.go b/api/bind.go index 63c29b9f..9006d4e0 100644 --- a/api/bind.go +++ b/api/bind.go @@ -7,8 +7,8 @@ import ( "net/http" "reflect" - "github.com/ghodss/yaml" "github.com/gin-gonic/gin" + "sigs.k8s.io/yaml" ) const ( diff --git a/api/yamlrender.go b/api/yamlrender.go index 10079623..5e646a2c 100644 --- a/api/yamlrender.go +++ b/api/yamlrender.go @@ -3,9 +3,9 @@ package api import ( "fmt" - "github.com/ghodss/yaml" "github.com/gin-gonic/gin" "github.com/markusthoemmes/goautoneg" + "sigs.k8s.io/yaml" ) const ( diff --git a/engine/engine.go b/engine/engine.go index 60c90a30..cde9515e 100644 --- a/engine/engine.go +++ b/engine/engine.go @@ -10,13 +10,13 @@ import ( "time" "github.com/cenkalti/backoff" - "github.com/ghodss/yaml" expbk "github.com/jpillora/backoff" "github.com/juju/errors" "github.com/loopfz/gadgeto/zesty" "github.com/ovh/configstore" "github.com/sirupsen/logrus" "golang.org/x/sync/semaphore" + "sigs.k8s.io/yaml" "github.com/ovh/utask" "github.com/ovh/utask/engine/step" diff --git a/engine/engine_test.go b/engine/engine_test.go index 4f8eeb7c..b3ddbc08 100644 --- a/engine/engine_test.go +++ b/engine/engine_test.go @@ -11,13 +11,13 @@ import ( "testing" "time" - "github.com/ghodss/yaml" "github.com/juju/errors" "github.com/loopfz/gadgeto/zesty" "github.com/maxatome/go-testdeep/td" "github.com/ovh/configstore" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "sigs.k8s.io/yaml" "github.com/ovh/utask" "github.com/ovh/utask/api" diff --git a/engine/functions/functions.go b/engine/functions/functions.go index da761882..5f3029f4 100644 --- a/engine/functions/functions.go +++ b/engine/functions/functions.go @@ -11,12 +11,12 @@ import ( "sort" "strings" - "github.com/ghodss/yaml" "github.com/ovh/utask/engine/step/condition" "github.com/ovh/utask/engine/step/executor" "github.com/ovh/utask/engine/values" "github.com/sirupsen/logrus" "github.com/tidwall/gjson" + "sigs.k8s.io/yaml" ) var ( diff --git a/engine/step/executor/executor.go b/engine/step/executor/executor.go index 1431a9cb..6ae49f98 100644 --- a/engine/step/executor/executor.go +++ b/engine/step/executor/executor.go @@ -3,7 +3,7 @@ package executor import ( "encoding/json" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" ) // Executor matches an executor type with its required configuration diff --git a/engine/values/values_test.go b/engine/values/values_test.go index 51eabafc..47fc36aa 100644 --- a/engine/values/values_test.go +++ b/engine/values/values_test.go @@ -5,10 +5,10 @@ import ( "strings" "testing" - "github.com/ghodss/yaml" "github.com/maxatome/go-testdeep/td" "github.com/ovh/utask/engine/values" "github.com/ovh/utask/pkg/utils" + "sigs.k8s.io/yaml" ) func TestTmpl(t *testing.T) { diff --git a/models/tasktemplate/fromdir.go b/models/tasktemplate/fromdir.go index 271cd776..e374b34a 100644 --- a/models/tasktemplate/fromdir.go +++ b/models/tasktemplate/fromdir.go @@ -6,11 +6,11 @@ import ( "path" "strings" - "github.com/ghodss/yaml" "github.com/juju/errors" "github.com/loopfz/gadgeto/zesty" "github.com/ovh/utask/pkg/templateimport" "github.com/sirupsen/logrus" + "sigs.k8s.io/yaml" ) var ( diff --git a/models/tasktemplate/fromdir_test.go b/models/tasktemplate/fromdir_test.go index b5d42cc0..bed7dbfc 100644 --- a/models/tasktemplate/fromdir_test.go +++ b/models/tasktemplate/fromdir_test.go @@ -6,11 +6,11 @@ import ( "path" "testing" - "github.com/ghodss/yaml" "github.com/loopfz/gadgeto/zesty" "github.com/ovh/configstore" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" + "sigs.k8s.io/yaml" "github.com/ovh/utask" "github.com/ovh/utask/db" diff --git a/pkg/plugins/builtin/echo/echo.go b/pkg/plugins/builtin/echo/echo.go index f14363e4..40914728 100644 --- a/pkg/plugins/builtin/echo/echo.go +++ b/pkg/plugins/builtin/echo/echo.go @@ -3,10 +3,10 @@ package echo import ( "fmt" - "github.com/ghodss/yaml" "github.com/juju/errors" "github.com/ovh/utask/pkg/plugins/taskplugin" "github.com/ovh/utask/pkg/utils" + "sigs.k8s.io/yaml" ) // the echo plugin is used to "manually" build result outputs