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

docs: Automated CherryPick Update for release-v4.4 #3874

Merged
merged 1 commit into from Sep 8, 2023

Conversation

sealos-ci-robot
Copy link
Member

@sealos-ci-robot sealos-ci-robot commented Sep 8, 2023

πŸ€– Generated by Copilot at e37aa85

Summary

πŸŽ¨πŸ›πŸ› οΈ

This pull request adds a new render subcommand to sealctl that can render template files with values and environment variables, using the helm library and the template package. It also simplifies and improves the code for the initsystem subcommand, and fixes some bugs and redundancies in the rootfs, file, and yaml packages.

sealctl render /
Templates with helm and data /
Autumn leaves change rootfs

Walkthrough

  • Add a new render subcommand to sealctl that renders template files with values and environment variables (link)
  • Refactor the initsystem subcommands to use a helper function that reduces code duplication and creates a consistent format (link, link)
  • Replace the "path" package with the "path/filepath" package in the rootfs and template packages, which is more appropriate for manipulating file paths on the local system (link, link, link)
  • Remove the redundant getClusterName method from the defaultRootfs struct and access the cluster name directly from the cluster object (link, link)
  • Add a comment to the mountRootfs function, indicating that the rendering of the templates on the client side is not yet generally available, and that it will replace the current rendering on the server side in the future (link)
  • Add the "strings" package to the cmd package, which is used to manipulate string values for the initsystem subcommands (link)
  • Add two more packages to the rootfs package: "github.com/labring/sealos/pkg/utils/maps" and "github.com/labring/sealos/pkg/utils/strings", which provide some utility functions for working with maps and strings (link)
  • Add the "k8s.io/apimachinery/pkg/util/sets" package to the file package, which is used to create a set of extensions for the FindFilesMatchExtension function (link)
  • Add the FindFilesMatchExtension function to the file package, which takes a base path and one or more extensions, and returns a slice of file paths that match the extensions (link)
  • Add the getRenderCommand function to the rootfs package, which takes the path to the sealctl binary and the target directory, and returns a shell command that invokes the sealctl render subcommand with the appropriate paths to the template directories (link)
  • Modify the mountRootfs function to call the getRenderCommand function and execute the command on the remote server, before copying the files to the server, for both the rootfs and the application files (link, link)
  • Fix a bug in the unmarshalStrict function in the yaml package, where the wrong error variable was returned (link)

Automated changes by create-pull-request GitHub action

…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
@cuisongliu cuisongliu merged commit 96b4f2d into release-v4.4 Sep 8, 2023
23 of 25 checks passed
@cuisongliu cuisongliu deleted the cherry-pick-release-v4.4-3872 branch September 8, 2023 10:42
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