feat:template develop dryrun deploy #3778
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
π€ Generated by Copilot at 69b732a
Summary
ππ οΈπ
This pull request adds a new feature to the frontend of the sealos template provider, which allows users to perform dry run deployments of their templates. It modifies the
applyApp
API endpoint, thepostDeployApp
function, thekubernetes.ts
service, and theDevelop
andBreadCrumbHeader
components to support this feature. It also adds the corresponding button text to thecommon.json
files for the English and Chinese locales. Additionally, it fixes some minor formatting and UI issues in theForm
andEditApp
components.Walkthrough
frontend/providers/template/src/api/app.ts
to indicate the mode of deployment ('create', 'replace', or 'dryrun') (link)frontend/providers/template/public/locales/en/common.json
to pass the mode of deployment to the backend service (link)frontend/providers/template/src/services/backend/kubernetes.ts
, which handles the actual deployment logic (link)frontend/providers/template/src/services/backend/kubernetes.ts
, which calls the CreateYaml function with the 'All' value for the dryRun parameter if the type is 'dryrun' (link, link)frontend/providers/template/src/services/backend/kubernetes.ts
, which can be either 'All' or undefined, and pass it to the client.create method, which handles the actual API call to the cluster (link, link)frontend/providers/template/src/pages/develop/components/BreadCrumbHeader.tsx
, which is a callback function for the dryrun deploy feature (link)frontend/providers/template/src/pages/develop/components/BreadCrumbHeader.tsx
, with the text "Dryrun Deploy" and the applyCb prop function as the onClick handler (link)frontend/providers/template/src/pages/develop/index.tsx
, which are used for the dryrun deploy feature and the error handling logic (link)frontend/providers/template/src/pages/develop/index.tsx
, and pass them to the formHook.handleSubmit method as callbacks (link)frontend/providers/template/src/pages/develop/index.tsx
, to trigger the dryrun deploy feature when the button is clicked (link)frontend/providers/template/src/pages/develop/index.tsx
, to show the loading state and the error message when the dryrun deploy feature is executed (link)frontend/providers/template/src/pages/develop/components/Form.tsx
, which is a minor UI change that prevents the input from automatically getting focus when the form is rendered (link)frontend/providers/template/src/pages/develop/index.tsx
, which is a minor code simplification as the component is already the default export function (link)