Skip to content

Commit

Permalink
fix error output
Browse files Browse the repository at this point in the history
  • Loading branch information
googs1025 committed Aug 4, 2024
1 parent 9f3220a commit f711b2a
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 f711b2a

Please sign in to comment.