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: support rendering template files on target host with sealctl #3872

Merged
merged 5 commits into from Sep 8, 2023

Conversation

fengxsong
Copy link
Collaborator

@fengxsong fengxsong commented Sep 8, 2023

🤖 Generated by Copilot at 7dff684

Summary

🎨🐛📁

This pull request improves the code quality and functionality of the sealos project. It simplifies the creation of init system subcommands, updates the rootfs package to use the filepath package and the sealctl render command, adds a new file matching function to the file package, implements a new render command for sealctl, removes an unused function from the template package, and fixes a bug in the yaml package.

sealctl render command
adds template power to cmd
autumn leaves fall fast

Walkthrough

  • Add a new render command for sealctl that renders template files with values and envs (link)
  • Refactor the init system commands to use a helper function that reduces code duplication and improves readability (link, link, link)
  • Execute the sealctl render command on the remote nodes after copying the files to the target directories in the rootfs package (link, link, link)
  • Remove the unused and redundant ParseFiles function from the template package (link)
  • Fix a bug in the unmarshalStrict function in the yaml package that returns the wrong error variable (link)
  • Replace the path package with the filepath package in the rootfs and file packages, which is more appropriate for manipulating file paths across different operating systems (link, link, link)
  • Remove the unnecessary getClusterName function from the defaultRootfs struct (link)
  • Rename the variable clusterName to pathResolver in the rootfs package, which is more descriptive of its role as a path resolver for the cluster (link)
  • Add a TODO comment to remove the loop over the mounts when rendering on the client side is GA in the rootfs package, which indicates a future improvement plan (link)
  • Add the FindFilesMatchExtension function to the file package, which returns a slice of file paths that match the extensions (link)

@sealos-ci-robot
Copy link
Member

sealos-ci-robot commented Sep 8, 2023

🤖 Generated by lychee action

Summary

Status Count
🔍 Total 932
✅ Successful 392
⏳ Timeouts 0
🔀 Redirected 0
👻 Excluded 539
❓ Unknown 0
🚫 Errors 0

Full action output

Full Github Actions output

@cuisongliu cuisongliu added this to the v4.4 milestone Sep 8, 2023
@codecov
Copy link

codecov bot commented Sep 8, 2023

Codecov Report

Patch has no changes to coverable lines.

📢 Thoughts on this report? Let us know!.

@cuisongliu cuisongliu merged commit 4f06cba into labring:main Sep 8, 2023
80 checks passed
@sealos-ci-robot
Copy link
Member

/cherry-pick release-v4.4

@sealos-ci-robot
Copy link
Member

🤖 says: cherry pick action finished successfully 🎉!
See: https://github.com/labring/sealos/actions/runs/6120751789

sealos-ci-robot pushed a commit that referenced this pull request Sep 8, 2023
…3872)

* fix: return reader.Read error if not nil

* refactor: the initsystem commands

* feat: add render template subcommand for sealctl

* feat: support rendering template files on target host with sealctl

* fix: merge envs from rootfs and render shell with it
@fengxsong fengxsong deleted the sealctl_render branch September 8, 2023 10:42
cuisongliu pushed a commit that referenced this pull request Sep 8, 2023
…3872) (#3874)

* fix: return reader.Read error if not nil

* refactor: the initsystem commands

* feat: add render template subcommand for sealctl

* feat: support rendering template files on target host with sealctl

* fix: merge envs from rootfs and render shell with it

Co-authored-by: fengxsong <fengxsong@outlook.com>
bxy4543 pushed a commit to bxy4543/sealos that referenced this pull request Oct 13, 2023
…abring#3872)

* fix: return reader.Read error if not nil

* refactor: the initsystem commands

* feat: add render template subcommand for sealctl

* feat: support rendering template files on target host with sealctl

* fix: merge envs from rootfs and render shell with it
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.

None yet

3 participants