newPluginOption returns a new pluginOption with local labels and metadata exchange labels derived from the environment.
(ctx context.Context)
| 56 | // newPluginOption returns a new pluginOption with local labels and metadata |
| 57 | // exchange labels derived from the environment. |
| 58 | func newPluginOption(ctx context.Context) internal.PluginOption { |
| 59 | localLabels, metadataExchangeLabelsEncoded := constructMetadataFromEnv(ctx) |
| 60 | |
| 61 | return &pluginOption{ |
| 62 | localLabels: localLabels, |
| 63 | metadataExchangeLabelsEncoded: metadataExchangeLabelsEncoded, |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | // NewLabelsMD returns a metadata.MD with the CSM labels as an encoded protobuf |
| 68 | // Struct as the value of "x-envoy-peer-metadata". |