Skip to content

Commit 2246f8a

Browse files
committed
pkg,test: Fix linting violations in relevant packages
Run find . -name '*.go' -not -path "./vendor/*" -not -path "./pkg/lib/operatorclient/operatorclientmocks/*" | xargs gofmt -w find . -name '*.go' -not -path "./vendor/*" -not -path "./pkg/lib/operatorclient/operatorclientmocks/*" | xargs goimports -w and commit the results. Signed-off-by: timflannagan <[email protected]>
1 parent 5deade0 commit 2246f8a

File tree

17 files changed

+24
-19
lines changed

17 files changed

+24
-19
lines changed

pkg/controller/certs/certs.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ import (
1616
)
1717

1818
type CertGenerator interface {
19-
Generate(notAfter time.Time, organization string, ca *KeyPair, hosts []string) (*KeyPair, error)
19+
Generate(notAfter time.Time, organization string, ca *KeyPair, hosts []string) (*KeyPair, error)
2020
}
2121

2222
type CertGeneratorFunc func(notAfter time.Time, organization string, ca *KeyPair, hosts []string) (*KeyPair, error)
2323

24-
func (f CertGeneratorFunc) Generate(notAfter time.Time, organization string, ca *KeyPair, hosts []string) (*KeyPair, error) {
24+
func (f CertGeneratorFunc) Generate(notAfter time.Time, organization string, ca *KeyPair, hosts []string) (*KeyPair, error) {
2525
return f(notAfter, organization, ca, hosts)
2626
}
2727

pkg/controller/operators/catalog/installplan_sync.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"errors"
66

7-
87
"github.com/sirupsen/logrus"
98
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
109
"k8s.io/apimachinery/pkg/labels"

pkg/controller/operators/openshift/clusteroperator_controller_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package openshift
22

33
import (
44
"fmt"
5+
56
semver "github.com/blang/semver/v4"
67
. "github.com/onsi/ginkgo"
78
. "github.com/onsi/gomega"

pkg/controller/operators/operatorcondition_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66

77
. "github.com/onsi/ginkgo"
88
. "github.com/onsi/gomega"
9-
operatorsv2 "github.com/operator-framework/api/pkg/operators/v2"
109
operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
10+
operatorsv2 "github.com/operator-framework/api/pkg/operators/v2"
1111
"github.com/operator-framework/operator-lifecycle-manager/pkg/lib/ownerutil"
1212

1313
appsv1 "k8s.io/api/apps/v1"

pkg/controller/operators/operatorconditiongenerator_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import (
1414

1515
. "github.com/onsi/ginkgo"
1616
. "github.com/onsi/gomega"
17-
operatorsv2 "github.com/operator-framework/api/pkg/operators/v2"
1817
operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
18+
operatorsv2 "github.com/operator-framework/api/pkg/operators/v2"
1919
)
2020

2121
var _ = Describe("The OperatorConditionsGenerator Controller", func() {

pkg/controller/registry/grpc/source.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ package grpc
22

33
import (
44
"context"
5-
"github.com/operator-framework/operator-registry/pkg/client"
65
"sync"
76
"time"
87

8+
"github.com/operator-framework/operator-registry/pkg/client"
9+
910
"github.com/sirupsen/logrus"
1011
"google.golang.org/grpc"
1112
"google.golang.org/grpc/connectivity"
@@ -225,4 +226,4 @@ func (s *SourceStore) ClientsForNamespaces(namespaces ...string) map[registry.Ca
225226

226227
// TODO : remove unhealthy
227228
return refs
228-
}
229+
}

pkg/controller/registry/resolver/rbac.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func generateName(base string, o interface{}) string {
2222
hashutil.DeepHashObject(hasher, o)
2323
hash := utilrand.SafeEncodeString(fmt.Sprint(hasher.Sum32()))
2424
if len(base)+len(hash) > maxNameLength {
25-
base = base[:maxNameLength - len(hash) - 1]
25+
base = base[:maxNameLength-len(hash)-1]
2626
}
2727

2828
return fmt.Sprintf("%s-%s", base, hash)

pkg/controller/registry/resolver/rbac_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ func TestGenerateName(t *testing.T) {
2929
name: "generate",
3030
args: args{
3131
base: "myname",
32-
o: []string{"something"},
32+
o: []string{"something"},
3333
},
3434
want: "myname-9c895f74f",
3535
},
3636
{
3737
name: "truncated",
3838
args: args{
3939
base: strings.Repeat("name", 100),
40-
o: []string{"something", "else"},
40+
o: []string{"something", "else"},
4141
},
4242
want: "namenamenamenamenamenamenamenamenamenamenamenamename-78fd8b4d6b",
4343
},

pkg/lib/controller-runtime/client/ssa_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ package client
22

33
import (
44
"context"
5-
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
65
"testing"
76

7+
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
8+
89
"github.com/operator-framework/operator-lifecycle-manager/pkg/lib/testobj"
910
"github.com/stretchr/testify/require"
1011
corev1 "k8s.io/api/core/v1"

pkg/lib/crd/storage.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package crd
22

33
import (
44
"fmt"
5+
56
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
67
apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
78
"k8s.io/apimachinery/pkg/runtime"

0 commit comments

Comments
 (0)