Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump golangci-lint to 1.56.2 #1550

Merged
merged 2 commits into from
Feb 28, 2024
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
2 changes: 1 addition & 1 deletion test/e2e/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var _ = SynchronizedBeforeSuite(func() []byte {

framework.BeforeSuite()
return nil
}, func(data []byte) {
}, func(_ []byte) {
// Run on all Ginkgo nodes
})

Expand Down
2 changes: 2 additions & 0 deletions test/e2e/framework/clusterglobalegressip.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func AwaitAllocatedEgressIPs(client dynamic.ResourceInterface, name string) []st
if apierrors.IsNotFound(err) {
return nil, nil //nolint:nilnil // We want to repeat but let the checker known that nothing was found.
}

return resGip, err
},
func(result interface{}) (bool, string, error) {
Expand All @@ -60,6 +61,7 @@ func AwaitAllocatedEgressIPs(client dynamic.ResourceInterface, name string) []st
if len(globalIPs) == 0 {
return false, fmt.Sprintf("Egress IP resource %q exists but allocatedIPs not available yet", name), nil
}

return true, "", nil
})

Expand Down
5 changes: 4 additions & 1 deletion test/e2e/framework/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func BeforeSuite() {
By("Creating kubernetes clients")

if len(RestConfigs) == 0 {
if len(TestContext.KubeConfig) > 0 {
if TestContext.KubeConfig != "" {
Expect(TestContext.KubeConfigs).To(BeEmpty(),
"Either KubeConfig or KubeConfigs must be specified but not both")

Expand All @@ -182,6 +182,7 @@ func BeforeSuite() {
} else if len(TestContext.KubeConfigs) > 0 {
Expect(TestContext.KubeConfigs).To(HaveLen(len(TestContext.ClusterIDs)),
"One ClusterID must be provided for each item in the KubeConfigs")

for _, kubeConfig := range TestContext.KubeConfigs {
RestConfigs = append(RestConfigs, createRestConfig(kubeConfig, ""))
}
Expand Down Expand Up @@ -570,6 +571,7 @@ func AwaitResultOrError(opMsg string, doOperation DoOperationFunc, checkResult C
if IsTransientError(err, opMsg) {
return false, nil
}

return false, err
}

Expand All @@ -584,6 +586,7 @@ func AwaitResultOrError(opMsg string, doOperation DoOperationFunc, checkResult C
}

lastMsg = msg

return false, nil
})

Expand Down
6 changes: 6 additions & 0 deletions test/e2e/framework/gateways.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ func (f *Framework) AwaitGatewayWithStatus(cluster ClusterIndex, name, status st

gw := result.(*unstructured.Unstructured)
haStatus := NestedString(gw.Object, "status", "haStatus")

if haStatus != status {
return false, fmt.Sprintf("gateway %q exists but has wrong status %q, expected %q", gw.GetName(), haStatus, status), nil
}

return true, "", nil
})

Expand Down Expand Up @@ -105,6 +107,7 @@ func (f *Framework) AwaitGatewayRemoved(cluster ClusterIndex, name string) {
if apierrors.IsNotFound(err) {
return true, nil
}

return false, err
},
func(result interface{}) (bool, string, error) {
Expand All @@ -130,6 +133,7 @@ func (f *Framework) AwaitGatewayFullyConnected(cluster ClusterIndex, name string

gw := result.(*unstructured.Unstructured)
haStatus := NestedString(gw.Object, "status", "haStatus")

if haStatus != "active" {
return false, fmt.Sprintf("Gateway %q exists but not active yet",
gw.GetName()), nil
Expand All @@ -143,6 +147,7 @@ func (f *Framework) AwaitGatewayFullyConnected(cluster ClusterIndex, name string
for _, o := range connections {
conn := o.(map[string]interface{})
status, _, _ := unstructured.NestedString(conn, "status")

if status != "connected" {
return false, fmt.Sprintf("Gateway %q is active but cluster %q is not connected: Status: %q, Message: %q",
name, NestedString(conn, "endpoint", "cluster_id"), status, NestedString(conn, "statusMessage")), nil
Expand Down Expand Up @@ -186,6 +191,7 @@ func (f *Framework) DeleteGateway(cluster ClusterIndex, name string) {
if apierrors.IsNotFound(err) {
return nil, nil //nolint:nilnil // We want to repeat but let the checker known that nothing was found.
}

return nil, err
}, NoopCheckResult)
}
Expand Down
3 changes: 3 additions & 0 deletions test/e2e/framework/globalingressips.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func (f *Framework) AwaitGlobalIngressIP(cluster ClusterIndex, name, namespace s
if apierrors.IsNotFound(err) {
return nil, nil //nolint:nilnil // We want to repeat but let the checker known that nothing was found.
}

return resGip, err
},
func(result interface{}) (bool, string, error) {
Expand All @@ -56,6 +57,7 @@ func (f *Framework) AwaitGlobalIngressIP(cluster ClusterIndex, name, namespace s
return false, fmt.Sprintf("GlobalIngress %q exists but allocatedIP not available yet",
name), nil
}

return true, "", nil
})

Expand All @@ -73,6 +75,7 @@ func (f *Framework) AwaitGlobalIngressIPRemoved(cluster ClusterIndex, name, name
if apierrors.IsNotFound(err) {
return true, nil
}

return false, err
},
func(result interface{}) (bool, string, error) {
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/framework/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ func (f *Framework) AwaitRouteAgentPodOnNode(cluster ClusterIndex, nodeName stri
}, func(result interface{}) (bool, string, error) {
pods := result.(*v1.PodList)
var podNodes []string

for i := range pods.Items {
pod := &pods.Items[i]
if pod.Spec.NodeName == nodeName {
Expand All @@ -152,6 +153,7 @@ func (f *Framework) AwaitRouteAgentPodOnNode(cluster ClusterIndex, nodeName stri
}

found = pod

return true, "", nil
}

Expand Down
Loading
Loading