Lines
100 %
Functions
#include "source/extensions/retry/host/omit_host_metadata/omit_host_metadata.h"
#include "source/common/config/metadata.h"
namespace Envoy {
namespace Extensions {
namespace Retry {
namespace Host {
bool OmitHostsRetryPredicate::shouldSelectAnotherHost(const Upstream::Host& host) {
// Note: The additional check to verify if the labelSet is empty is performed since
// metadataLabelMatch returns true in case of an empty labelSet. However, for an empty labelSet,
// i.e. if there is no matching criteria defined, this method should return false.
return !label_set_.empty() && Envoy::Config::Metadata::metadataLabelMatch(
label_set_, host.metadata().get(),
Envoy::Config::MetadataFilters::get().ENVOY_LB, true);
}
} // namespace Host
} // namespace Retry
} // namespace Extensions
} // namespace Envoy