Skip to content

Commit 44d5773

Browse files
authored
remove event schema version checks (#748)
1 parent 6232b1f commit 44d5773

File tree

7 files changed

+6
-23
lines changed

7 files changed

+6
-23
lines changed

pkg/event/asgterminate/v1/parser.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import (
2727
const (
2828
source = "aws.autoscaling"
2929
detailType = "EC2 Instance-terminate Lifecycle Action"
30-
version = "1"
3130
acceptedTransition = "autoscaling:EC2_INSTANCE_TERMINATING"
3231
)
3332

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

51-
if evt.Source != source || evt.DetailType != detailType || evt.Version != version {
50+
if evt.Source != source || evt.DetailType != detailType {
5251
return nil
5352
}
5453

pkg/event/asgterminate/v2/parser.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import (
2727
const (
2828
source = "aws.autoscaling"
2929
detailType = "EC2 Instance-terminate Lifecycle Action"
30-
version = "2"
3130
acceptedTransition = "autoscaling:EC2_INSTANCE_TERMINATING"
3231
)
3332

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

51-
if evt.Source != source || evt.DetailType != detailType || evt.Version != version {
50+
if evt.Source != source || evt.DetailType != detailType {
5251
return nil
5352
}
5453

pkg/event/rebalancerecommendation/v0/parser.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import (
2727
const (
2828
source = "aws.ec2"
2929
detailType = "EC2 Instance Rebalance Recommendation"
30-
version = "0"
3130
)
3231

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

46-
if evt.Source != source || evt.DetailType != detailType || evt.Version != version {
45+
if evt.Source != source || evt.DetailType != detailType {
4746
return nil
4847
}
4948

pkg/event/scheduledchange/v1/parser.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import (
2727
const (
2828
source = "aws.health"
2929
detailType = "AWS Health Event"
30-
version = "1"
3130
acceptedService = "EC2"
3231
acceptedEventTypeCategory = "scheduledChange"
3332
)
@@ -45,7 +44,7 @@ func (Parser) Parse(ctx context.Context, str string) terminator.Event {
4544
return nil
4645
}
4746

48-
if evt.Source != source || evt.DetailType != detailType || evt.Version != version {
47+
if evt.Source != source || evt.DetailType != detailType {
4948
return nil
5049
}
5150

pkg/event/spotinterruption/v1/parser.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import (
2727
const (
2828
source = "aws.ec2"
2929
detailType = "EC2 Spot Instance Interruption Warning"
30-
version = "1"
3130
)
3231

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

46-
if evt.Source != source || evt.DetailType != detailType || evt.Version != version {
45+
if evt.Source != source || evt.DetailType != detailType {
4746
return nil
4847
}
4948

pkg/event/statechange/v1/parser.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import (
2828
const (
2929
source = "aws.ec2"
3030
detailType = "EC2 Instance State-change Notification"
31-
version = "1"
3231
acceptedStates = "stopping,stopped,shutting-down,terminated"
3332
)
3433

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

50-
if evt.Source != source || evt.DetailType != detailType || evt.Version != version {
49+
if evt.Source != source || evt.DetailType != detailType {
5150
return nil
5251
}
5352

resources/queue-infrastructure.yaml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ Resources:
3939
- aws.autoscaling
4040
detail-type:
4141
- EC2 Instance-terminate Lifecycle Action
42-
version:
43-
- "1"
44-
- "2"
4542
detail:
4643
LifecycleTransition:
4744
- "autoscaling:EC2_INSTANCE_TERMINATING"
@@ -60,8 +57,6 @@ Resources:
6057
- aws.ec2
6158
detail-type:
6259
- EC2 Instance Rebalance Recommendation
63-
version:
64-
- "0"
6560
State: ENABLED
6661
Targets:
6762
- Id: !GetAtt Queue.QueueName
@@ -77,8 +72,6 @@ Resources:
7772
- aws.health
7873
detail-type:
7974
- AWS Health Event
80-
version:
81-
- "1"
8275
detail:
8376
source:
8477
- EC2
@@ -99,8 +92,6 @@ Resources:
9992
- aws.ec2
10093
detail-type:
10194
- EC2 Spot Instance Interruption Warning
102-
version:
103-
- "1"
10495
State: ENABLED
10596
Targets:
10697
- Id: !GetAtt Queue.QueueName
@@ -116,8 +107,6 @@ Resources:
116107
- aws.ec2
117108
detail-type:
118109
- EC2 Instance State-change Notification
119-
version:
120-
- "1"
121110
detail:
122111
state:
123112
- stopping

0 commit comments

Comments
 (0)