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

Improve app bundle integrity check #40

Merged
merged 2 commits into from
Dec 11, 2024

Conversation

mike-sul
Copy link
Collaborator

@mike-sul mike-sul commented Dec 9, 2024

  • 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.

@mike-sul mike-sul force-pushed the improve-app-bundle-integrity-check branch 2 times, most recently from e60b5c7 to 2758a61 Compare December 10, 2024 12:34
@mike-sul mike-sul force-pushed the improve-app-bundle-integrity-check branch 2 times, most recently from da50870 to 9b6de58 Compare December 11, 2024 09:09
@mike-sul mike-sul marked this pull request as ready for review December 11, 2024 09:10
@mike-sul mike-sul requested a review from detsch December 11, 2024 09:13
@mike-sul mike-sul force-pushed the improve-app-bundle-integrity-check branch from 9b6de58 to baf6b22 Compare December 11, 2024 10:42
@@ -63,7 +67,7 @@ func init() {

var psCmd = &cobra.Command{
Use: "ps",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Use: "ps",
Use: "ps [ref]...",

Copy link
Collaborator Author

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).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -63,7 +67,7 @@ func init() {

var psCmd = &cobra.Command{
Use: "ps",
Short: "ps <ref> [<ref>]",
Short: "ps [<ref> [<ref>]]",
Copy link
Member

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

Suggested change
Short: "ps [<ref> [<ref>]]",
Short: "ps [ref]...",

Copy link
Collaborator Author

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")
Copy link
Member

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.

Copy link
Collaborator Author

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.

@mike-sul mike-sul force-pushed the improve-app-bundle-integrity-check branch from baf6b22 to d718c7c Compare December 11, 2024 13:40
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]>
@mike-sul mike-sul force-pushed the improve-app-bundle-integrity-check branch from d718c7c to ec4dcc1 Compare December 11, 2024 14:20
@mike-sul mike-sul merged commit 363ff36 into main Dec 11, 2024
1 check passed
@mike-sul mike-sul deleted the improve-app-bundle-integrity-check branch December 11, 2024 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants