mirror of https://github.com/databricks/cli.git
Use pointers to resources in bundle configuration (#140)
Avoid copy-by-value when iterating over these maps.
This commit is contained in:
parent
4e834857e6
commit
72e89bf33c
|
@ -1,9 +1,11 @@
|
||||||
package config
|
package config
|
||||||
|
|
||||||
import "github.com/databricks/bricks/bundle/config/resources"
|
import (
|
||||||
|
"github.com/databricks/bricks/bundle/config/resources"
|
||||||
|
)
|
||||||
|
|
||||||
// Resources defines Databricks resources associated with the bundle.
|
// Resources defines Databricks resources associated with the bundle.
|
||||||
type Resources struct {
|
type Resources struct {
|
||||||
Jobs map[string]resources.Job `json:"jobs,omitempty"`
|
Jobs map[string]*resources.Job `json:"jobs,omitempty"`
|
||||||
Pipelines map[string]resources.Pipeline `json:"pipelines,omitempty"`
|
Pipelines map[string]*resources.Pipeline `json:"pipelines,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,8 +33,8 @@ func TestConvertJob(t *testing.T) {
|
||||||
|
|
||||||
var config = config.Root{
|
var config = config.Root{
|
||||||
Resources: config.Resources{
|
Resources: config.Resources{
|
||||||
Jobs: map[string]resources.Job{
|
Jobs: map[string]*resources.Job{
|
||||||
"my_job": src,
|
"my_job": &src,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -67,8 +67,8 @@ func TestConvertJobTaskLibraries(t *testing.T) {
|
||||||
|
|
||||||
var config = config.Root{
|
var config = config.Root{
|
||||||
Resources: config.Resources{
|
Resources: config.Resources{
|
||||||
Jobs: map[string]resources.Job{
|
Jobs: map[string]*resources.Job{
|
||||||
"my_job": src,
|
"my_job": &src,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue