Innablr / revolver

AWS Powercycle Facility
MIT License
2 stars 2 forks source link

DB cluster unexpectedly scheduled up #290

Open lyricnz opened 3 months ago

lyricnz commented 3 months ago

Using powercycleCentral with configuration of:

            - filter:
              - accountId: '554096786507'
              - id: cloudsnooze-test-rds-cluster
              - type: rdsCluster
              name: 'aws-ecp-main-workload-innovation-6: cluster DB'
              priority: 5
              schedule: Start=11:00|mon;Stop=13:00|mon

the workload was started at 11am Wednesday with the following message:

2024-04-03T00:00:00.000Z,554096786507,aws-ecp-main-workload-innovation-6,powercycleCentral,rdsCluster,rds,cloudsnooze-test-rds-cluster,start,success,"[aws-ecp-main-workload-innovation-6: cluster DB]: It's Wed 11:00 +11, availability is from 11:00 till 13:00 all week"

lyricnz commented 3 months ago

Looking at the regex, it looks like the day part requires both a startday and stopday

    this.re = new RegExp(`(${component}=([0-9]{1,2}:[0-9]{1,2}))(\\|([a-z]{3}-[a-z]{3}))?`);

So the schedule should read

  schedule: "Start=11:00|mon-mon;Stop=13:00|mon-mon"

Q: Why didn't this generate an error?