Skip to content

Commit

Permalink
Merge pull request #238 from ritzk/main
Browse files Browse the repository at this point in the history
parse time in local tz
  • Loading branch information
alexhung authored Sep 10, 2024
2 parents c50488a + 4fc637e commit 34832bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/resources/ignore_rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ resource "xray_ignore_rule" "ignore-111" {
- `component` (Block Set) List of specific components to ignore. Omit to apply to all. (see [below for nested schema](#nestedblock--component))
- `cves` (Set of String) List of specific CVEs to ignore. Omit to apply to all. Should set to 'any' when 'vulnerabilities' is set to 'any'.
- `docker_layers` (Set of String) List of Docker layer SHA256 hashes to ignore. Omit to apply to all.
- `expiration_date` (String) The Ignore Rule will be active until the expiration date. At that date it will automatically get deleted. The rule with the expiration date less than current day, will error out.
- `expiration_date` (String) The Ignore Rule will be active until the expiration date. At that date it will automatically get deleted. The rule with the expiration date less than current day, will error out. Ensure client and server time zones match.
- `licenses` (Set of String) List of specific licenses to ignore. Omit to apply to all.
- `operational_risk` (Set of String) Operational risk to ignore. Only accept 'any'
- `policies` (Set of String) List of specific policies to ignore. Omit to apply to all.
Expand Down
2 changes: 1 addition & 1 deletion pkg/xray/resource/resource_xray_ignore_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func (m IgnoreRuleResourceModel) toAPIModel(ctx context.Context, apiModel *Ignor

var expiresAt *time.Time
if m.ExpiredAt.ValueString() != "" {
parsedTime, err := time.Parse("2006-01-02", m.ExpiredAt.ValueString())
parsedTime, err := time.ParseInLocation("2006-01-02", m.ExpiredAt.ValueString(), time.Local)
if err != nil {
ds.AddError(
"failed to parse date/time string",
Expand Down

0 comments on commit 34832bb

Please sign in to comment.