diff --git a/pkg/webhooks/pod_admission_webhook.go b/pkg/webhooks/pod_admission_webhook.go index f04bca400..746916d7c 100644 --- a/pkg/webhooks/pod_admission_webhook.go +++ b/pkg/webhooks/pod_admission_webhook.go @@ -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) diff --git a/pkg/webhooks/pod_mutating_webhook.go b/pkg/webhooks/pod_mutating_webhook.go index e6bbb95f3..f6c73f4af 100644 --- a/pkg/webhooks/pod_mutating_webhook.go +++ b/pkg/webhooks/pod_mutating_webhook.go @@ -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 }