Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,17 @@ issues:
- path: pkg/k8s/fake.go
text: Error return value is not checked

# Ignore Endpoints and EndpointSubset deprecation warnings for now.
# Ignore NewSimpleClientset, Endpoints, EndpointSubset, and NewGone
# deprecation warnings for now.
- linters:
- staticcheck
text: "corev1.Endpoints is deprecated: This API is deprecated in v1.33+"
- linters:
- staticcheck
text: "corev1.EndpointSubset is deprecated: This API is deprecated in v1.33+"
- linters:
- staticcheck
text: "fake.NewSimpleClientset is deprecated"
- linters:
- staticcheck
text: "k8sError.NewGone is deprecated"
Original file line number Diff line number Diff line change
Expand Up @@ -451,16 +451,16 @@ func TestSyncService(t *testing.T) {
Protocol: protoPtr(v1.ProtocolUDP),
Port: ptr.To(int32(161)),
},
{
Name: ptr.To("sctp-example"),
Protocol: protoPtr(v1.ProtocolSCTP),
Port: ptr.To(int32(3456)),
},
{
Name: ptr.To("tcp-example"),
Protocol: protoPtr(v1.ProtocolTCP),
Port: ptr.To(int32(80)),
},
{
Name: ptr.To("sctp-example"),
Protocol: protoPtr(v1.ProtocolSCTP),
Port: ptr.To(int32(3456)),
},
},
expectedEndpoints: []discoveryv1.Endpoint{
{
Expand Down Expand Up @@ -569,16 +569,16 @@ func TestSyncService(t *testing.T) {
Protocol: protoPtr(v1.ProtocolUDP),
Port: ptr.To(int32(161)),
},
{
Name: ptr.To("sctp-example"),
Protocol: protoPtr(v1.ProtocolSCTP),
Port: ptr.To(int32(3456)),
},
{
Name: ptr.To("tcp-example"),
Protocol: protoPtr(v1.ProtocolTCP),
Port: ptr.To(int32(80)),
},
{
Name: ptr.To("sctp-example"),
Protocol: protoPtr(v1.ProtocolSCTP),
Port: ptr.To(int32(3456)),
},
},
expectedEndpoints: []discoveryv1.Endpoint{
{
Expand Down Expand Up @@ -678,16 +678,16 @@ func TestSyncService(t *testing.T) {
Protocol: protoPtr(v1.ProtocolUDP),
Port: ptr.To(int32(161)),
},
{
Name: ptr.To("sctp-example"),
Protocol: protoPtr(v1.ProtocolSCTP),
Port: ptr.To(int32(3456)),
},
{
Name: ptr.To("tcp-example"),
Protocol: protoPtr(v1.ProtocolTCP),
Port: ptr.To(int32(80)),
},
{
Name: ptr.To("sctp-example"),
Protocol: protoPtr(v1.ProtocolSCTP),
Port: ptr.To(int32(3456)),
},
},
expectedEndpoints: []discoveryv1.Endpoint{
{
Expand Down Expand Up @@ -792,16 +792,16 @@ func TestSyncService(t *testing.T) {
Protocol: protoPtr(v1.ProtocolUDP),
Port: ptr.To(int32(161)),
},
{
Name: ptr.To("sctp-example"),
Protocol: protoPtr(v1.ProtocolSCTP),
Port: ptr.To(int32(3456)),
},
{
Name: ptr.To("tcp-example"),
Protocol: protoPtr(v1.ProtocolTCP),
Port: ptr.To(int32(80)),
},
{
Name: ptr.To("sctp-example"),
Protocol: protoPtr(v1.ProtocolSCTP),
Port: ptr.To(int32(3456)),
},
},
expectedEndpoints: []discoveryv1.Endpoint{
{
Expand Down Expand Up @@ -862,6 +862,26 @@ func TestSyncService(t *testing.T) {

if !reflect.DeepEqual(testcase.expectedEndpointPorts, slice.Ports) {
t.Error("actual ports do not match expected ones")

for i, ep := range slice.Ports {
t.Logf(
"actual port[%d]: name=%s proto=%v port=%v",
i,
ptr.Deref(ep.Name, "<nil>"),
ptr.Deref(ep.Protocol, "<nil>"),
ptr.Deref(ep.Port, 0),
)
}

for i, ep := range testcase.expectedEndpointPorts {
t.Logf(
"expected port[%d]: name=%s proto=%v port=%v",
i,
ptr.Deref(ep.Name, "<nil>"),
ptr.Deref(ep.Protocol, "<nil>"),
ptr.Deref(ep.Port, 0),
)
}
}

// sort actual endpoints in terms of targetRef name, in ascending
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading