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 #4232

Merged
merged 1 commit into from
Nov 2, 2023

Conversation

sealos-ci-robot
Copy link
Member

@sealos-ci-robot sealos-ci-robot commented Nov 2, 2023

🤖 Generated by Copilot at 268682b

Summary

🆕♻️🎨

This pull request adds a feature to render templates with environment variables in the buildah create command, and refactors the env, strings, and filesystem packages to use a common function for this task. It also introduces a new constant for the template suffix in the constants package. These changes improve the usability, consistency, and maintainability of the code.

TemplateSuffix set
render with env package
autumn of hard-codes

Walkthrough

  • Add and refactor functionality for rendering templates with environment variables in the buildah, env, and strings packages (link, link, link, link, link, link, link, link, link, link, link, link, link)
  • Add a new field env to the createOptions type and a new flag --env to the buildah create command to allow specifying environment variables for template files (link, link)
  • Add a new function runRender to the buildah package that concurrently renders templates with environment variables in each mount point using the strings package (link)
  • Call the runRender function from the create function if the env field is not empty (link, link)
  • Add a new constant TemplateSuffix to the constants package to avoid hard-coding the template suffix value (link)
  • Refactor the RenderAll function in the env package to use the strings package instead of the template package for rendering templates with environment variables (link, link, link)
  • Refactor the renderTemplatesWithEnv function in the filesystem package to use the RenderAll function from the env package instead of looping over the directories and calling the filepath.Walk function (link)
  • Add a new function RenderTemplatesWithEnv to the strings package that renders templates with environment variables in the subdirectories of a file path using the template package (link, link)
  • Add a blank line to separate the conditional block from the rest of the code in the create function for readability (link)
  • Modify the imports in the buildah, env, and strings packages to reflect the dependencies needed for the new and refactored functionality (link, link, link)

Automated changes by create-pull-request GitHub action

…ate rendering (#4222)

* feature: environment variable based template rendering in sealos create

* add: goimports tools

* update: goimports tools

* update: goimports tools

* fix golangci lint error

* remove docs

* remove docs

* fix: refactor template rendering logic, abstract common func

* fix ci
@cuisongliu cuisongliu added this to the v4.3 milestone Nov 2, 2023
Copy link

sweep-ai bot commented Nov 2, 2023

Apply Sweep Rules to your PR?

  • Apply: Leftover TODOs in the code should be handled.
  • Apply: All new business logic should have corresponding unit tests in the tests/ directory.
  • Apply: Any clearly inefficient or repeated code should be optimized or refactored.

@cuisongliu cuisongliu merged commit e332192 into release-v4.4 Nov 2, 2023
22 of 23 checks passed
@cuisongliu cuisongliu deleted the cherry-pick-release-v4.4-4222 branch November 2, 2023 15:46
@sealos-ci-robot
Copy link
Member Author

/cherry-pick release-v4.3

@sealos-ci-robot
Copy link
Member Author

🤖 says: Error cherry-picking.

Auto-merging pkg/constants/contants.go
Auto-merging pkg/env/env.go
CONFLICT (content): Merge conflict in pkg/env/env.go
Auto-merging pkg/filesystem/rootfs/rootfs_default.go
CONFLICT (content): Merge conflict in pkg/filesystem/rootfs/rootfs_default.go
Auto-merging pkg/utils/strings/strings.go
CONFLICT (content): Merge conflict in pkg/utils/strings/strings.go
error: could not apply e332192... feature: sealos create support for environment variable based template rendering (#4222) (#4232)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

@sealos-ci-robot
Copy link
Member Author

🤖 says: ‼️ cherry pick action failed.
See: https://github.com/labring/sealos/actions/runs/6734978931

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.

3 participants