Repository: envoyproxy/envoy
File: api/envoy/config/cluster/v3/cluster.proto (Protocol Buffers)

Code before:
  option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.LoadBalancingPolicy";

  message Policy {
    option (udpa.annotations.versioning).previous_message_type =
        "envoy.api.v2.LoadBalancingPolicy.Policy";

    reserved 2, 1, 3;

    reserved "config", "name", "typed_config";

    // [#extension-category: envoy.load_balancing_policies]
    core.v3.TypedExtensionConfig typed_extension_config = 4;
  }

  // Each client will iterate over the list in order and stop at the first policy that it
  // supports. This provides a mechanism for starting to use new LB policies that are not yet
  // supported by all clients.
  repeated Policy policies = 1;
}

message UpstreamConnectionOptions {
  option (udpa.annotations.versioning).previous_message_type =
      "envoy.api.v2.UpstreamConnectionOptions";

  enum FirstAddressFamilyVersion {
    // Use the first address family encountered in the address list.
    DEFAULT = 0;

    V4 = 1;

    V6 = 2;

    PIPE = 3;

    INTERNAL = 4;
  }

  message HappyEyeballsConfig {
    // Specify the IP address family to attempt connection first in happy
    // eyeballs algorithm according to RFC8305#section-4.
    FirstAddressFamilyVersion first_address_family_version = 1;

    // Specify the number of addresses of the first_address_family_version being
    // attempted for connection before the other address family.
    google.protobuf.UInt32Value first_address_family_count = 2 [(validate.rules).uint32 = {gte: 1}];
  }

  // If set then set SO_KEEPALIVE on the socket to enable TCP Keepalives.
  core.v3.TcpKeepalive tcp_keepalive = 1;

  // If enabled, associates the interface name of the local address with the upstream connection.

Review comment (suggestion):
It looks like this needs to be kept in sync with the types of addresses supported here:

https://github.com/envoyproxy/envoy/blob/0d6c40606ed86999edf50078b4ff8818ffbade38/api/envoy/config/core/v3/address.proto#L191

I suggest adding a comment in both places indicating that they need to be kept in sync.

Code after:
  option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.LoadBalancingPolicy";

  message Policy {
    option (udpa.annotations.versioning).previous_message_type =
        "envoy.api.v2.LoadBalancingPolicy.Policy";

    reserved 2, 1, 3;

    reserved "config", "name", "typed_config";

    // [#extension-category: envoy.load_balancing_policies]
    core.v3.TypedExtensionConfig typed_extension_config = 4;
  }

  // Each client will iterate over the list in order and stop at the first policy that it
  // supports. This provides a mechanism for starting to use new LB policies that are not yet
  // supported by all clients.
  repeated Policy policies = 1;
}

message UpstreamConnectionOptions {
  option (udpa.annotations.versioning).previous_message_type =
      "envoy.api.v2.UpstreamConnectionOptions";

  // [#comment: Keep this list of address types in sync with api/config/core/v3/address.proto.]
  enum FirstAddressFamilyVersion {
    // Use the first address family encountered in the address list.
    DEFAULT = 0;

    V4 = 1;

    V6 = 2;

    PIPE = 3;

    INTERNAL = 4;
  }

  message HappyEyeballsConfig {
    // Specify the IP address family to attempt connection first in happy
    // eyeballs algorithm according to RFC8305#section-4.
    FirstAddressFamilyVersion first_address_family_version = 1;

    // Specify the number of addresses of the first_address_family_version being
    // attempted for connection before the other address family.
    google.protobuf.UInt32Value first_address_family_count = 2 [(validate.rules).uint32 = {gte: 1}];
  }

  // If set then set SO_KEEPALIVE on the socket to enable TCP Keepalives.
  core.v3.TcpKeepalive tcp_keepalive = 1;