Skip to content

Commit f15a117

Browse files
committed
Add windows publisher
Signed-off-by: Michael Crosby <[email protected]>
1 parent d3e0c16 commit f15a117

1 file changed

Lines changed: 5 additions & 14 deletions

File tree

runtime/v2/shim/shim_windows.go

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,17 @@
1919
package shim
2020

2121
import (
22+
"bytes"
2223
"context"
2324
"net"
2425
"os"
26+
"os/exec"
2527

2628
winio "github.com/Microsoft/go-winio"
2729
"github.com/containerd/containerd/events"
30+
"github.com/containerd/containerd/namespaces"
2831
"github.com/containerd/ttrpc"
32+
"github.com/containerd/typeurl"
2933
"github.com/pkg/errors"
3034
"github.com/sirupsen/logrus"
3135
)
@@ -68,7 +72,6 @@ func handleSignals(logger *logrus.Entry, signals chan os.Signal) error {
6872
}
6973

7074
func (l *remoteEventsPublisher) Publish(ctx context.Context, topic string, event events.Event) error {
71-
/* TOOD: JTERRY75: Implement publish for windows
7275
ns, _ := namespaces.Namespace(ctx)
7376
encoded, err := typeurl.MarshalAny(event)
7477
if err != nil {
@@ -80,17 +83,5 @@ func (l *remoteEventsPublisher) Publish(ctx context.Context, topic string, event
8083
}
8184
cmd := exec.CommandContext(ctx, l.containerdBinaryPath, "--address", l.address, "publish", "--topic", topic, "--namespace", ns)
8285
cmd.Stdin = bytes.NewReader(data)
83-
c, err := Default.Start(cmd)
84-
if err != nil {
85-
return err
86-
}
87-
status, err := Default.Wait(cmd, c)
88-
if err != nil {
89-
return err
90-
}
91-
if status != 0 {
92-
return errors.New("failed to publish event")
93-
}
94-
*/
95-
return nil
86+
return cmd.Run()
9687
}

0 commit comments

Comments
 (0)