26 lines
527 B
Go
26 lines
527 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
"git.thisco.de/vbatts/cri"
|
|
"github.com/sirupsen/logrus"
|
|
pb "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
|
|
)
|
|
|
|
func main() {
|
|
conn, err := cri.GetClientConn("/var/run/crio.sock", time.Minute*15)
|
|
if err != nil {
|
|
logrus.Fatal(err)
|
|
}
|
|
ctx, cancel := context.WithTimeout(context.Background(), 50*time.Millisecond)
|
|
defer cancel()
|
|
|
|
imageClient := cri.NewImageServiceClient(conn)
|
|
_ = imageClient
|
|
_ = ctx
|
|
|
|
req := &pb.PullImageRequest{}
|
|
imageClient.PullImage(ctx, req)
|
|
}
|