Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added a create resource function in Kube Panel #4282

Closed
wants to merge 0 commits into from
Closed

feat: Added a create resource function in Kube Panel #4282

wants to merge 0 commits into from

Conversation

Wishrem
Copy link
Contributor

@Wishrem Wishrem commented Nov 9, 2023

πŸ€– Generated by Copilot at 5988350

Summary

πŸ“„πŸš€πŸ› οΈ

This pull request adds and improves the functionality of creating Kubernetes resources from YAML data in the kubepanel plugin. It adds new frontend and backend modules for making and handling API requests, new YAML templates for different resource types, and new UI components for editing and displaying YAML data. It also refactors some existing code for better quality and consistency, and reorganizes the file structure for clarity.

We create and destroy with the power of YAML
We unleash the beasts of Kubernetes
We refactor and reorganize with the force of TypeScript
We edit and validate with the light of Monaco

Walkthrough

  • Add @monaco-editor/react dependency to use the Monaco code editor for YAML files in the frontend (link)
  • Update antd dependency to the latest version for the UI library (link)
  • Add fs dependency to read YAML templates from the public folder in the backend (link)
  • Add YAML templates for creating ConfigMap, Deployment, PersistentVolumeClaim, Pod, and StatefulSet resources in Kubernetes (link, link, link, link, link)
  • Add frontend service modules for making API requests to create resources and get templates (link, link)
  • Add backend API handlers for creating resources and getting templates, and validate the input parameters and the YAML data (link, link)
  • Add a constant object that maps the resource types to their Kubernetes kind names (link)
  • Refactor the backend API service module to use a common type definition for the Kubernetes API URL parameters and to abstract the logic of generating the URL and making the request (link, link, link, link, link, link, link, link)
  • Reorganize the file structure and group the components related to different Kubernetes resources under the kube-object folder (link, link, link, link, link, link)
  • Replace the Input.TextArea component with the Editor component from @monaco-editor/react to display and edit the YAML data of the ConfigMap resource (link)

Copy link

Whoa! Easy there, Partner!

This PR is too big. Please break it up into smaller PRs.

@sealos-ci-robot
Copy link
Member

sealos-ci-robot commented Nov 9, 2023

πŸ€– Generated by lychee action

Summary

Status Count
πŸ” Total 994
βœ… Successful 321
⏳ Timeouts 0
πŸ”€ Redirected 0
πŸ‘» Excluded 672
❓ Unknown 0
🚫 Errors 0

Full action output

Full Github Actions output

Copy link

sweep-ai bot commented Nov 9, 2023

Apply Sweep Rules to your PR?

  • Apply: All new business logic should have corresponding unit tests.
  • Apply: Refactor large functions to be more modular.

Copy link

codecov bot commented Nov 9, 2023

Codecov Report

All modified and coverable lines are covered by tests βœ…

πŸ“’ Thoughts on this report? Let us know!

@bxy4543 bxy4543 added this to the v5.0 milestone Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants