go1.22 and up now produce a unique variable in loops, tehrefore no longer
requiring to capture the variable manually;
service/logs/parse_logs_test.go:50:3: The copy of the 'for' variable "tc" can be deleted (Go 1.22+) (copyloopvar)
tc := tc
^
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The command to run inside the container is `/etc`. The semicolon is a
statement terminator, which ends the command `docker run busybox /etc`,
while `echo $?` prints the exit code of that full docker command.
Having this mistake could confuse someone who thinks that `/etc; echo
$?` is all run inside the container, which wouldn't help the reader
understand the exit code of the `docker run` command itself.
Signed-off-by: Noah Silas <noah@hustle.com>
This change reduces the flickering of the terminal when
running `docker stats` by buffering the formatted stats
text and printing it in one write.
Should also consume less CPU as we now only have to issue
a single syscall to write the stats text to the terminal.
Signed-off-by: Giedrius Jonikas <giedriusj1@gmail.com>
Also updating a linter that was deprecated;
The linter 'exportloopref' is deprecated (since v1.60.2) due to: Since Go1.22 (loopvar) this linter is no longer relevant. Replaced by copyloopvar.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
remove a client-side warning about volume drivers combined with "mounts"
in favor of producing the warning on the daemon side.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The docker inspect command did not inspect configs. This patch adds support for
it, and while at it, also sorts the list of objects in runInspect.
Before this patch:
docker config create myconfig ./codecov.yml
danpeyh8qzb30vgdj9fr665l1
docker inspect --format='{{.ID}}' myconfig
[]
Error: No such object: myconfig
docker inspect --format='{{.ID}}' --type=config myconfig
"config" is not a valid value for --type
With this patch:
docker inspect --format='{{.ID}}' myconfig
danpeyh8qzb30vgdj9fr665l1
docker inspect --format='{{.ID}}' --type=config myconfig
danpeyh8qzb30vgdj9fr665l1
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This function was names slightly confusing, as it returns a fakeStore,
and it didn't do any constructing, so didn't provide value above just
constructing the type.
I'm planning to add more functionality to the fakeStore, but don't want
to maintain a full-fledged constructor for all of that, so let's remove
this utility.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The Errors type was deprecated in d3bafa5f3e,
which has been included in the 27.4.0 release.
This patch removes the type, as there are no external consumers.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The format had a stray colon and space included. While fixing that, also
updating the error message to clarify the error happened while parsing
the file (not so much "loading" it).
Before:
WARNING: Error loading config file: /root/.docker/config.json: : json: cannot unmarshal bool into Go struct field ConfigFile.features of type string
After:
WARNING: Error parsing config file (/root/.docker/config.json): json: cannot unmarshal bool into Go struct field ConfigFile.features of type string
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>