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

πŸ› fix env merge for sealos run #4144

Merged
merged 1 commit into from Oct 23, 2023

Conversation

cuisongliu
Copy link
Collaborator

@cuisongliu cuisongliu commented Oct 23, 2023

πŸ€– Generated by Copilot at 7fe5f62

Summary

πŸ”§πŸŒπŸ–ΌοΈ

Refactored the clusterfile and guest packages to use interfaces and variable merging for environment variables. This improves the code quality and flexibility for managing cluster nodes and images.

We're refactoring the code, me hearties, yo ho ho
We're making it more flexible and testable, don't you know
We're renaming and merging env vars for the image commands
We're heaving on the clusterfile package on the count of three

Walkthrough

  • Refactor Process function in pkg/clusterfile/pre_process.go to use EnvGetter interface instead of setting environment variables directly (link, link)
  • Change NewGuestManager function in pkg/guest/guest.go to accept an EnvGetter parameter instead of a map of environment variables (link)
  • Use maps.MergeMap function to merge image-specific and cluster-wide environment variables in pkg/guest/guest.go before executing image commands (link, link)

Signed-off-by: cuisongliu <cuisongliu@qq.com>
@sweep-ai
Copy link

sweep-ai bot commented Oct 23, 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.

@codecov
Copy link

codecov bot commented Oct 23, 2023

Codecov Report

All modified and coverable lines are covered by tests βœ…

πŸ“’ Thoughts on this report? Let us know!.

@cuisongliu cuisongliu merged commit 311213a into labring:release-v4.3 Oct 23, 2023
71 checks passed
@cuisongliu cuisongliu deleted the release-v4.3-fix-env branch October 23, 2023 07:38
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