Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set nodes_selected_by_default to true if not dispatch #154

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions rundeck/resource_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -967,9 +967,6 @@ func jobToResourceData(job *JobDetail, d *schema.ResourceData) error {
if err := d.Set("schedule_enabled", job.ScheduleEnabled); err != nil {
return err
}
if err := d.Set("nodes_selected_by_default", job.NodesSelectedByDefault); err != nil {
return err
}
if err := d.Set("time_zone", job.TimeZone); err != nil {
return err
}
Expand Down Expand Up @@ -1006,6 +1003,9 @@ func jobToResourceData(job *JobDetail, d *schema.ResourceData) error {
if err := d.Set("success_on_empty_node_filter", job.Dispatch.SuccessOnEmptyNodeFilter); err != nil {
return err
}
if err := d.Set("nodes_selected_by_default", job.NodesSelectedByDefault); err != nil {
return err
}
} else {
if err := d.Set("max_thread_count", 1); err != nil {
return err
Expand All @@ -1019,6 +1019,10 @@ func jobToResourceData(job *JobDetail, d *schema.ResourceData) error {
if err := d.Set("rank_order", "ascending"); err != nil {
return err
}
// if not dispatch, nodes_selected_by_default is always empty and default to be true
if err := d.Set("nodes_selected_by_default", true); err != nil {
return err
}
}

if job.NodeFilter != nil {
Expand Down