Skip to content
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

Support mixed instances with PD #1483

Merged
merged 2 commits into from
Jun 9, 2021
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
6 changes: 3 additions & 3 deletions pkg/ipamd/datastore/data_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ func (ds *DataStore) DelIPv4CidrFromStore(eniID string, cidr net.IPNet, force bo
}
strIPv4Cidr := cidr.String()

var deletableCidr *CidrInfo
var deletableCidr *CidrInfo
deletableCidr, ok = curENI.AvailableIPv4Cidrs[strIPv4Cidr]
if !ok {
ds.log.Debugf("Unknown %s CIDR", strIPv4Cidr)
Expand Down Expand Up @@ -1020,9 +1020,9 @@ func (ds *DataStore) GetENIInfos() *ENIInfos {
tmpENIInfo.AvailableIPv4Cidrs = make(map[string]*CidrInfo, len(eniInfo.AvailableIPv4Cidrs))
for cidr, _ := range eniInfo.AvailableIPv4Cidrs {
tmpENIInfo.AvailableIPv4Cidrs[cidr] = &CidrInfo{
Cidr: eniInfo.AvailableIPv4Cidrs[cidr].Cidr,
Cidr: eniInfo.AvailableIPv4Cidrs[cidr].Cidr,
IPv4Addresses: make(map[string]*AddressInfo, len(eniInfo.AvailableIPv4Cidrs[cidr].IPv4Addresses)),
IsPrefix: eniInfo.AvailableIPv4Cidrs[cidr].IsPrefix,
IsPrefix: eniInfo.AvailableIPv4Cidrs[cidr].IsPrefix,
}
// Since IP Addresses might get removed, we need to make a deep copy here.
for ip, ipAddrInfoRef := range eniInfo.AvailableIPv4Cidrs[cidr].IPv4Addresses {
Expand Down
4 changes: 2 additions & 2 deletions pkg/ipamd/ipamd.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,8 @@ func New(k8sapiClient kubernetes.Interface, eniConfig *eniconfig.ENIConfigContro
return nil, err
}
if hypervisorType != "nitro" && c.enableIpv4PrefixDelegation {
log.Error("Prefix delegation is not supported non-nitro instance - " + c.awsClient.GetInstanceType())
return nil, err
log.Warnf("Prefix delegation is not supported on non-nitro instance %s hence falling back to default (secondary IP) mode", c.awsClient.GetInstanceType())
c.enableIpv4PrefixDelegation = false
}
c.myNodeName = os.Getenv("MY_NODE_NAME")
checkpointer := datastore.NewJSONFile(dsBackingStorePath())
Expand Down