simple WIP example
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
61b81742d3
commit
7988580154
1 changed files with 26 additions and 0 deletions
26
main_example.go
Normal file
26
main_example.go
Normal file
|
@ -0,0 +1,26 @@
|
|||
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)
|
||||
}
|
Loading…
Reference in a new issue