mirror of https://github.com/databricks/cli.git
Fixed panic when job has trigger and in development mode (#1026)
## Changes Fixed panic when job has trigger and in development mode
This commit is contained in:
parent
f2969e91bd
commit
4d8d825746
|
@ -54,10 +54,10 @@ func transformDevelopmentMode(b *bundle.Bundle) error {
|
|||
if r.Jobs[i].Schedule != nil && r.Jobs[i].Schedule.PauseStatus != jobs.PauseStatusUnpaused {
|
||||
r.Jobs[i].Schedule.PauseStatus = jobs.PauseStatusPaused
|
||||
}
|
||||
if r.Jobs[i].Continuous != nil && r.Jobs[i].Schedule.PauseStatus != jobs.PauseStatusUnpaused {
|
||||
if r.Jobs[i].Continuous != nil && r.Jobs[i].Continuous.PauseStatus != jobs.PauseStatusUnpaused {
|
||||
r.Jobs[i].Continuous.PauseStatus = jobs.PauseStatusPaused
|
||||
}
|
||||
if r.Jobs[i].Trigger != nil && r.Jobs[i].Schedule.PauseStatus != jobs.PauseStatusUnpaused {
|
||||
if r.Jobs[i].Trigger != nil && r.Jobs[i].Trigger.PauseStatus != jobs.PauseStatusUnpaused {
|
||||
r.Jobs[i].Trigger.PauseStatus = jobs.PauseStatusPaused
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,6 +62,24 @@ func mockBundle(mode config.Mode) *bundle.Bundle {
|
|||
},
|
||||
},
|
||||
},
|
||||
"job3": {
|
||||
JobSettings: &jobs.JobSettings{
|
||||
Name: "job3",
|
||||
Trigger: &jobs.TriggerSettings{
|
||||
FileArrival: &jobs.FileArrivalTriggerConfiguration{
|
||||
Url: "test.com",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"job4": {
|
||||
JobSettings: &jobs.JobSettings{
|
||||
Name: "job4",
|
||||
Continuous: &jobs.Continuous{
|
||||
PauseStatus: jobs.PauseStatusPaused,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
Pipelines: map[string]*resources.Pipeline{
|
||||
"pipeline1": {PipelineSpec: &pipelines.PipelineSpec{Name: "pipeline1"}},
|
||||
|
@ -205,6 +223,8 @@ func TestProcessTargetModeProduction(t *testing.T) {
|
|||
b.Config.Resources.Jobs["job1"].Permissions = permissions
|
||||
b.Config.Resources.Jobs["job1"].RunAs = &jobs.JobRunAs{UserName: "user@company.com"}
|
||||
b.Config.Resources.Jobs["job2"].RunAs = &jobs.JobRunAs{UserName: "user@company.com"}
|
||||
b.Config.Resources.Jobs["job3"].RunAs = &jobs.JobRunAs{UserName: "user@company.com"}
|
||||
b.Config.Resources.Jobs["job4"].RunAs = &jobs.JobRunAs{UserName: "user@company.com"}
|
||||
b.Config.Resources.Pipelines["pipeline1"].Permissions = permissions
|
||||
b.Config.Resources.Experiments["experiment1"].Permissions = permissions
|
||||
b.Config.Resources.Experiments["experiment2"].Permissions = permissions
|
||||
|
|
Loading…
Reference in New Issue