/** * Asserts that all dependent resources are included in the snapshot. All EDS resources are listed by name in CDS * resources, and all RDS resources are listed by name in LDS resources. * * <p>Note that clusters and listeners are requested without name references, so Envoy will accept the snapshot list * of clusters as-is, even if it does not match all references found in xDS. * * @throws SnapshotConsistencyException if the snapshot is not consistent */ public void ensureConsistent() throws SnapshotConsistencyException { Set<String> clusterEndpointRefs = Resources.getResourceReferences(clusters().resources().values()); ensureAllResourceNamesExist(CLUSTER_TYPE_URL, ENDPOINT_TYPE_URL, clusterEndpointRefs, endpoints().resources()); Set<String> listenerRouteRefs = Resources.getResourceReferences(listeners().resources().values()); ensureAllResourceNamesExist(LISTENER_TYPE_URL, ROUTE_TYPE_URL, listenerRouteRefs, routes().resources()); }