-
Notifications
You must be signed in to change notification settings - Fork 33
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
POL-1410 - Improve Scheduled Instance Notifications #2817
base: master
Are you sure you want to change the base?
POL-1410 - Improve Scheduled Instance Notifications #2817
Conversation
Generated by 🚫 Danger |
// schedule="08:00-17:30;MO,TU,WE,TH,FR;America/Los_Angeles" | ||
var schedule_is_valid = /([0-9]{1,2}.*)-([0-9]{1,2}.*);([A-Za-z,]*).*/.test(schedule) | ||
if ((_.isString(schedule)) && (schedule_is_valid == false)) { | ||
console.log("Skipping instance " + instance['instanceId'] + " with invalid schedule '" + schedule +"'"); |
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.
Do we need this console.log()
for this template meant for the Catalog?
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.
Using this thread to discuss:
#2817 (comment)
// schedule="0900-0930_mo-tu-we-th-fr_america-los_angeles" | ||
var schedule_is_valid = /([0-9]{1,2}.*)-([0-9]{1,2}.*)_([a-z\-]*).*/.test(schedule) | ||
if ((_.isString(schedule)) && (schedule_is_valid == false)) { | ||
console.log("Skipping instance " + instance['instanceId'] + " with invalid schedule '" + schedule +"'"); |
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.
Same as console.log()
comments on AWS and Azure policies above
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.
Using this thread to discuss:
#2817 (comment)
// schedule="08:00-17:30;MO,TU,WE,TH,FR;America/Los_Angeles" | ||
var schedule_is_valid = /([0-9]{1,2}.*)-([0-9]{1,2}.*);([A-Za-z,]*).*/.test(schedule) | ||
if ((_.isString(schedule)) && (schedule_is_valid == false)) { | ||
console.log("Skipping instance " + instance['resourceID'] + " with invalid schedule '" + schedule +"'"); |
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.
Same as console.log()
comments on AWS policy above
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.
Going to use this thread to discuss.. I am was thinking this would be a valid piece of information to have in the logs. Another way we could return this is including the instance in the results, but with a value for "schedule_error" field or something -- and only resources that have no schedule_error value would be valid and have it's schedule executed.
Or, we leave this as a console.log and ignore this test warning... any thoughts @XOmniverse ? We've discussed console.log exemptions before
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.
We should probably have a broader conversation about this. I originally added that test because I frequently (mostly in older and poorly maintained policy templates) found simple debugging console.log() statements that were left over without being properly removed from the production template.
If we believe there are things we would want logged via console.log() that are not for debugging during policy development, that test can be disabled.
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.
Using this thread to discuss:
#2817 (comment)
Description
Improved notifications related for the 3 Scheduled Instance Policy Templates
Issues Resolved
https://flexera.atlassian.net/browse/POL-1410
Link to Example Applied Policy
https://app.flexera.com/orgs/6/automation/applied-policies/projects/7954
The 3 "Scheduled Instance" Applied Policies running in there
Contribution Check List