NewLabelsMD returns a metadata.MD with the CSM labels as an encoded protobuf Struct as the value of "x-envoy-peer-metadata".
()
| 67 | // NewLabelsMD returns a metadata.MD with the CSM labels as an encoded protobuf |
| 68 | // Struct as the value of "x-envoy-peer-metadata". |
| 69 | func (cpo *pluginOption) GetMetadata() metadata.MD { |
| 70 | return metadata.New(map[string]string{ |
| 71 | metadataExchangeKey: cpo.metadataExchangeLabelsEncoded, |
| 72 | }) |
| 73 | } |
| 74 | |
| 75 | // GetLabels gets the CSM peer labels from the metadata provided. It returns |
| 76 | // "unknown" for labels not found. Labels returned depend on the remote type. |