File tree Expand file tree Collapse file tree 2 files changed +13
-14
lines changed
Expand file tree Collapse file tree 2 files changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ func (c *InitContext) Start() error {
8989 return util .WaitBindPID (ctx , c .Logger , c .BindPID )
9090 })
9191
92- wsl .Check (& c .InitOpt )
92+ wsl .CheckEnv (& c .InitOpt )
9393
9494 select {
9595 case <- ctx .Done ():
Original file line number Diff line number Diff line change 2424 _isFeatureEnabled bool
2525)
2626
27- func Check (opt * types.InitOpt ) {
27+ func CheckEnv (opt * types.InitOpt ) {
2828 log := opt .Logger
2929
3030 if isEnabled := isFeatureEnabled (log ); ! isEnabled {
@@ -36,21 +36,20 @@ func Check(opt *types.InitOpt) {
3636
3737 log .Info ("WSL2 feature is already enabled" )
3838
39- shouldUpdate , err := shouldUpdateWSL (log )
40- if err == nil && ! shouldUpdate {
41- log .Info ( "WSL2 is up to date" )
42- channel . NotifyWSLEnvReady ()
43- return
44- }
39+ if shouldUpdate , err := shouldUpdateWSL (log ); shouldUpdate {
40+ if err != nil {
41+ log .Warnf ( "Failed to check if WSL2 needs to be updated: %v" , err )
42+ } else {
43+ log . Info ( "WSL2 needs to be updated" )
44+ }
4545
46- if err != nil {
47- log .Warnf ("Failed to check if WSL2 needs to be updated: %v" , err )
48- } else {
49- log .Info ("WSL2 needs to be updated" )
46+ event .NotifyInit (event .NeedUpdateWSL )
47+ opt .CanUpdateWSL = true
48+ return
5049 }
5150
52- event . NotifyInit ( event . NeedUpdateWSL )
53- opt . CanUpdateWSL = true
51+ log . Info ( "WSL2 is up to date" )
52+ channel . NotifyWSLEnvReady ()
5453 return
5554}
5655
You can’t perform that action at this time.
0 commit comments