Skip to content

Comments

fix: support new schedule creation if not exist#23

Merged
cgrinds merged 11 commits intomainfrom
hl_schedule_fix
Feb 20, 2026
Merged

fix: support new schedule creation if not exist#23
cgrinds merged 11 commits intomainfrom
hl_schedule_fix

Conversation

@Hardikl
Copy link
Contributor

@Hardikl Hardikl commented Feb 13, 2026

This works. tried on vs_test svm as gold svm not exist.

On the u2 cluster, create a snapshot policy named every5hours on the vs_test SVM. The schedule is 5 hours and keeps the last 5 snapshots.
On the u2 cluster, create a snapshot policy named 10miuntes on the vs_test SVM. The schedule is PT10M and keeps the last 5 snapshots.

Copilot AI review requested due to automatic review settings February 13, 2026 10:14
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for automatically creating schedules when they don't exist during snapshot policy creation. Previously, if a referenced schedule didn't exist, the operation would fail with an error. Now, the code attempts to create the schedule by parsing its name to determine whether it follows an ISO 8601 interval format or a cron-style format.

Changes:

  • Added automatic schedule creation fallback when a schedule doesn't exist in CreateSnapshotPolicy
  • Implemented new CreateSchedule function that parses schedule names to determine format (ISO 8601 or cron-style)
  • Extended Schedule and added Cron structs to support interval and cron-based schedule specifications

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 10 comments.

File Description
rest/snapshotpolicy.go Added CreateSchedule function with regex-based schedule name parsing, modified CreateSnapshotPolicy to call it when schedule is missing
ontap/ontap.go Extended Schedule struct with Interval and Cron fields, added new Cron struct with time component fields

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Hardikl
Copy link
Contributor Author

Hardikl commented Feb 17, 2026

image image image image

@NetApp NetApp deleted a comment from Hardikl Feb 19, 2026
@cgrinds cgrinds merged commit 3dfb750 into main Feb 20, 2026
16 checks passed
@cgrinds cgrinds deleted the hl_schedule_fix branch February 20, 2026 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants