MCPcopy
hub / github.com/dragonflyoss/dragonfly / calculateNormalHostCountFromScheduler

Function calculateNormalHostCountFromScheduler

test/e2e/host_test.go:108–121  ·  view source on GitHub ↗
(schedulerClient schedulerclient.V2)

Source from the content-addressed store, hash-verified

106})
107
108func calculateNormalHostCountFromScheduler(schedulerClient schedulerclient.V2) (hostCount int) {
109 resp, err := schedulerClient.ListHosts(context.Background(), "", &schedulerv2.ListHostsRequest{})
110 fmt.Println(resp, err)
111 Expect(err).NotTo(HaveOccurred())
112
113 for _, host := range resp.Hosts {
114 hostType := types.HostType(host.Type)
115 if hostType == types.HostTypeNormal {
116 hostCount++
117 }
118 }
119
120 return
121}

Callers 1

host_test.goFile · 0.85

Calls 3

HostTypeTypeAlias · 0.92
PrintlnMethod · 0.80
ListHostsMethod · 0.65

Tested by

no test coverage detected