Skip to content

Commit

Permalink
do not patch CNINode for custom networking unless podENI is enabled (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jdn5126 authored Sep 29, 2023
1 parent b5d501d commit 78df61b
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions pkg/ipamd/ipamd.go
Original file line number Diff line number Diff line change
Expand Up @@ -560,14 +560,16 @@ func (c *IPAMContext) nodeInit() error {

eniConfigName, err := eniconfig.GetNodeSpecificENIConfigName(node)
if err == nil && eniConfigName != "default" {
// Add the feature name to CNINode of this node
err := c.AddFeatureToCNINode(ctx, rcv1alpha1.CustomNetworking, eniConfigName)
if err != nil {
log.Errorf("Failed to add feature custom networking into CNINode", err)
podENIErrInc("nodeInit")
return err
// If Security Groups for Pods is enabled, the VPC Resource Controller must also know that Custom Networking is enabled
if c.enablePodENI {
err := c.AddFeatureToCNINode(ctx, rcv1alpha1.CustomNetworking, eniConfigName)
if err != nil {
log.Errorf("Failed to add feature custom networking into CNINode", err)
podENIErrInc("nodeInit")
return err
}
log.Infof("Enabled feature %s in CNINode for node %s if not existing", rcv1alpha1.CustomNetworking, c.myNodeName)
}
log.Infof("Enabled feature %s in CNINode for node %s if not existing", rcv1alpha1.CustomNetworking, c.myNodeName)
} else {
log.Errorf("No ENIConfig could be found for this node", err)
}
Expand Down

0 comments on commit 78df61b

Please sign in to comment.