Skip to content

Commit

Permalink
node initialization must come after primary ENI's security groups are…
Browse files Browse the repository at this point in the history
… synced to cache
  • Loading branch information
jdn5126 committed Jun 16, 2023
1 parent 565b1ea commit 30be8da
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions pkg/ipamd/ipamd.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,14 +439,8 @@ func New(rawK8SClient client.Client, cachedK8SClient client.Client) (*IPAMContex
checkpointer := datastore.NewJSONFile(dsBackingStorePath())
c.dataStore = datastore.NewDataStore(log, checkpointer, c.enablePrefixDelegation)

err = c.nodeInit()
if err != nil {
return nil, err
}

mac := c.awsClient.GetPrimaryENImac()

// Retrieve security groups
mac := c.awsClient.GetPrimaryENImac()
if c.enableIPv4 && !c.disableENIProvisioning {
err = c.awsClient.RefreshSGIDs(mac)
if err != nil {
Expand All @@ -458,6 +452,11 @@ func New(rawK8SClient client.Client, cachedK8SClient client.Client) (*IPAMContex
go wait.Forever(func() { _ = c.awsClient.RefreshSGIDs(mac) }, 30*time.Second)
}

err = c.nodeInit()
if err != nil {
return nil, err
}

return c, nil
}

Expand Down

0 comments on commit 30be8da

Please sign in to comment.