def_stream(self, filename, binary_mode=False, create=True) -> t.Optional[t.TextIO]: # use append to open file mode = "ab"if binary_mode else"a" # generate key due to mode and filename key = f"{mode}@{filename}" if key notinself.stream_map orself.stream_map[key] isNone: ifnot create: returnNone encoding = Noneif"b"in mode else"utf8" self.stream_map[key] = open(filename, mode, encoding=encoding) returnself.stream_map[key]
defappend(self, filename, file_content, binary_mode=False): compatify = compat.as_bytes if binary_mode else compat.as_text # reuse fd to write instead of duplicated open and close self._stream(filename, binary_mode).write(compatify(file_content))
// Snapshot is an internally consistent snapshot of xDS resources. // Consistently is important for the convergence as different resource types // from the snapshot may be delivered to the proxy in arbitrary order. type EnvoySnapshot struct { // Endpoints are items in the EDS V3 response payload. Endpoints cache.Resources
// Clusters are items in the CDS response payload. Clusters cache.Resources
// Routes are items in the RDS response payload. Routes cache.Resources
// Listeners are items in the LDS response payload. Listeners cache.Resources }
// Server is a collection of handlers for streaming discovery requests. type Server interface { // StreamEnvoyV3 is the streaming method for Evnoy V3 XDS StreamEnvoyV3( stream StreamEnvoyV3, defaultTypeURL string, ) error // StreamSolo is the streaming method for Solo discovery StreamSolo( stream StreamSolo, defaultTypeURL string, ) error // Fetch is the universal fetch method. FetchEnvoyV3( context.Context, *envoy_service_discovery_v3.DiscoveryRequest, ) (*envoy_service_discovery_v3.DiscoveryResponse, error) FetchSolo( context.Context, *sk_discovery.DiscoveryRequest, ) (*sk_discovery.DiscoveryResponse, error) }
// Server is a collection of handlers for streaming discovery requests. type EnvoyServerV3 interface { envoy_service_endpoint_v3.EndpointDiscoveryServiceServer envoy_service_cluster_v3.ClusterDiscoveryServiceServer envoy_service_route_v3.RouteDiscoveryServiceServer envoy_service_listener_v3.ListenerDiscoveryServiceServer envoy_service_discovery_v3.AggregatedDiscoveryServiceServer }
# ignore_image_defined_volumes ignores volumes defined by the image. Useful for better resource # isolation, security and early detection of issues in the mount configuration when using # ReadOnlyRootFilesystem since containers won't silently mount a temporary volume.
$ docker pull cambricon-k8s-device-plugin:v1.1.3 Error response from daemon: pull access denied for cambricon-k8s-device-plugin, repository does not exist or may require 'docker login': denied: requested access to the resource is denied