Kuadrant/kuadrant-console-plugin

DNSPolicy ProviderRefs Empty String Bypass

オープン

#468 opened on 2026/05/19

 (1 件のコメント) (0 件のリアクション) (1 人の担当者)TypeScript (63 件のフォーク)auto 404
buggood first issuetriage/accepted

Repository metrics

Stars
 (10 個のスター)
PR merge metrics
 (PR metrics pending)

説明

Describe the bug The DNSPolicy creation form allows submission of an invalid providerRefs array containing an empty string. This occurs when a user types a value into the "Provider Refs" input field and subsequently clears it. The frontend form validation only checks if the array length is greater than 0, bypassing the required field validation and generating an invalid Kubernetes resource. To Reproduce

  1. Go to 'Kuadrant -> Policies -> DNS' in the OpenShift Console.
  2. Click on 'Create DNS Policy'.
  3. Scroll down to the 'Provider Refs' input field.
  4. Type any character (e.g., 'aws') into the input field.
  5. Delete the text so the input field is completely empty.
  6. Fill in the remaining required fields (Policy Name, Target Gateway).
  7. Notice that the 'Create' button remains enabled. Click it and see the K8s API validation error.

Expected behavior The form validation should detect that the providerRefs name is an empty string and correctly disable the 'Create' button.

Additional context In KuadrantDNSPolicyCreatePage.tsx, the onChange handler wraps the cleared input into an array [{ name: "" }]. The form validation expression providerRefs.length > 0 evaluates to true because the array has a length of 1, ignoring the fact that the actual name value is an empty string.

コントリビューターガイド