mirror of
https://github.com/kubernetes-sigs/kind.git
synced 2025-12-01 07:26:05 +07:00
quiet output
This commit is contained in:
@@ -295,13 +295,17 @@ func (c *buildContext) prePullImages(bits kube.Bits, dir, containerID string) ([
|
||||
image := image // https://golang.org/doc/faq#closures_and_goroutines
|
||||
fns = append(fns, func() error {
|
||||
if !builtImages.Has(image) {
|
||||
err := importer.Pull(image, dockerBuildOsAndArch(c.arch))
|
||||
if err != nil {
|
||||
c.logger.Warnf("Failed to pull %s with error: %v", image, err)
|
||||
runE := exec.RunErrorForError(err)
|
||||
c.logger.Warn(string(runE.Output))
|
||||
}
|
||||
// TODO(bentheelder): generate a friendlier name
|
||||
/*
|
||||
TODO: show errors when we have real errors. See comments in
|
||||
importer implementation
|
||||
err := importer.Pull(image, dockerBuildOsAndArch(c.arch))
|
||||
if err != nil {
|
||||
c.logger.Warnf("Failed to pull %s with error: %v", image, err)
|
||||
runE := exec.RunErrorForError(err)
|
||||
c.logger.Warn(string(runE.Output))
|
||||
}
|
||||
*/
|
||||
_ = importer.Pull(image, dockerBuildOsAndArch(c.arch))
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
@@ -17,6 +17,8 @@ limitations under the License.
|
||||
package nodeimage
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
|
||||
"sigs.k8s.io/kind/pkg/exec"
|
||||
)
|
||||
|
||||
@@ -45,9 +47,11 @@ func (c *containerdImporter) End() error {
|
||||
}
|
||||
|
||||
func (c *containerdImporter) Pull(image, platform string) error {
|
||||
// TODO: this should exist with a --no-unpack and some way to operate quietly
|
||||
// without discarding output
|
||||
return c.containerCmder.Command(
|
||||
"ctr", "--namespace=k8s.io", "images", "pull", "--platform="+platform, image,
|
||||
).Run()
|
||||
).SetStdout(ioutil.Discard).SetStderr(ioutil.Discard).Run()
|
||||
}
|
||||
|
||||
func (c *containerdImporter) LoadCommand() exec.Cmd {
|
||||
|
||||
Reference in New Issue
Block a user