MCPcopy
hub / github.com/baetyl/baetyl / initExecKubeAMI

Function initExecKubeAMI

ami/kube/kube_exec_test.go:69–84  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

67}
68
69func initExecKubeAMI(t *testing.T) *kubeImpl {
70 fc := fake.NewSimpleClientset(genExecRuntime()...)
71 cli := client{
72 core: fc.CoreV1(),
73 app: fc.AppsV1(),
74 }
75 f, err := os.CreateTemp("", t.Name())
76 assert.NoError(t, err)
77 assert.NotNil(t, f)
78 fmt.Println("-->tempfile", f.Name())
79 sto, err := store.NewBoltHold(f.Name())
80 assert.NoError(t, err)
81 assert.NotNil(t, sto)
82 ami.Hooks[BaetylSetPodSpec] = SetPodSpecFunc(SetPodSpec)
83 return &kubeImpl{cli: &cli, store: sto, knn: "node1", log: log.With()}
84}
85
86func TestUpdateNodeLabels(t *testing.T) {
87 am := initExecKubeAMI(t)

Callers 2

TestUpdateNodeLabelsFunction · 0.85
TestWebsocketFunction · 0.85

Calls 3

NewBoltHoldFunction · 0.92
genExecRuntimeFunction · 0.85
SetPodSpecFuncFuncType · 0.85

Tested by

no test coverage detected