Skip to content

Commit

Permalink
Merge pull request #636 from googs1025/fix_topology_log
Browse files Browse the repository at this point in the history
fix error output
  • Loading branch information
k8s-ci-robot authored Aug 5, 2024
2 parents 8cefed5 + f711b2a commit 8ab9738
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/webhooks/pod_admission_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (p *podWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (ad
return nil, fmt.Errorf("follower pod node selector not set")
}
if _, exists := pod.Spec.NodeSelector[topologyKey]; !exists {
return nil, fmt.Errorf("follower pod node selector not set")
return nil, fmt.Errorf("follower pod node selector for topology domain not found. missing selector: %s", topologyKey)
}
// For follower pods, validate leader pod exists and is scheduled.
leaderScheduled, err := p.leaderPodScheduled(ctx, pod)
Expand Down
2 changes: 1 addition & 1 deletion pkg/webhooks/pod_mutating_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func (p *podWebhook) topologyFromPod(ctx context.Context, pod *corev1.Pod, topol
// Get topology (e.g. node pool name) from node labels.
topology, exists := node.Labels[topologyKey]
if !exists {
return "", fmt.Errorf("node does not have topology label: %s", topology)
return "", fmt.Errorf("node does not have topology label: %s", topologyKey)
}
return topology, nil
}

0 comments on commit 8ab9738

Please sign in to comment.