Skip to content

Create some default schedule policies#385

Merged
disrani-px merged 1 commit intomasterfrom
default_policy
May 25, 2019
Merged

Create some default schedule policies#385
disrani-px merged 1 commit intomasterfrom
default_policy

Conversation

@disrani-px
Copy link
Copy Markdown
Contributor

Also update strokctl to use a default policy for migration schedule

What type of PR is this?
Enhancement

What this PR does / why we need it:

Does this PR change a user-facing CRD or CLI?:
No

Is a release note needed?:

* Added some default schedule policies:
  * default-migration-policy: Triggers after every minute
  * default-interval-policy: Triggers after every hour. Retains last 10
  * default-daily-policy: Triggers every day at 12:00am. Retains last 7
  * default-weekly-policy: Triggers every Sunday@12:00am. Retains last 4
  * default-monthly-policy: Triggers every 15th day of the month at 12:00am. Retains last 12.

Does this change need to be cherry-picked to a release branch?:
2.2

@disrani-px disrani-px added enhancement release-note Information about this change needs to be added to the release note labels May 24, 2019
@disrani-px disrani-px added this to the 2.2.3 milestone May 24, 2019
@codecov
Copy link
Copy Markdown

codecov bot commented May 24, 2019

Codecov Report

Merging #385 into master will increase coverage by 0.38%.
The diff coverage is 84.05%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #385      +/-   ##
==========================================
+ Coverage    72.5%   72.89%   +0.38%     
==========================================
  Files          24       24              
  Lines        2128     2195      +67     
==========================================
+ Hits         1543     1600      +57     
- Misses        453      458       +5     
- Partials      132      137       +5
Impacted Files Coverage Δ
pkg/storkctl/migrationschedule.go 85.08% <100%> (+0.33%) ⬆️
pkg/schedule/schedule.go 56.38% <82.53%> (+10.65%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8dd0ce7...c6cce6e. Read the comment docs.

Also update strokctl to use a default policy for migration schedule
func createDefaultPolicy() error {
_, err := k8s.Instance().CreateSchedulePolicy(&stork_api.SchedulePolicy{
ObjectMeta: meta.ObjectMeta{
Name: "default-migration-policy",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we call it migration policy or keep it generic?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is used specifically as the default for migrations when creating a schedule using storkctl

@disrani-px disrani-px merged commit f2e070e into master May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement release-note Information about this change needs to be added to the release note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants