fix: set nopull param from args (#1830)

This commit is contained in:
nils måsén 2023-11-11 14:50:43 +01:00 committed by GitHub
parent 7fb04d0411
commit 48539c4faf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 17 deletions

View file

@ -33,6 +33,7 @@ var (
scheduleSpec string
cleanup bool
noRestart bool
noPull bool
monitorOnly bool
enableLabel bool
disableContainers []string
@ -110,7 +111,7 @@ func PreRun(cmd *cobra.Command, _ []string) {
log.Fatal(err)
}
noPull, _ := f.GetBool("no-pull")
noPull, _ = f.GetBool("no-pull")
includeStopped, _ := f.GetBool("include-stopped")
includeRestarting, _ := f.GetBool("include-restarting")
reviveStopped, _ := f.GetBool("revive-stopped")
@ -122,7 +123,6 @@ func PreRun(cmd *cobra.Command, _ []string) {
}
client = container.NewClient(container.ClientOptions{
PullImages: !noPull,
IncludeStopped: includeStopped,
ReviveStopped: reviveStopped,
RemoveVolumes: removeVolumes,
@ -187,7 +187,7 @@ func Run(c *cobra.Command, names []string) {
metrics.RegisterScan(metric)
}, updateLock)
httpAPI.RegisterFunc(updateHandler.Path, updateHandler.Handle)
// If polling isn't enabled the scheduler is never started and
// If polling isn't enabled the scheduler is never started, and
// we need to trigger the startup messages manually.
if !unblockHTTPAPI {
writeStartupMessage(c, time.Time{}, filterDesc)
@ -367,6 +367,7 @@ func runUpdatesWithNotifications(filter t.Filter) *metrics.Metric {
LifecycleHooks: lifecycleHooks,
RollingRestart: rollingRestart,
LabelPrecedence: labelPrecedence,
NoPull: noPull,
}
result, err := actions.Update(client, updateParams)
if err != nil {