Skip to content

Commit 5ad3f4b

Browse files
committed
NO-JIRA: Fix new gosimple minor issues in the code
Signed-off-by: Juan Manuel Parrilla Madrid <jparrill@redhat.com>
1 parent fa1ff15 commit 5ad3f4b

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

Diff for: cmd/cluster/core/dump.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ import (
1212
"strings"
1313
"time"
1414

15-
configv1 "github.com/openshift/api/config/v1"
16-
imagev1 "github.com/openshift/api/image/v1"
17-
routev1 "github.com/openshift/api/route/v1"
18-
securityv1 "github.com/openshift/api/security/v1"
19-
agentv1 "github.com/openshift/cluster-api-provider-agent/api/v1beta1"
2015
hyperv1 "github.com/openshift/hypershift/api/hypershift/v1beta1"
2116
scheduling "github.com/openshift/hypershift/api/scheduling/v1alpha1"
2217
"github.com/openshift/hypershift/cmd/log"
@@ -28,6 +23,12 @@ import (
2823
supportforwarder "github.com/openshift/hypershift/support/forwarder"
2924
supportutil "github.com/openshift/hypershift/support/util"
3025

26+
configv1 "github.com/openshift/api/config/v1"
27+
imagev1 "github.com/openshift/api/image/v1"
28+
routev1 "github.com/openshift/api/route/v1"
29+
securityv1 "github.com/openshift/api/security/v1"
30+
agentv1 "github.com/openshift/cluster-api-provider-agent/api/v1beta1"
31+
3132
admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
3233
appsv1 "k8s.io/api/apps/v1"
3334
batchv1 "k8s.io/api/batch/v1"

Diff for: control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1664,7 +1664,7 @@ func TestIncludeServingCertificates(t *testing.T) {
16641664

16651665
fakeClient := fake.NewClientBuilder().WithObjects(rootCA).Build()
16661666
for _, secret := range tc.servingSecrets {
1667-
fakeClient.Create(ctx, secret)
1667+
_ = fakeClient.Create(ctx, secret)
16681668
}
16691669

16701670
newRootCA, err := includeServingCertificates(ctx, fakeClient, hcp, rootCA)

Diff for: support/forwarder/forwarder.go

+2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ import (
77
"net/http"
88

99
hyperv1 "github.com/openshift/hypershift/api/hypershift/v1beta1"
10+
1011
corev1 "k8s.io/api/core/v1"
1112
"k8s.io/client-go/kubernetes"
1213
restclient "k8s.io/client-go/rest"
1314
"k8s.io/client-go/tools/portforward"
1415
"k8s.io/client-go/transport/spdy"
16+
1517
crclient "sigs.k8s.io/controller-runtime/pkg/client"
1618
)
1719

Diff for: support/forwarder/forwarder_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ import (
55
"strings"
66
"testing"
77

8+
hyperv1 "github.com/openshift/hypershift/api/hypershift/v1beta1"
9+
810
corev1 "k8s.io/api/core/v1"
911
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1012
"k8s.io/apimachinery/pkg/runtime"
13+
1114
"sigs.k8s.io/controller-runtime/pkg/client"
1215
"sigs.k8s.io/controller-runtime/pkg/client/fake"
13-
14-
hyperv1 "github.com/openshift/hypershift/api/hypershift/v1beta1"
1516
)
1617

1718
func TestGetRunningKubeAPIServerPod(t *testing.T) {

Diff for: support/util/util.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -686,9 +686,5 @@ func HostFromURL(addr string) (string, error) {
686686

687687
// EnableIfCustomKubeconfig returns true if the hosted control plane has a custom kubeconfig defined
688688
func EnableIfCustomKubeconfig(hcp *hyperv1.HostedControlPlane) bool {
689-
if len(hcp.Spec.KubeAPIServerDNSName) > 0 {
690-
return true
691-
}
692-
693-
return false
689+
return len(hcp.Spec.KubeAPIServerDNSName) > 0
694690
}

0 commit comments

Comments
 (0)