We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
What happened:
The following error occurs after the resource model is enabled
I try to locate it,searchLastLessElement return '-1'
searchLastLessElement
func searchLastLessElement(nums []resource.Quantity, target resource.Quantity) int { low, high := 0, len(nums)-1 for low <= high { mid := low + ((high - low) >> 1) diff1 := nums[mid].Cmp(target) var diff2 int if mid != len(nums)-1 { diff2 = nums[mid+1].Cmp(target) } // diff < 1 means nums[mid] <= target // diff == 1 means nums[mid+1] > target if diff1 < 1 { if (mid == len(nums)-1) || (diff2 == 1) { // find the last less element that equal to target element return mid } low = mid + 1 } else { high = mid - 1 } } return -1 }
Get the slice object according to index '-1', thus panic
// AddToResourceSummary add resource node into modeling summary func (rs *ResourceSummary) AddToResourceSummary(crn ClusterResourceNode) { index := rs.getIndex(crn) modeling := &(*rs)[index] if rs.GetNodeNumFromModel(modeling) <= 5 { root := modeling.linkedlist if root == nil { root = list.New() } found := false // traverse linkedlist to add quantity of recourse modeling for element := root.Front(); element != nil; element = element.Next() { switch clusterResourceNodeComparator(element.Value, crn) { case 0: { tmpCrn := element.Value.(ClusterResourceNode) safeChangeNum(&tmpCrn.quantity, crn.quantity) element.Value = tmpCrn found = true break } case 1: { root.InsertBefore(crn, element) found = true break } case -1: { continue } } if found { break } } if !found { root.PushBack(crn) } modeling.linkedlist = root } else { root := modeling.redblackTree if root == nil { root = llConvertToRbt(modeling.linkedlist) modeling.linkedlist = nil } tmpNode := root.GetNode(crn) if tmpNode != nil { node := tmpNode.Key.(ClusterResourceNode) safeChangeNum(&node.quantity, crn.quantity) tmpNode.Key = node } else { root.Put(crn, crn.quantity) } modeling.redblackTree = root } safeChangeNum(&modeling.Quantity, crn.quantity) }
What you expected to happen:
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
Environment:
kubectl-karmada version
karmadactl version
The text was updated successfully, but these errors were encountered:
Which version are you using? We just fixed a panic issue at #3591 yesterday.
Sorry, something went wrong.
@RainbowMango I installed it last week. we did not update the local branch. I will try again after updating
Why closed this?
No branches or pull requests
What happened:
The following error occurs after the resource model is enabled
I try to locate it,
searchLastLessElement
return '-1'Get the slice object according to index '-1', thus panic
What you expected to happen:
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
Environment:
kubectl-karmada version
orkarmadactl version
):The text was updated successfully, but these errors were encountered: