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

Saved search update handler doesn't support schedule_priority #153

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion client/saved_searches.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package client

import (
"github.com/splunk/terraform-provider-splunk/client/models"
"net/http"

"github.com/splunk/terraform-provider-splunk/client/models"

"github.com/google/go-querystring/query"
)

Expand Down Expand Up @@ -34,6 +35,9 @@ func (client *Client) ReadSavedSearches(name, owner, app string) (*http.Response
}

func (client *Client) UpdateSavedSearches(name string, owner string, app string, savedSearchObject *models.SavedSearchObject) error {
// Splunk API doesn't update the saved search when the schedule_priority field is set (BUG)
// As a workaround we can unset SchedulePriority in update requests, since updating this tf field forces new resource creation
savedSearchObject.SchedulePriority = ""
values, err := query.Values(&savedSearchObject)
if err != nil {
return err
Expand Down
1 change: 1 addition & 0 deletions splunk/resource_splunk_saved_searches.go
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,7 @@ func savedSearches() *schema.Resource {
},
"schedule_priority": {
Type: schema.TypeString,
ForceNew: true,
Optional: true,
Computed: true,
Description: "Raises the scheduling priority of the named search. Defaults to Default",
Expand Down