forked from lyft/cni-ipvlan-vpc-k8s
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bugs.go
38 lines (34 loc) · 864 Bytes
/
bugs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package aws
import (
"strings"
)
// Bug defines a bug name and a function to check if the
// system is affected
type Bug struct {
Name string
HasBug func() bool
}
// ListBugs returns an enumerated set of all known bugs in AWS or instances
// that this instance is afflicted by
func ListBugs(meta MetadataClient) []Bug {
bugs := []Bug{
{
Name: "broken_cidr",
HasBug: func() bool { return HasBugBrokenVPCCidrs(meta) },
},
}
return bugs
}
// HasBugBrokenVPCCidrs returns true if this instance has a known defective
// meta-data service which will not return secondary VPC CIDRs. As of January 2018,
// this covers c5 and m5 class hardware.
func HasBugBrokenVPCCidrs(meta MetadataClient) bool {
itype := meta.InstanceType()
family := strings.Split(itype, ".")[0]
switch family {
case "c5", "m5":
return true
default:
return false
}
}