Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Commit

Permalink
binaries: skip useless downloads (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienBalestra authored Jul 24, 2018
1 parent fd84411 commit 3ef8976
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/setup/binary_containerd.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
"os/exec"

"github.com/golang/glog"

"github.com/DataDog/pupernetes/pkg/config"
)

func (e *Environment) extractContainerd() error {
Expand All @@ -32,6 +34,10 @@ func (e *Environment) extractContainerd() error {
}

func (e *Environment) setupBinaryContainerd() error {
if e.containerRuntimeInterface != config.CRIContainerd {
glog.V(2).Infof("Skipping the download of containerd: using %q", e.containerRuntimeInterface)
return nil
}
_, err := os.Stat(e.binaryContainerd.binaryABSPath)
if err == nil && e.binaryContainerd.isUpToDate() {
glog.V(4).Infof("Containerd already setup and up to date: %s", e.binaryContainerd.binaryABSPath)
Expand Down
6 changes: 6 additions & 0 deletions pkg/setup/binary_runc.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
"os/exec"

"github.com/golang/glog"

"github.com/DataDog/pupernetes/pkg/config"
)

func (e *Environment) extractRunc() error {
Expand All @@ -37,6 +39,10 @@ func (e *Environment) extractRunc() error {
}

func (e *Environment) setupBinaryRunc() error {
if e.containerRuntimeInterface != config.CRIContainerd {
glog.V(2).Infof("Skipping the download of runc: using %q", e.containerRuntimeInterface)
return nil
}
_, err := os.Stat(e.binaryRunc.binaryABSPath)
if err == nil && e.binaryRunc.isUpToDate() {
glog.V(4).Infof("Runc already setup and up to date: %s", e.binaryRunc.binaryABSPath)
Expand Down

0 comments on commit 3ef8976

Please sign in to comment.