-
Notifications
You must be signed in to change notification settings - Fork 175
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
Support cron and timezone in manager task integration #1851
Support cron and timezone in manager task integration #1851
Conversation
@rzetelskik: GitHub didn't allow me to request PR reviews from the following users: rzetelskik. Note that only scylladb members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
ef1dc3e
to
d286501
Compare
777d05a
to
0b41f8e
Compare
/priority critical-urgent |
0b41f8e
to
c21f5e5
Compare
/cc @Michal-Leszczynski |
c21f5e5
to
8c58331
Compare
8c58331
to
328d3a3
Compare
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.
please fix the API to use pointers where 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.
// startDate specifies the task start date expressed in the RFC3339 format or now[+duration],
// e.g. now+3d2h10m, valid units are d, h, m, s.
// +kubebuilder:default:="now"
// +optional
StartDate string `json:"startDate,omitempty"`
The now
syntax can cause a lot of pain since it is parsed on the operator or sctool side. Maybe it's worth to discourage users from using via appropriate field description?
// interval represents a task schedule interval e.g. 3d2h10m, valid units are d, h, m, s.
// +optional
// +kubebuilder:default:="0"
Interval string `json:"interval,omitempty"`
The interval
field is (or should be) deprecated by SM. Is it also deprecated here?
// For Scylla clusters that are row-level repair enabled, setting intensity below 1 has the same effect as setting intensity 1.
// +kubebuilder:default:="1"
// +optional
Intensity string `json:"intensity,omitempty" mapstructure:"intensity,omitempty"`
Why is it string? SM supports float64 for backward compatibility, but all floats are converted to ints anyway, because they don't make sense anymore from Scylla POV.
@tnozicka I added cron and timezone validation. TZ and CRON_TZ are not accepted as part of cron for now. I'll raise an issue with the manager team. |
manager flake and upgrade flake - can't possibly be deteriorated by this PR /test images |
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.
thanks, the api and overall logic looks sound to me, had some technical comments
@@ -34,6 +38,8 @@ var ( | |||
scyllav1.BroadcastAddressTypeServiceClusterIP, | |||
scyllav1.BroadcastAddressTypeServiceLoadBalancerIngress, | |||
} | |||
|
|||
schedulerTaskSpecCronParser = cron.NewParser(cron.SecondOptional | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor) |
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.
I am not sure the parser should be a global var as it may be an issue with concurrent access. I'd globalize only the parsing options.
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.
done
|
||
// We can only validate interval when cron is non-nil for backwards compatibility. | ||
if schedulerTaskSpec.Interval != nil && schedulerTaskSpec.Cron != nil { | ||
if intervalDuration, err := duration.ParseDuration(*schedulerTaskSpec.Interval); err != nil { |
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.
nit: please split the assignment to make it shorter
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.
done
expectedErrorString: "", | ||
}, | ||
{ | ||
name: "invalid timezone in manager backup task spec", |
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.
it's unclear whether the test should produce and error or not from it's name (in other places as well), especially given it says invalid
and produces no error
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.
my bad, it shouldn't say invalid here
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.
done
c1517f7
to
7ea90ba
Compare
manager flake |
same thing again |
/test images |
and again |
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.
thanks for the updates
/approve
high level lgtm but I only scanned the test
/assign @zimnx
aaand again /test images |
@rzetelskik: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/retest |
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.
thanks
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rzetelskik, tnozicka, zimnx The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold cancel |
Description of your changes: This PR adds missing cron and related fields, currently missing from out API, to manager task specs and extends the unit tests to cover them.
Which issue is resolved by this Pull Request:
Resolves #1739
/kind feature
/priority important-longterm
/cc