Skip to content

Commit 5941c06

Browse files
committed
chore(style): run goimports
1 parent 4aa7674 commit 5941c06

File tree

4 files changed

+33
-34
lines changed

4 files changed

+33
-34
lines changed

pkg/api/apis/operators/v1alpha1/clusterserviceversion_types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,4 +479,3 @@ func (csv ClusterServiceVersion) GetOwnedAPIServiceDescriptions() []APIServiceDe
479479

480480
return descs
481481
}
482-

pkg/controller/operators/catalog/operator.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const (
4343
clusterRoleKind = "ClusterRole"
4444
clusterRoleBindingKind = "ClusterRoleBinding"
4545
serviceAccountKind = "ServiceAccount"
46-
serviceKind = "Service"
46+
serviceKind = "Service"
4747
roleKind = "Role"
4848
roleBindingKind = "RoleBinding"
4949
)
@@ -1032,7 +1032,7 @@ func (o *Operator) ExecutePlan(plan *v1alpha1.InstallPlan) error {
10321032
// If no error occurred, mark the step as Created.
10331033
plan.Status.Plan[i].Status = v1alpha1.StepStatusCreated
10341034
}
1035-
1035+
10361036
case serviceKind:
10371037
// Marshal the manifest into a Service instance
10381038
var s corev1.Service

pkg/controller/operators/catalog/operator_test.go

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
package catalog
22

33
import (
4+
"encoding/json"
45
"errors"
56
"fmt"
67
"testing"
78
"time"
8-
"encoding/json"
99

1010
"github.com/ghodss/yaml"
1111
"github.com/sirupsen/logrus"
1212
"github.com/stretchr/testify/require"
13+
appsv1 "k8s.io/api/apps/v1"
1314
corev1 "k8s.io/api/core/v1"
15+
rbacv1 "k8s.io/api/rbac/v1"
1416
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
1517
apiextensionsfake "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/fake"
1618
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -20,8 +22,6 @@ import (
2022
k8sfake "k8s.io/client-go/kubernetes/fake"
2123
"k8s.io/client-go/tools/cache"
2224
apiregistrationfake "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/fake"
23-
appsv1 "k8s.io/api/apps/v1"
24-
rbacv1 "k8s.io/api/rbac/v1"
2525

2626
"github.com/operator-framework/operator-lifecycle-manager/pkg/api/apis/operators/v1alpha1"
2727
"github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/clientset/versioned/fake"
@@ -119,51 +119,51 @@ func TestTransitionInstallPlan(t *testing.T) {
119119
func TestExecutePlan(t *testing.T) {
120120
namespace := "ns"
121121

122-
tests := []struct{
122+
tests := []struct {
123123
testName string
124-
in *v1alpha1.InstallPlan
125-
want []runtime.Object
126-
err error
124+
in *v1alpha1.InstallPlan
125+
want []runtime.Object
126+
err error
127127
}{
128128
{
129129
testName: "NoSteps",
130-
in: installPlan("p", namespace, v1alpha1.InstallPlanPhaseInstalling),
131-
want: []runtime.Object{},
132-
err: nil,
130+
in: installPlan("p", namespace, v1alpha1.InstallPlanPhaseInstalling),
131+
want: []runtime.Object{},
132+
err: nil,
133133
},
134134
{
135135
testName: "MultipleSteps",
136136
in: withSteps(installPlan("p", namespace, v1alpha1.InstallPlanPhaseInstalling, "csv"),
137137
[]*v1alpha1.Step{
138138
&v1alpha1.Step{
139139
Resource: v1alpha1.StepResource{
140-
CatalogSource: "catalog",
140+
CatalogSource: "catalog",
141141
CatalogSourceNamespace: namespace,
142-
Group: "",
143-
Version: "v1",
144-
Kind: "Service",
145-
Name: "service",
146-
Manifest: toManifest(service("service", namespace)),
142+
Group: "",
143+
Version: "v1",
144+
Kind: "Service",
145+
Name: "service",
146+
Manifest: toManifest(service("service", namespace)),
147147
},
148148
Status: v1alpha1.StepStatusUnknown,
149149
},
150150
&v1alpha1.Step{
151151
Resource: v1alpha1.StepResource{
152-
CatalogSource: "catalog",
152+
CatalogSource: "catalog",
153153
CatalogSourceNamespace: namespace,
154-
Group: "operators.coreos.com",
155-
Version: "v1alpha1",
156-
Kind: "ClusterServiceVersion",
157-
Name: "csv",
158-
Manifest: toManifest(csv("csv", namespace, nil, nil)),
154+
Group: "operators.coreos.com",
155+
Version: "v1alpha1",
156+
Kind: "ClusterServiceVersion",
157+
Name: "csv",
158+
Manifest: toManifest(csv("csv", namespace, nil, nil)),
159159
},
160160
Status: v1alpha1.StepStatusUnknown,
161161
},
162162
},
163163
),
164164
want: []runtime.Object{service("service", namespace), csv("csv", namespace, nil, nil)},
165-
err: nil,
166-
},
165+
err: nil,
166+
},
167167
}
168168

169169
for _, tt := range tests {
@@ -538,15 +538,15 @@ func NewFakeOperator(clientObjs []runtime.Object, k8sObjs []runtime.Object, extO
538538
func installPlan(name, namespace string, phase v1alpha1.InstallPlanPhase, names ...string) *v1alpha1.InstallPlan {
539539
return &v1alpha1.InstallPlan{
540540
ObjectMeta: metav1.ObjectMeta{
541-
Name: name,
541+
Name: name,
542542
Namespace: namespace,
543543
},
544544
Spec: v1alpha1.InstallPlanSpec{
545545
ClusterServiceVersionNames: names,
546546
},
547547
Status: v1alpha1.InstallPlanStatus{
548548
Phase: phase,
549-
Plan: []*v1alpha1.Step{},
549+
Plan: []*v1alpha1.Step{},
550550
},
551551
}
552552
}
@@ -575,7 +575,7 @@ func csv(name, namespace string, owned, required []string) *v1alpha1.ClusterServ
575575

576576
return &v1alpha1.ClusterServiceVersion{
577577
ObjectMeta: metav1.ObjectMeta{
578-
Name: name,
578+
Name: name,
579579
Namespace: namespace,
580580
},
581581
Spec: v1alpha1.ClusterServiceVersionSpec{
@@ -605,7 +605,7 @@ func crd(name string) v1beta1.CustomResourceDefinition {
605605
func service(name, namespace string) *corev1.Service {
606606
return &corev1.Service{
607607
ObjectMeta: metav1.ObjectMeta{
608-
Name: name,
608+
Name: name,
609609
Namespace: namespace,
610610
},
611611
}
@@ -614,4 +614,4 @@ func service(name, namespace string) *corev1.Service {
614614
func toManifest(obj runtime.Object) string {
615615
raw, _ := json.Marshal(obj)
616616
return string(raw)
617-
}
617+
}

pkg/controller/registry/resolver/resolver_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77

88
opregistry "github.com/operator-framework/operator-registry/pkg/registry"
99
"github.com/stretchr/testify/require"
10+
corev1 "k8s.io/api/core/v1"
1011
rbacv1 "k8s.io/api/rbac/v1"
1112
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
12-
corev1 "k8s.io/api/core/v1"
1313
"k8s.io/client-go/tools/cache"
1414

1515
"github.com/operator-framework/operator-lifecycle-manager/pkg/api/apis/operators/v1alpha1"
@@ -126,7 +126,7 @@ func TestNamespaceResolver(t *testing.T) {
126126
out: out{
127127
steps: [][]*v1alpha1.Step{
128128
bundleSteps(bundle("a.v1", "a", "alpha", "", nil, Requires1, nil, nil), namespace, catalog),
129-
bundleSteps(withBundleObject(bundle("b.v1", "b", "beta", "", Provides1, nil, nil, nil), u(&corev1.Service{TypeMeta: metav1.TypeMeta{Kind: "Service", APIVersion: ""}, ObjectMeta: metav1.ObjectMeta{Name: "test-service"}})), namespace, catalog),
129+
bundleSteps(withBundleObject(bundle("b.v1", "b", "beta", "", Provides1, nil, nil, nil), u(&corev1.Service{TypeMeta: metav1.TypeMeta{Kind: "Service", APIVersion: ""}, ObjectMeta: metav1.ObjectMeta{Name: "test-service"}})), namespace, catalog),
130130
subSteps(namespace, "b.v1", "b", "beta", catalog),
131131
},
132132
subs: []*v1alpha1.Subscription{

0 commit comments

Comments
 (0)