Skip to content

Commit

Permalink
fix review.
Browse files Browse the repository at this point in the history
  • Loading branch information
juliens committed Mar 4, 2019
1 parent 1895eec commit 5be9021
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions pkg/agent/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ func get(envInfo *cmds.Agent) (*config.Node, error) {
ContainerRuntimeEndpoint: envInfo.ContainerRuntimeEndpoint,
}
nodeConfig.LocalAddress = localAddress(controlConfig)
nodeConfig.Images = "/var/lib/rancher/k3s/agent/images"
nodeConfig.AgentConfig.NodeIP = nodeIP
nodeConfig.AgentConfig.NodeName = nodeName
nodeConfig.AgentConfig.ClusterDNS = controlConfig.ClusterDNS
Expand Down
5 changes: 2 additions & 3 deletions pkg/agent/containerd/containerd.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package containerd

import (
"bytes"
"context"
"fmt"
"github.com/containerd/containerd"
Expand Down Expand Up @@ -148,13 +147,13 @@ func Run(ctx context.Context, cfg *config.Node) error {
for _, fileInfo := range fileInfos {
if !fileInfo.IsDir() {
filePath := filepath.Join(imageDir, fileInfo.Name())
fileContent, err := ioutil.ReadFile(filePath)
file, err := os.Open(filePath)
if err != nil {
logrus.Errorf("Unable to read %s: %v", filePath, err)
continue
}
logrus.Debugf("Import %s", filePath)
_, err = client.Import(ctxContainerD, bytes.NewReader(fileContent))
_, err = client.Import(ctxContainerD, file)
if err != nil {
logrus.Errorf("Unable to import %s: %v", filePath, err)
}
Expand Down
1 change: 1 addition & 0 deletions pkg/daemons/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type Node struct {
FlannelConf string
LocalAddress string
Containerd Containerd
Images string
AgentConfig Agent
CACerts []byte
ServerAddress string
Expand Down

0 comments on commit 5be9021

Please sign in to comment.