Skip to content

remove event schema version checks #748

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Dec 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions pkg/event/asgterminate/v1/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
const (
source = "aws.autoscaling"
detailType = "EC2 Instance-terminate Lifecycle Action"
version = "1"
acceptedTransition = "autoscaling:EC2_INSTANCE_TERMINATING"
)

Expand All @@ -48,7 +47,7 @@ func (p Parser) Parse(ctx context.Context, str string) terminator.Event {
return nil
}

if evt.Source != source || evt.DetailType != detailType || evt.Version != version {
if evt.Source != source || evt.DetailType != detailType {
return nil
}

Expand Down
3 changes: 1 addition & 2 deletions pkg/event/asgterminate/v2/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
const (
source = "aws.autoscaling"
detailType = "EC2 Instance-terminate Lifecycle Action"
version = "2"
acceptedTransition = "autoscaling:EC2_INSTANCE_TERMINATING"
)

Expand All @@ -48,7 +47,7 @@ func (p Parser) Parse(ctx context.Context, str string) terminator.Event {
return nil
}

if evt.Source != source || evt.DetailType != detailType || evt.Version != version {
if evt.Source != source || evt.DetailType != detailType {
return nil
}

Expand Down
3 changes: 1 addition & 2 deletions pkg/event/rebalancerecommendation/v0/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
const (
source = "aws.ec2"
detailType = "EC2 Instance Rebalance Recommendation"
version = "0"
)

type Parser struct{}
Expand All @@ -43,7 +42,7 @@ func (Parser) Parse(ctx context.Context, str string) terminator.Event {
return nil
}

if evt.Source != source || evt.DetailType != detailType || evt.Version != version {
if evt.Source != source || evt.DetailType != detailType {
return nil
}

Expand Down
3 changes: 1 addition & 2 deletions pkg/event/scheduledchange/v1/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
const (
source = "aws.health"
detailType = "AWS Health Event"
version = "1"
acceptedService = "EC2"
acceptedEventTypeCategory = "scheduledChange"
)
Expand All @@ -45,7 +44,7 @@ func (Parser) Parse(ctx context.Context, str string) terminator.Event {
return nil
}

if evt.Source != source || evt.DetailType != detailType || evt.Version != version {
if evt.Source != source || evt.DetailType != detailType {
return nil
}

Expand Down
3 changes: 1 addition & 2 deletions pkg/event/spotinterruption/v1/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
const (
source = "aws.ec2"
detailType = "EC2 Spot Instance Interruption Warning"
version = "1"
)

type Parser struct{}
Expand All @@ -43,7 +42,7 @@ func (Parser) Parse(ctx context.Context, str string) terminator.Event {
return nil
}

if evt.Source != source || evt.DetailType != detailType || evt.Version != version {
if evt.Source != source || evt.DetailType != detailType {
return nil
}

Expand Down
3 changes: 1 addition & 2 deletions pkg/event/statechange/v1/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
const (
source = "aws.ec2"
detailType = "EC2 Instance State-change Notification"
version = "1"
acceptedStates = "stopping,stopped,shutting-down,terminated"
)

Expand All @@ -47,7 +46,7 @@ func (Parser) Parse(ctx context.Context, str string) terminator.Event {
return nil
}

if evt.Source != source || evt.DetailType != detailType || evt.Version != version {
if evt.Source != source || evt.DetailType != detailType {
return nil
}

Expand Down
11 changes: 0 additions & 11 deletions resources/queue-infrastructure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ Resources:
- aws.autoscaling
detail-type:
- EC2 Instance-terminate Lifecycle Action
version:
- "1"
- "2"
detail:
LifecycleTransition:
- "autoscaling:EC2_INSTANCE_TERMINATING"
Expand All @@ -60,8 +57,6 @@ Resources:
- aws.ec2
detail-type:
- EC2 Instance Rebalance Recommendation
version:
- "0"
State: ENABLED
Targets:
- Id: !GetAtt Queue.QueueName
Expand All @@ -77,8 +72,6 @@ Resources:
- aws.health
detail-type:
- AWS Health Event
version:
- "1"
detail:
source:
- EC2
Expand All @@ -99,8 +92,6 @@ Resources:
- aws.ec2
detail-type:
- EC2 Spot Instance Interruption Warning
version:
- "1"
State: ENABLED
Targets:
- Id: !GetAtt Queue.QueueName
Expand All @@ -116,8 +107,6 @@ Resources:
- aws.ec2
detail-type:
- EC2 Instance State-change Notification
version:
- "1"
detail:
state:
- stopping
Expand Down