Skip to content

What about extract hashName to a separate package #578

@Okabe-Rintarou-0

Description

@Okabe-Rintarou-0

Please provide an in-depth description of the question you have:
Now hashName is in workload controller:

// HashName converts a string to a uint32 integer as the key of bpf map
type HashName struct {
numToStr map[uint32]string
strToNum map[string]uint32
}
func NewHashName() *HashName {
hashName := &HashName{
strToNum: make(map[string]uint32),
}
// if read failed, initialize with an empty map
if err := hashName.readFromPersistFile(); err != nil {
hashName.numToStr = make(map[uint32]string)
} else {
hashName.numToStr = make(map[uint32]string, len(hashName.strToNum))
for str, num := range hashName.strToNum {
hashName.numToStr[num] = str
}
}
return hashName
}

In my pr for circuitbreaker #570 , I may need to map cluster name to cluster id to meet the requirement of ebpf stack size limit.
image

What do you think about this question?:

Environment:

  • Kmesh version:
  • Others:

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions