style: remove unused utils (#3830) #3833
Merged
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.
(cherry picked from commit 1557b7d)
Signed-off-by: cuisongliu cuisongliu@qq.com
🤖 Generated by Copilot at 923aa6f
Summary
🛠️📄🚀
This pull request simplifies and refactors the code of several packages in the sealos project. It uses more generic and consistent functions for manipulating slices, maps, and YAML files, and avoids unnecessary type conversions and dependencies. It also improves the readability, performance, and safety of some conditions and assignments. The main packages affected are
apply
,env
,guest
,image
,bootstrap
, andchecker
. The main files changed arego.mod
,pkg/apply/applydrivers/apply_drivers_default.go
,pkg/apply/processor/create.go
,pkg/apply/processor/interface.go
,pkg/apply/run.go
,pkg/apply/scale.go
,pkg/apply/utils.go
,pkg/env/env.go
,pkg/guest/guest.go
,pkg/image/merge.go
,pkg/apply/gen.go
,pkg/apply/processor/delete.go
,pkg/apply/processor/install.go
,pkg/apply/processor/scale.go
,pkg/apply/reset.go
,pkg/bootstrap/context.go
,pkg/checker/crictl_checker.go
,pkg/clusterfile/util.go
, andpkg/runtime/k3s/bootstrap.go
.Walkthrough
go.mod
file for the golang.org/x/exp package and remove a redundant dependency (link, link)IsRootFs
method of the image object instead of comparing the image type with a string constant in theNewClusterFromGenArgs
function of thepkg/apply/gen.go
file (link)GetAllLabels
method of the cluster object instead of theGetImageLabels
method in theNewContextFrom
function of thepkg/bootstrap/context.go
file (link)CheckAndInitialize
function of thepkg/apply/utils.go
file (link)deleteNodes
function of thepkg/apply/scale.go
file (link)Check
function of thepkg/checker/crictl_checker.go
file (link)Check
function of thepkg/checker/crictl_checker.go
file (link)