string value = 2;
}
+message ConfPath {
+ string netDir = 1;
+ string netConf = 2;
+}
+
message CNImsg {
- CmdType cmd = 1;
- string containerID = 2;
- string netNS = 3;
- string ifName = 4;
- repeated CNIargs args = 5;
- string stdIn = 6;
+ ConfPath configPath = 1;
+ string binPath = 8;
+ CmdType cmd = 2;
+ string containerID = 3;
+ string netNS = 4;
+ string ifName = 5;
+ repeated CNIargs args = 6;
+ string stdIn = 7;
}
message CNIresult {
// CNIop generates result to a CNImsg
func (s *CNIServer) CNIop(ctx context.Context, in *CNImsg) (*CNIresult, error) {
- log.Printf("Receive message Cmd: %s", in.Cmd)
+
+ confPath := in.ConfigPath
+
+ log.Printf("Receive message NetDir: %s", confPath.NetDir)
+ log.Printf("Receive message NetConf: %s", confPath.NetConf)
+
log.Printf("Receive message ContainerID: %s", in.ContainerID)
log.Printf("Receive message NetNS: %s", in.NetNS)
log.Printf("Receive message IfName: %s", in.IfName)
// CNI Test
cni := api.NewCNIserverClient(conn)
+ ///
+ cniPath := api.ConfPath {
+ NetDir: "/home/mcambria/go/src/github.com/containernetworking",
+ NetConf: "firewall-mcc1-range-chain",
+ }
+ //
+
cniMsg := api.CNImsg{
+ //ConfigPath: {
+ //NetDir: "/home/mcambria/go/src/github.com/containernetworking",
+ //NetConf: "firewall-mcc1-range-chain",
+ //},
+ ConfigPath: &cniPath,
Cmd: api.CmdType_ADD,
ContainerID: "containerOne",
NetNS: "mcc-test-0",
// Setup the client gRPC options
opts := []grpc.DialOption{grpc.WithTransportCredentials(creds)}
- // Register ping
- //err = api.RegisterPingHandlerFromEndpoint(ctx, mux, grpcAddress, opts)
+ // Register CNIserver
err = api.RegisterCNIserverHandlerFromEndpoint(ctx, mux, grpcAddress, opts)
if err != nil {
return fmt.Errorf("could not register service CNI: %s", err)