From b87c0d74a5722fec32ecb3a450fd4a2bbfd919cf Mon Sep 17 00:00:00 2001 From: Mike Brown Date: Wed, 5 Jun 2019 16:39:45 -0500 Subject: [PATCH] adds cni config data to the cri status/info Signed-off-by: Mike Brown --- pkg/server/status.go | 6 ++++++ pkg/store/sandbox/metadata.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/server/status.go b/pkg/server/status.go index f71b78196..d79055c48 100644 --- a/pkg/server/status.go +++ b/pkg/server/status.go @@ -72,6 +72,12 @@ func (c *criService) Status(ctx context.Context, r *runtime.StatusRequest) (*run return nil, err } resp.Info["golang"] = string(versionByt) + + cniConfig, err := json.Marshal(c.netPlugin.GetConfig()) + if err != nil { + logrus.WithError(err).Errorf("Failed to marshal CNI config %v", err) + } + resp.Info["cniconfig"] = string(cniConfig) } return resp, nil } diff --git a/pkg/store/sandbox/metadata.go b/pkg/store/sandbox/metadata.go index 3cf46c8d8..343236bc5 100644 --- a/pkg/store/sandbox/metadata.go +++ b/pkg/store/sandbox/metadata.go @@ -57,7 +57,7 @@ type Metadata struct { IP string // RuntimeHandler is the runtime handler name of the pod. RuntimeHandler string - // CNI result + // CNIresult resulting configuration for attached network namespace interfaces CNIResult *cni.CNIResult }