-
Notifications
You must be signed in to change notification settings - Fork 84
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
CLOUDP-238932: Validate maxDate and minDate before running command #2794
Conversation
if p.MaxDate, err = opts.ParseDate(opts.MaxDate); err != nil { | ||
return p, err | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if p.MaxDate, err = opts.ParseDate(opts.MaxDate); err != nil { | |
return p, err | |
} | |
if opts.MaxDate != "" { | |
if p.MaxDate, err = opts.ParseDate(opts.MaxDate); err != nil { | |
return nil, err | |
} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh I see ParseDate is now empty safe, then this may not be needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -54,7 +54,7 @@ func TestEvents(t *testing.T) { | |||
orgEntity, | |||
"list", | |||
"--omitCount", | |||
"--minDate="+time.Now().Add(-time.Hour*time.Duration(24)).Format("2006-01-02"), | |||
"--minDate="+time.Now().Add(-time.Hour*time.Duration(24)).Format("2006-01-02T15:04:05-0700"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙃
Proposed changes
Jira ticket: CLOUDP-238932
closes #2793
Checklist
make fmt
and formatted my codeFurther comments