Skip to content

Commit

Permalink
Merge pull request #27 from testwill/pkg-import
Browse files Browse the repository at this point in the history
chore: import packages only once
  • Loading branch information
houseonline authored Dec 1, 2023
2 parents 1b5c71b + 271fe5f commit 6f2b770
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pkg/controller/svc/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"strings"

corev1 "k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/types"
)
Expand All @@ -33,11 +32,11 @@ func parseSelector(v string) (labels.Selector, error) {
return labels.SelectorFromSet(labels.Set(m)), nil
}

func podToEndpointAddress(pod *v1.Pod) *v1.EndpointAddress {
return &v1.EndpointAddress{
func podToEndpointAddress(pod *corev1.Pod) *corev1.EndpointAddress {
return &corev1.EndpointAddress{
IP: pod.Status.PodIP,
NodeName: &pod.Spec.NodeName,
TargetRef: &v1.ObjectReference{
TargetRef: &corev1.ObjectReference{
Kind: "Pod",
Namespace: pod.Namespace,
Name: pod.Name,
Expand All @@ -46,7 +45,7 @@ func podToEndpointAddress(pod *v1.Pod) *v1.EndpointAddress {
}}
}

func endpointChanged(pod1, pod2 *v1.Pod) bool {
func endpointChanged(pod1, pod2 *corev1.Pod) bool {
endpointAddress1 := podToEndpointAddress(pod1)
endpointAddress2 := podToEndpointAddress(pod2)

Expand Down

0 comments on commit 6f2b770

Please sign in to comment.