Skip to content

Commit

Permalink
Merge pull request #99 from openshift-cherrypick-robot/cherry-pick-96…
Browse files Browse the repository at this point in the history
…-to-release-4.11

[release-4.11] OCPBUGS-20359: UPSTREAM: <carry>: openshift: Fix OCPBUGS-20359
  • Loading branch information
openshift-ci[bot] committed Oct 31, 2023
2 parents 7985ec8 + 56b8628 commit e195fdd
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions plugin/kubernetes/object/endpoint.go
Expand Up @@ -122,7 +122,19 @@ func EndpointSliceToEndpoints(obj meta.Object) (meta.Object, error) {
} else {
e.Subsets[0].Ports = make([]EndpointPort, len(ends.Ports))
for k, p := range ends.Ports {
ep := EndpointPort{Port: *p.Port, Name: *p.Name, Protocol: string(*p.Protocol)}
port := int32(-1)
name := ""
protocol := ""
if p.Port != nil {
port = *p.Port
}
if p.Name != nil {
name = *p.Name
}
if p.Protocol != nil {
protocol = string(*p.Protocol)
}
ep := EndpointPort{Port: port, Name: name, Protocol: protocol}
e.Subsets[0].Ports[k] = ep
}
}
Expand Down Expand Up @@ -251,7 +263,6 @@ func (e *Endpoints) DeepCopyObject() runtime.Object {
ep := EndpointPort{Port: p.Port, Name: p.Name, Protocol: p.Protocol}
sub.Ports[k] = ep
}

e1.Subsets[i] = sub
}
return e1
Expand Down

0 comments on commit e195fdd

Please sign in to comment.