Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Move new app initialization out of main#178

Merged
tomoyamachi merged 1 commit intogoodwithtech:masterfrom
lior-orca:master
May 19, 2022
Merged

Move new app initialization out of main#178
tomoyamachi merged 1 commit intogoodwithtech:masterfrom
lior-orca:master

Conversation

@lior-orca
Copy link
Contributor

In order to use 'Dockle' programmatically, the app initialization logic cannot be placed in the main package.

The commit simply transitions the relevant logic out of the main package.

@lior-orca
Copy link
Contributor Author

@tomoyamachi can you please have a look?

@tomoyamachi
Copy link
Collaborator

@lior-orca Apologize for the delayed response.
It is a better way to stop using github.com/urfave/cli.Context in pkg directories if you want to use 'Dockle' programmatically.

# Current: 
func Run(c *cli.Context) (err error) {

# After
struct RunParams {
  ImageName string // Target container image name/path
  Ignores []string // DOCKLE_IGNORES
  ...
}
func Run(p *RunParams) (err error) {

func Run(c *cli.Context) (err error) {

How do you think about it?

@lior-orca
Copy link
Contributor Author

@tomoyamachi I think it will be over-engineering since any new command-line option will need to be added to in both places (the new struct and in the cli.Context definition)

I tried to have something similar to trivy

Let me know what you think

@lior-orca
Copy link
Contributor Author

@tomoyamachi see my above replay

@lior-orca
Copy link
Contributor Author

@tomoyamachi one more try.
What do we do with the PR? if you want to change anything, go ahead :)

@tomoyamachi tomoyamachi merged commit b9072c9 into goodwithtech:master May 19, 2022
@tomoyamachi
Copy link
Collaborator

@lior-orca Apologize for the delayed response. I merged it.

@lior-orca
Copy link
Contributor Author

@tomoyamachi thanks!
If you can create a new 0.4.6 tag/release it will be very helpful

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