-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
feature: sealos create
support for environment variable based template rendering
#4222
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sealos-ci-robot
added
kind/documentation
area/buildah
abount buildah sdk
area/cloud
area/lifecycle-management
labels
Nov 1, 2023
🤖 Generated by lychee actionSummary
Full action output |
Apply Sweep Rules to your PR?
|
📘 Preview documentation website |
Codecov ReportAll modified and coverable lines are covered by tests ✅
📢 Thoughts on this report? Let us know!. |
cuisongliu
reviewed
Nov 1, 2023
cuisongliu
approved these changes
Nov 2, 2023
/cherry-pick release-v4.4 |
🤖 says: cherry pick action finished successfully 🎉! |
sealos-ci-robot
pushed a commit
that referenced
this pull request
Nov 2, 2023
…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
pushed a commit
that referenced
this pull request
Nov 2, 2023
…ate rendering (#4222) (#4232) * 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 Co-authored-by: Zihan Li <eden.zh.li@outlook.com>
This was referenced Nov 2, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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 4a8d504
Summary
📝🆕🎨
This pull request adds a new feature to the
sealos create
command that enables users to customize the cluster image with environment variables. It updates thepkg/buildah
package to handle the rendering of template files with the given variables. It also updates the English and Chinese documentation of the command to explain and demonstrate the new option-e
.Walkthrough
-e, --env=[]
to thesealos create
command that allows users to specify environment variables for template rendering (link, link, link, link)sealos create
command in the documentation to include the-e
option and explain its usage (link, link)context
,file
, anderrgroup
packages inpkg/buildah/create.go
to handle concurrent tasks and file operations (link, link)create
function inpkg/buildah/create.go
that calls therunRender
function if theenv
field is not empty (link)runRender
inpkg/buildah/create.go
that uses theerrgroup
package to run multiple goroutines that render the template files in the cluster image with thetemplate
package (link)RenderTemplatesWithEnv
inpkg/buildah/util.go
that renders the template files in theetc
,scripts
, andmanifests
subdirectories of a given file path with thetemplate
package and the environment variables (link)pkg/buildah/util.go
file that are used by theRenderTemplatesWithEnv
function (link)refer to #3774
Supporting documentation:
https://sealos.io/docs/self-hosting/lifecycle-management/operations/build-image/build-image-go_template
https://sealos.io/docs/self-hosting/lifecycle-management/advanced-guide/template-function
https://sealos.io/docs/self-hosting/lifecycle-management/reference/sealos/app-cluster-image