Skip to content

Add resource form create feature and CreateResourceForm#5044

Open
vyncent-t wants to merge 1 commit intokubernetes-sigs:mainfrom
vyncent-t:resource-create-edit-form
Open

Add resource form create feature and CreateResourceForm#5044
vyncent-t wants to merge 1 commit intokubernetes-sigs:mainfrom
vyncent-t:resource-create-edit-form

Conversation

@vyncent-t
Copy link
Copy Markdown
Contributor

@vyncent-t vyncent-t commented Apr 3, 2026

Summary

This PR introduces a form-based UI for creating Kubernetes resources, starting with Pods. Users can now create resources through a guided form accessible from both the sidebar "Create" button and the per-resource "Create Pod" button on the Pod list page, in addition to the existing YAML editor workflow.

Changes

  • Added CreateResourceForm, reusable section-based base form template with titled sections and configurable fields
  • Added CreatePodForm, extends the base form with Pod-specific fields organized into Metadata (name, namespace, labels) and Containers (container name, image, node name) sections
  • Updated CreateButton (sidebar), added a "Create Form" toolbar button that opens a resource type picker modal, then the corresponding form (currently Pod)
  • Updated CreateResourceButton (resource page), added a "Create Form" toolbar button that opens the Pod form directly
  • Refactored both button components to use inner Activity content components (CreateActivityContent, CreateResourceActivityContent) so the form and editor share live React state
  • Form applies merge into existing editor YAML, the form parses the current editor content, updates only form-managed fields, and preserves any extra fields the user added manually

Steps to Test

  1. Navigate to the Pod list page
  2. Click the "Create Pod" (+) button in the header
  3. The YAML editor activity opens with the Pod base template
  4. Click "Create Form" in the editor toolbar
  5. Fill in Name, Namespace, Container Name, and Image fields
  6. Click "Apply" and notice the editor YAML updates in-place with the form values, preserving other fields (ports, imagePullPolicy, etc.)
  7. Click "Save & Apply" to create the Pod
  8. Repeat from the sidebar "Create" button (click "Create Form", select "Pod" from the resource picker, fill the form, and verify the same behavior)

Screenshots (if applicable)

Create resource page and create form

image image

Side button create form

image

@vyncent-t vyncent-t self-assigned this Apr 3, 2026
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 3, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: vyncent-t
Once this PR has been reviewed and has the lgtm label, please assign yolossn 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 requested review from ashu8912 and sniok April 3, 2026 17:43
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 3, 2026
@vyncent-t vyncent-t force-pushed the resource-create-edit-form branch from 9be373c to bf51106 Compare April 7, 2026 19:08
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 7, 2026
@vyncent-t vyncent-t force-pushed the resource-create-edit-form branch 4 times, most recently from 8e442e4 to f04e5d6 Compare April 7, 2026 19:51
@vyncent-t vyncent-t requested a review from illume April 7, 2026 19:52
@vyncent-t vyncent-t marked this pull request as ready for review April 7, 2026 19:52
@vyncent-t vyncent-t changed the title WIP Add resource form create feature and CreateResourceForm Add resource form create feature and CreateResourceForm Apr 7, 2026
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 7, 2026
@vyncent-t vyncent-t force-pushed the resource-create-edit-form branch from f04e5d6 to 3b93048 Compare April 7, 2026 20:00
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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants