Skip to content

Commit

Permalink
Include created interface in CNI result
Browse files Browse the repository at this point in the history
  • Loading branch information
caseydavenport committed Sep 13, 2018
1 parent ce723b7 commit 2707fe2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions calico.go
Expand Up @@ -316,6 +316,11 @@ func cmdAdd(args *skel.CmdArgs) error {
}

logger.WithField("endpoint", endpoint).Info("Wrote endpoint to datastore")

// Add the interface created above to the CNI result.
result.Interfaces = append(result.Interfaces, &current.Interface{
Name: endpoint.Spec.InterfaceName, Sandbox: endpoint.Spec.Endpoint},
)
}

// Handle profile creation - this is only done if there isn't a specific policy handler.
Expand Down
5 changes: 5 additions & 0 deletions k8s/k8s.go
Expand Up @@ -371,6 +371,11 @@ func CmdAddK8s(ctx context.Context, args *skel.CmdArgs, conf types.NetConf, epID
}
logger.Info("Wrote updated endpoint to datastore")

// Add the interface created above to the CNI result.
result.Interfaces = append(result.Interfaces, &current.Interface{
Name: endpoint.Spec.InterfaceName, Sandbox: endpoint.Spec.Endpoint},
)

return result, nil
}

Expand Down

0 comments on commit 2707fe2

Please sign in to comment.