-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Starting a refactoring around RunContext and Docker local/remote Api #2497
Starting a refactoring around RunContext and Docker local/remote Api #2497
Conversation
18b418d
to
d83eec8
Compare
Codecov Report
|
// NewAPIClient guesses the docker client to use based on current kubernetes context. | ||
func NewAPIClient(forceRemove bool, insecureRegistries map[string]bool) (LocalDaemon, error) { | ||
// NewAPIClientImpl guesses the docker client to use based on current kubernetes context. | ||
func NewAPIClientImpl(runCtx *runcontext.RunContext) (LocalDaemon, error) { |
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.
wdyt about having a dockerCLIContext
or something that contains just the necessary fields for this constructor? then that can live inside the runcontext and we can just pass that in here.
type DockerCLIContext struct {
insecureRegistries map[string]bool
prune bool
}
type RunContext struct {
dockerCLIContext *DockerCLIContext
...
}
func NewAPIClientImpl(cliContext *docker.DockerCLIContext) (LocalDaemon, error) {
...
}
cli, err := docker.NewAPIClient(runctx.DockerCLIContext)
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.
Yeah, I could try that
@@ -197,11 +191,13 @@ func getDeployer(runCtx *runcontext.RunContext) (deploy.Deployer, error) { | |||
} | |||
} | |||
|
|||
func getTagger(t latest.TagPolicy, customTag string) (tag.Tagger, error) { | |||
func getTagger(runCtx *runcontext.RunContext) (tag.Tagger, error) { |
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.
so is the end goal here just to make everything consistent? maybe I'm mistaken but I thought that you wanted to move away from the runcontext in these constructors. just trying to understand
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.
:-) For now, I'm aiming at consistency.
774b787
to
7cb0410
Compare
Signed-off-by: David Gageot <[email protected]>
Signed-off-by: David Gageot <[email protected]>
Signed-off-by: David Gageot <[email protected]>
Once those options are set by command line flags, they are immutable. Signed-off-by: David Gageot <[email protected]>
Signed-off-by: David Gageot <[email protected]>
Signed-off-by: David Gageot <[email protected]>
Signed-off-by: David Gageot <[email protected]>
Signed-off-by: David Gageot <[email protected]>
7cb0410
to
916c7d9
Compare
@nkubala could you take another look? That would be awesome because this one is a bit painful to rebase. |
My goals are:
This is just the beginning of the refactoring but already improves a bit the codebase