Skip to content

frontend: EditorDialog : Add dry run option in editor for server side validation#5010

Open
Vikaspal8923 wants to merge 1 commit intokubernetes-sigs:mainfrom
Vikaspal8923:add_dry_run_option
Open

frontend: EditorDialog : Add dry run option in editor for server side validation#5010
Vikaspal8923 wants to merge 1 commit intokubernetes-sigs:mainfrom
Vikaspal8923:add_dry_run_option

Conversation

@Vikaspal8923
Copy link
Copy Markdown

Summary

This PR adds server-side Dry Run support to the shared YAML editor so users can validate manifests against the Kubernetes API before applying them.

Related Issue

Fixes #5000

Changes

  • Added optional dryRun support to frontend/src/lib/k8s/api/v1/apply.ts
  • Updated the shared YAML editor in frontend/src/components/common/Resource/EditorDialog.tsx to show a Dry Run action between close and Apply / Save & Apply
  • Reused the existing apply flow for server-side validation by sending requests with dryRun=All
  • Kept normal apply behavior unchanged while ensuring Dry Run does not create or update resources
  • Added a small UI tweak so the Dry Run button text does not wrap when long error messages are shown

Steps to Test

  1. Open the shared YAML editor from a create flow or by editing an existing resource.
  2. Modify the YAML and introduce an invalid field or value.
  3. Click Dry Run.
  4. Confirm the request is validated by the API server and an error is shown in the editor.
  5. Confirm the resource is not created or updated after Dry Run.
  6. Fix the YAML and click Dry Run again to confirm validation passes.
  7. Click Apply / Save & Apply and confirm normal apply behavior still works.

Screenshots (if applicable)

Screencast.from.2026-03-30.21-47-09.webm

Notes for the Reviewer

  • Dry Run uses Kubernetes server-side validation through the existing apply path with the dryRun=All query option.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 30, 2026
@k8s-ci-robot k8s-ci-robot requested review from illume and sniok March 30, 2026 16:53
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Vikaspal8923
Once this PR has been reviewed and has the lgtm label, please assign sniok for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Frontend: Add Server-Side Dry Run Option To YAML Editor`

2 participants