Skip to content

Commit

Permalink
Use defaultQueueName in utils.GetQueueNameFromPod
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyulin0719 committed Sep 16, 2023
1 parent b08d5cd commit 26dc731
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions pkg/admission/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,13 @@ func getAnnotationsForApplicationInfoUpdate(pod *v1.Pod, namespace string, gener
}
}

queueName := utils.GetQueueNameFromPod(pod, "")
if queueName == "" {
// if defaultQueueName is "", skip adding default queue name to the pod labels
if defaultQueueName != "" {
// for undefined configuration, am_conf will add 'root.default' to retain existing behavior
// if a custom name is configured for default queue, it will be used instead of root.default
queueName = defaultQueueName
}
}
// for undefined configuration, am_conf will add 'root.default' as default queue name
// if a custom name is configured for default queue, it will be used instead of root.default
queueName := utils.GetQueueNameFromPod(pod, defaultQueueName)

// if queue name was not in pod annotations, add it to annotations.
if value := utils.GetPodAnnotationValue(pod, constants.AnnotationQueueName); value == "" {
// if defaultQueueName is "", skip adding default queue name to the pod annotation
if queueName != "" {
result[constants.AnnotationQueueName] = queueName
}
Expand Down

0 comments on commit 26dc731

Please sign in to comment.