mirror of https://github.com/databricks/cli.git
fix test and improve error
This commit is contained in:
parent
fa545777bd
commit
73826acb2f
|
@ -245,13 +245,14 @@ func GetFilerForLibraries(ctx context.Context, b *bundle.Bundle, uploadPath stri
|
||||||
// the schema was?
|
// the schema was?
|
||||||
l, ok := locationForVolume(b, catalogName, schemaName, volumeName)
|
l, ok := locationForVolume(b, catalogName, schemaName, volumeName)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, diag.Errorf("UC volume %s does not exist", volumePath)
|
return nil, diag.Errorf("the bundle is configured to upload artifacts to %s but a UC volume at %s does not exist", uploadPath, volumePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, diag.Errorf(`UC volume %s does not exist. Note: We detected that
|
return nil, diag.Errorf(`the bundle is configured to upload artifacts to %s but a
|
||||||
you have a UC volume defined that matched the path above at %s.
|
UC volume at %s does not exist. Note: We detected that you have a UC volume
|
||||||
Please deploy the UC volume separately before using it in as a
|
defined that matched the path above at %s. Please deploy the UC volume
|
||||||
destination to upload artifacts.`, l, volumePath)
|
in a separate deployment before using it in as a destination to upload
|
||||||
|
artifacts.`, uploadPath, volumePath, l)
|
||||||
}
|
}
|
||||||
|
|
||||||
func locationForVolume(b *bundle.Bundle, catalogName, schemaName, volumeName string) (dyn.Location, bool) {
|
func locationForVolume(b *bundle.Bundle, catalogName, schemaName, volumeName string) (dyn.Location, bool) {
|
||||||
|
|
|
@ -40,17 +40,7 @@ func TestParseTerraformActions(t *testing.T) {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
res := filterDeleteOrRecreateActions(changes, func(typ string, actions tfjson.Actions) bool {
|
res := filterDeleteOrRecreateActions(changes, "databricks_pipeline")
|
||||||
if typ != "databricks_pipeline" {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
if actions.Delete() || actions.Replace() {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
return false
|
|
||||||
})
|
|
||||||
|
|
||||||
assert.Equal(t, []terraformlib.Action{
|
assert.Equal(t, []terraformlib.Action{
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue