Closed Manickam-Annamalai closed 2 years ago
The issue at hand is the provider was reading all views (servicesNS/-/-/saved/searches
) and looking for the view with the name of the created resource:
resp, err := (*provider.Client).ReadAllDashboardObject()
if err != nil {
return err
}
defer resp.Body.Close()
entry, err := getDashboardByName(name, resp)
if err != nil {
return err
}
if entry == nil {
return fmt.Errorf("unable to find resource: %v", name)
}
Within getDashboardByName
, the logic to find the dashboard was also flawed, in that it returned the first dashboard with a matching name, and multiple dashboards in different namespaces can have the same name:
for _, entry := range response.Entry {
if name == re.FindStringSubmatch(entry.Name)[1] {
return &entry, nil
}
}
Re-opened because I missed that search resources were also failing.
I try to create KOs (Dashboard/Saved search) on Splunk cloud and it successfully created the object on the splunk stack, but when it try to confirm, it gets error outs, as we have 1000s of KOs, I suspect its getting the time out after 1m when queries the endpoint. Note: I do set timeout as 600 on the provider connection..
Code:
To perform exactly these actions, run the following command to apply:
terraform apply "splunk1.tf.plan"