Skip to content

Issue: Boolean Values Interpreted as 1/0 in RTDS Configuration #35762

@gordon-wang-lyft

Description

@gordon-wang-lyft

If you are reporting any crash or any potential security issue, do not
open an issue in this repo. Please report the issue via emailing
envoy-security@googlegroups.com where the issue will be triaged appropriately.

Title: Issue: Boolean Values Interpreted as 1/0 in RTDS Configuration

Description:

While working with the Envoy Runtime Discovery Service (RTDS), I encountered an issue where boolean values (bool_value:true/false) in the RTDS configuration are being interpreted as 1/0 instead of true/false when processed
by Envoy.

Repro steps:

  1. Configure RTDS with a boolean value, e.g., (fields:{key:"envoy.features.http2_use_oghttp2" value:{bool_value:true}}).
  2. Observe the processed configuration in Envoy, where the boolean is represented as 1 instead of true. See the following section for detailed output

Admin and Stats Output:

There is not specific admin output. While when query the 9901/runtime we do obtain the mis-interpreted value:

curl -s 0:9901/runtime | grep -A10 oghttp2
  "envoy.features.http2_use_oghttp2": {
   "final_value": 1,
   "layer_values": [
    "false",
    1,
    ""
   ]
  },

Config:

Envoy Version: this bug still exists after we upgraded Envoy to 1.30

Expected Behavior:

The boolean values in the RTDS configuration should be preserved as true/false when processed by Envoy.

Actual Behavior:
The boolean values are being converted to 1/0 in the final layer configuration seen by the Envoy sidecar.

Additional Context:

  1. This issue could lead to unexpected behavior in features relying on boolean flags.
  2. The problem seems to stem from how RTDS handles the protobuf message type for booleans, converting them to integers in the final config.

Metadata

Metadata

Assignees

No one assigned

    Labels

    buginvestigatePotential bug that needs verificationstalestalebot believes this issue/PR has not been touched recently

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions