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

parse time in local tz #238

Merged
merged 1 commit into from
Sep 10, 2024
Merged
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
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
Loading