Skip to content

Commit

Permalink
harbor_interrogation_services ressource is not idempotent with custom…
Browse files Browse the repository at this point in the history
… cron (fixes #451) (#457)

fixes #451

Signed-off-by: flbla <[email protected]>
  • Loading branch information
flbla authored Jul 22, 2024
1 parent 323b94f commit 9a13061
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions models/interogations.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ package models
type InterogationsBodyResponse struct {
Schedule struct {
Type string `json:"type,omitempty"`
Cron string `json:"cron,omitempty"`
}
}
7 changes: 6 additions & 1 deletion provider/resource_interrogation_services.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ func resourceVulnRead(d *schema.ResourceData, m interface{}) error {
return fmt.Errorf("Resource not found %s", d.Id())
}

d.Set("vulnerability_scan_policy", jsonData.Schedule.Type)
vulnerability_scan_policy := jsonData.Schedule.Type
if vulnerability_scan_policy == "Custom" {
vulnerability_scan_policy = jsonData.Schedule.Cron
}

d.Set("vulnerability_scan_policy", vulnerability_scan_policy)

return nil
}
Expand Down

0 comments on commit 9a13061

Please sign in to comment.