Skip to content

Commit

Permalink
CRI: Add daemon configuration to StatusResponse as extra information
Browse files Browse the repository at this point in the history
StatusResponse in CRI returns runtime extra information which is in
the map of Info. Now there is only one key in this map. This patch
add "daemon-config" as another key and its value is the daemon
configuration in json format. With this patch, for example, we can
get pouch root dir from StatusResponse.

Signed-off-by: Wang Rui <baijia.wr@antfin.com>
  • Loading branch information
zjumoon01 authored and allencloud committed Dec 20, 2018
1 parent b680418 commit 48e0733
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cri/v1alpha2/cri.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ type CriManager struct {

// imageFSPath is the path to image filesystem.
imageFSPath string

// DaemonConfig is the config of daemon
DaemonConfig *config.Config
}

// NewCriManager creates a brand new cri manager.
Expand Down Expand Up @@ -160,6 +163,7 @@ func NewCriManager(config *config.Config, ctrMgr mgr.ContainerMgr, imgMgr mgr.Im
SandboxBaseDir: path.Join(config.HomeDir, "sandboxes"),
SandboxImage: config.CriConfig.SandboxImage,
SnapshotStore: mgr.NewSnapshotStore(),
DaemonConfig: config,
}
c.CniMgr, err = cni.NewCniManager(&config.CriConfig)
if err != nil {
Expand Down Expand Up @@ -1254,7 +1258,12 @@ func (c *CriManager) Status(ctx context.Context, r *runtime.StatusRequest) (*run
if err != nil {
return nil, err
}
configByt, err := json.Marshal(c.DaemonConfig)
if err != nil {
return nil, err
}
resp.Info["golang"] = string(versionByt)
resp.Info["daemon-config"] = string(configByt)

// TODO return more info
}
Expand Down

0 comments on commit 48e0733

Please sign in to comment.