diff --git a/NOTICE b/NOTICE index d8306510..52fc5374 100644 --- a/NOTICE +++ b/NOTICE @@ -73,10 +73,6 @@ fatih/color - https://github.com/fatih/color Copyright (c) 2013 Fatih Arslan License - https://github.com/fatih/color/blob/main/LICENSE.md -ghodss/yaml - https://github.com/ghodss/yaml -Copyright (c) 2014 Sam Ghods -License - https://github.com/ghodss/yaml/blob/master/LICENSE - Masterminds/semver - https://github.com/Masterminds/semver Copyright (C) 2014-2019, Matt Butcher and Matt Farina License - https://github.com/Masterminds/semver/blob/master/LICENSE.txt diff --git a/bundle/internal/schema/main_test.go b/bundle/internal/schema/main_test.go index f1389e61..607347b6 100644 --- a/bundle/internal/schema/main_test.go +++ b/bundle/internal/schema/main_test.go @@ -15,8 +15,8 @@ import ( "github.com/databricks/cli/libs/dyn/merge" "github.com/databricks/cli/libs/dyn/yamlloader" "github.com/databricks/cli/libs/jsonschema" - "github.com/ghodss/yaml" "github.com/stretchr/testify/assert" + "gopkg.in/yaml.v3" ) func copyFile(src, dst string) error { diff --git a/bundle/internal/schema/parser.go b/bundle/internal/schema/parser.go index 6fb6e004..3fbec052 100644 --- a/bundle/internal/schema/parser.go +++ b/bundle/internal/schema/parser.go @@ -9,10 +9,9 @@ import ( "reflect" "strings" - "github.com/ghodss/yaml" - "github.com/databricks/cli/libs/dyn/yamlloader" "github.com/databricks/cli/libs/jsonschema" + "gopkg.in/yaml.v3" ) type Components struct { diff --git a/go.mod b/go.mod index 03e2791d..09b10bed 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,6 @@ require ( github.com/briandowns/spinner v1.23.1 // Apache 2.0 github.com/databricks/databricks-sdk-go v0.54.0 // Apache 2.0 github.com/fatih/color v1.18.0 // MIT - github.com/ghodss/yaml v1.0.0 // MIT + NOTICE github.com/google/uuid v1.6.0 // BSD-3-Clause github.com/hashicorp/go-version v1.7.0 // MPL 2.0 github.com/hashicorp/hc-install v0.9.0 // MPL 2.0 @@ -70,5 +69,4 @@ require ( google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e // indirect google.golang.org/grpc v1.64.1 // indirect google.golang.org/protobuf v1.34.1 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/go.sum b/go.sum index be77011c..79775f51 100644 --- a/go.sum +++ b/go.sum @@ -48,8 +48,6 @@ github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= @@ -263,8 +261,6 @@ gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/libs/flags/yaml_flag.go b/libs/flags/yaml_flag.go deleted file mode 100644 index 95cc9b4b..00000000 --- a/libs/flags/yaml_flag.go +++ /dev/null @@ -1,42 +0,0 @@ -package flags - -import ( - "fmt" - "os" - - "github.com/ghodss/yaml" -) - -type YamlFlag struct { - raw []byte -} - -func (y *YamlFlag) String() string { - return fmt.Sprintf("YAML (%d bytes)", len(y.raw)) -} - -// TODO: Command.MarkFlagFilename() -func (y *YamlFlag) Set(v string) error { - // Load request from file if it starts with '@' (like curl). - if v[0] != '@' { - y.raw = []byte(v) - return nil - } - buf, err := os.ReadFile(v[1:]) - if err != nil { - return fmt.Errorf("read %s: %w", v, err) - } - y.raw = buf - return nil -} - -func (y *YamlFlag) Unmarshal(v any) error { - if y.raw == nil { - return nil - } - return yaml.Unmarshal(y.raw, v) -} - -func (y *YamlFlag) Type() string { - return "YAML" -}