-
Notifications
You must be signed in to change notification settings - Fork 24
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
CLI | Change Vorpal vorpal-latest-version flag flow (AST-48376) #797
Changes from 3 commits
cc66bcf
6ee08ca
034f7fb
860b53c
74f7e5a
2409eed
df83b5f
689e6dc
13a79d2
bfeb804
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -44,7 +44,7 @@ func CreateVorpalScanRequest(vorpalParams VorpalScanParams, wrapperParams Vorpal | |||||
return nil, err | ||||||
} | ||||||
|
||||||
err = manageVorpalInstallation(vorpalParams, wrapperParams.VorpalWrapper) | ||||||
err = manageVorpalInstallation(vorpalParams, wrapperParams.VorpalWrapper, wrapperParams) | ||||||
if err != nil { | ||||||
return nil, err | ||||||
} | ||||||
|
@@ -93,16 +93,22 @@ func executeScan(vorpalWrapper grpcs.VorpalWrapper, filePath string) (*grpcs.Sca | |||||
return vorpalWrapper.Scan(fileName, sourceCode) | ||||||
} | ||||||
|
||||||
func manageVorpalInstallation(vorpalParams VorpalScanParams, vorpalWrapper grpcs.VorpalWrapper) error { | ||||||
func manageVorpalInstallation(vorpalParams VorpalScanParams, vorpalWrapper grpcs.VorpalWrapper, vorpalWrappers VorpalWrappersParam) error { | ||||||
vorpalInstalled, _ := osinstaller.FileExists(vorpalconfig.Params.ExecutableFilePath()) | ||||||
|
||||||
if vorpalParams.VorpalUpdateVersion || !vorpalInstalled { | ||||||
if err := vorpalWrapper.HealthCheck(); err == nil { | ||||||
_ = vorpalWrapper.ShutDown() | ||||||
if !vorpalInstalled || vorpalParams.VorpalUpdateVersion { | ||||||
if err := checkLicense(vorpalParams.IsDefaultAgent, vorpalWrappers); err != nil { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think Or told us to shut down the service here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we need to check here for helth check before shutting down. or the shut down check that there sis engine alive bofre>? |
||||||
return err | ||||||
} | ||||||
if err := osinstaller.InstallOrUpgrade(&vorpalconfig.Params); err != nil { | ||||||
newInstallation, err := osinstaller.InstallOrUpgrade(&vorpalconfig.Params) | ||||||
if err != nil { | ||||||
return err | ||||||
} | ||||||
if newInstallation && vorpalParams.VorpalUpdateVersion { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
in a situation we check together that I removed the executable file- we also want to shut down the service |
||||||
if err := vorpalWrapper.HealthCheck(); err == nil { | ||||||
_ = vorpalWrapper.ShutDown() | ||||||
} | ||||||
} | ||||||
} | ||||||
return nil | ||||||
} | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to add an alias to the bool? like - bool doesInstalltion