Browse Source

Log CNI_ARGS and CNI_NETNS in kuryr-cni

Currently we only print "Calling Kuryr Daemon." in our kuryr-cni plugin
binary. This isn't really helpful:

crio[1963]: 2020/03/03 20:53:49 Calling Kuryr Daemon.
crio[1963]: 2020/03/03 20:53:53 Calling Kuryr Daemon.
crio[1963]: 2020/03/03 20:53:53 Calling Kuryr Daemon.
crio[1963]: 2020/03/03 20:53:53 Calling Kuryr Daemon.
crio[1963]: 2020/03/03 20:53:54 Calling Kuryr Daemon.
crio[1963]: 2020/03/03 20:53:54 Calling Kuryr Daemon.
crio[1963]: 2020/03/03 20:53:54 Calling Kuryr Daemon.
(…)

This commit enhances that logging to include values of CNI_ARGS and
CNI_NETNS, which should allow us to identify which request is being
handled.

Change-Id: Ie66e4972cc109990d0f4fc077fa9031ac67db7ff
Related-Bug: 1854928
tags/2.0.0.0rc1
Michał Dulko 4 months ago
parent
commit
da1e0aa2ee
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      kuryr_cni/main.go

+ 1
- 1
kuryr_cni/main.go View File

@@ -55,7 +55,7 @@ func transformData(args *skel.CmdArgs, command string) (KuryrDaemonData, error)
}

func makeDaemonRequest(data KuryrDaemonData, expectedCode int) ([]byte, error) {
log.Print("Calling Kuryr Daemon.")
log.Printf("Calling kuryr-daemon with %s request (CNI_ARGS=%s, CNI_NETNS=%s).", data.Command, data.Args, data.Netns)

b, err := json.Marshal(data)
if err != nil {


Loading…
Cancel
Save