diff --git a/pkg/plugins/policies/meshhealthcheck/plugin/v1alpha1/plugin.go b/pkg/plugins/policies/meshhealthcheck/plugin/v1alpha1/plugin.go index 202a15eacec5..5b3e77091772 100644 --- a/pkg/plugins/policies/meshhealthcheck/plugin/v1alpha1/plugin.go +++ b/pkg/plugins/policies/meshhealthcheck/plugin/v1alpha1/plugin.go @@ -109,7 +109,13 @@ func applyToGateways( } func toProtocol(p mesh_proto.MeshGateway_Listener_Protocol) core_mesh.Protocol { - return core_mesh.ParseProtocol(p.String()) + switch p { + case mesh_proto.MeshGateway_Listener_HTTP, mesh_proto.MeshGateway_Listener_HTTPS: + return core_mesh.ProtocolHTTP + case mesh_proto.MeshGateway_Listener_TCP, mesh_proto.MeshGateway_Listener_TLS: + return core_mesh.ProtocolTCP + } + return core_mesh.ProtocolTCP } func configure(