Skip to content

Commit

Permalink
fix: trunk quantity cal
Browse files Browse the repository at this point in the history
some instance has member eni , but trunk is not supported

Signed-off-by: l1b0k <[email protected]>
  • Loading branch information
l1b0k committed Jan 10, 2025
1 parent dc4dfba commit da2be26
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/controller/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ func (r *ReconcileNode) patchNodeRes(ctx context.Context, k8sNode *corev1.Node,
})

if found {
members := node.Spec.NodeCap.TotalAdapters - node.Spec.NodeCap.Adapters
members := node.Spec.NodeCap.MemberAdapterLimit

// report rse only trunk eni is ready
num = resource.NewQuantity(int64(members), resource.DecimalSI)
Expand Down
2 changes: 1 addition & 1 deletion pkg/eni/node_reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func (r *nodeReconcile) Reconcile(ctx context.Context, request reconcile.Request

if eniConfig.EnableENITrunking {
node.Spec.ENISpec.EnableTrunk = true
if node.Spec.NodeCap.TotalAdapters-node.Spec.NodeCap.Adapters <= 0 {
if node.Spec.NodeCap.MemberAdapterLimit <= 0 {
node.Spec.ENISpec.EnableTrunk = false
l.Info("instance is not support trunk")
}
Expand Down

0 comments on commit da2be26

Please sign in to comment.