fix: support new schedule creation if not exist#23
Merged
Conversation
There was a problem hiding this comment.
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
CreateSchedulefunction that parses schedule names to determine format (ISO 8601 or cron-style) - Extended
Scheduleand addedCronstructs 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.
Contributor
Author
cgrinds
reviewed
Feb 19, 2026
cgrinds
reviewed
Feb 19, 2026
rahulguptajss
approved these changes
Feb 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




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