Skip to content

Commit

Permalink
add comment to newServicePort
Browse files Browse the repository at this point in the history
  • Loading branch information
hc-github-team-consul-core committed Sep 6, 2023
1 parent 62d4b06 commit ac693a9
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ type servicePortInfo struct {
servicePorts map[string]*pbcatalog.WorkloadPort
}

// newServicePortInfo builds a servicePointInfo given a serviceEndpoints struct.
// newServicePortInfo builds a servicePointInfo given a serviceEndpoints struct. It pre-process
// what the service mesh port and the distinct service ports across the endpoints for a destination.
// The following occurs during pre-processing:
// - a port must be exposed to at least on workload address on every workload in
// the service to be a service port. Otherwise, the system would risk errors.
// - a Workload can optionally define ports specific to workload address. If no
// ports are specified for a workload address, then all the destination ports are
// used.
func newServicePortInfo(serviceEndpoints *pbcatalog.ServiceEndpoints) *servicePortInfo {
spInfo := &servicePortInfo{
servicePorts: make(map[string]*pbcatalog.WorkloadPort),
Expand Down

0 comments on commit ac693a9

Please sign in to comment.