Skip to content

Commit 24d34bf

Browse files
swordqiuQiu Jian
andauthored
fix: disable ping to hostlocal network (#22361)
Co-authored-by: Qiu Jian <[email protected]>
1 parent d83b5bb commit 24d34bf

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

pkg/cloudmon/misc/pinger.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,21 @@ func PingProbe(ctx context.Context, userCred mcclient.TokenCredential, isStart b
4949
networks := []api.NetworkDetails{}
5050
for {
5151
params := map[string]interface{}{
52-
"offset": len(networks),
53-
"limit": "10",
54-
"cloud_env": api.CLOUD_ENV_ON_PREMISE,
52+
"offset": len(networks),
53+
"limit": "10",
54+
"provider": []string{
55+
api.CLOUD_PROVIDER_ONECLOUD,
56+
},
5557
"scope": rbacscope.ScopeSystem,
5658
"is_classic": true,
59+
"server_type": []string{
60+
string(api.NETWORK_TYPE_GUEST),
61+
string(api.NETWORK_TYPE_BAREMETAL),
62+
string(api.NETWORK_TYPE_CONTAINER),
63+
string(api.NETWORK_TYPE_PXE),
64+
string(api.NETWORK_TYPE_IPMI),
65+
string(api.NETWORK_TYPE_EIP),
66+
},
5767
}
5868
resp, err := compute.Networks.List(s, jsonutils.Marshal(params))
5969
if err != nil {

0 commit comments

Comments
 (0)