-
Notifications
You must be signed in to change notification settings - Fork 1
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
Improve app bundle integrity check #40
Conversation
mike-sul
commented
Dec 9, 2024
•
edited
Loading
edited
- Unify and simplify implementation of the app installation verification.
- Optionally, check whether an app is installed as part of the command verifying if an app is running.
e60b5c7
to
2758a61
Compare
Signed-off-by: Mike Sul <[email protected]>
da50870
to
9b6de58
Compare
9b6de58
to
baf6b22
Compare
cmd/composectl/cmd/ps.go
Outdated
@@ -63,7 +67,7 @@ func init() { | |||
|
|||
var psCmd = &cobra.Command{ | |||
Use: "ps", |
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.
Use: "ps", | |
Use: "ps [ref]...", |
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.
OK. However, I think I should fix the "Use" and "Short" for the overall composectl
since they are not used correctly (another PR).
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.
Done.
cmd/composectl/cmd/ps.go
Outdated
@@ -63,7 +67,7 @@ func init() { | |||
|
|||
var psCmd = &cobra.Command{ | |||
Use: "ps", | |||
Short: "ps <ref> [<ref>]", | |||
Short: "ps [<ref> [<ref>]]", |
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.
This is a more standard way to document this kind of parameter, where 0..N refs
can be passed
Short: "ps [<ref> [<ref>]]", | |
Short: "ps [ref]...", |
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.
Updated.
} | ||
) | ||
|
||
func init() { | ||
opts := psOptions{} | ||
psCmd.Flags().StringVar(&opts.Format, "format", "table", "Format the output. Values: [table | json]") | ||
psCmd.Flags().BoolVar(&opts.CheckInstall, "install", true, "Also check if app is installed") |
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.
I find --install
confusing as it might give the idea that something will be installed.
I would rather use --check-installation
, unless it is too long.
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.
I think it is too long. I read it as do "ps --install" command that checks running apps along with their installation. Also, it is in sync what we already have for "check" command.
baf6b22
to
d718c7c
Compare
Use the same function to check whether app in installed for both the "check" and "ps" commands. This check includes: 1. Verification if all app images are present in the docker store. 2. Verification if an app bundle is properly installed in the compose/project directory (all bundle files present and their hashes match the expected hashes). Also, a new flag "--install" was added to the "ps" command to turn on/off the installation check after checking if app is running. By default this check is enabled. Signed-off-by: Mike Sul <[email protected]>
d718c7c
to
ec4dcc1
Compare