Skip to content

v1.21 Cannot query multi-port services in v1.22 #23815

Description

@jameshartig

Overview of the Issue

If a service is defined in v1.22 with:

"Ports": [
  {
    "Name": "http",
    "Port": 8080,
    "Default": true
  }
]

This ends up breaking anything querying against it in v1.21 because it is looking for port but there is no port.

This is handled in some places with code like:

if clone.ServicePort == 0 && len(clone.ServicePorts) > 0 {
	// Populate `port` with default port for backward compatibility
	clone.ServicePort = clone.ToNodeService().DefaultPort()
}

But crucially, this isn't handled in the RPC methods like Catalog.NodeServices so if you try to do a DNS SRV lookup you end up getting 0 port.


Reproduction Steps

Consul info for both Client and Server

N/A

Operating system and Environment details

v1.22.x is running in k8s and we noticed this because consul-k8s switched to only set Ports and no longer sets Port.

Log Fragments

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions