Skip to content

Commit 30a24c7

Browse files
committed
chore: pkg import only once
1 parent e3cc52a commit 30a24c7

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

pkg/controller/internal/testutil/cluster.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424
. "github.com/onsi/gomega"
2525
. "github.com/onsi/gomega/gstruct"
2626
gomegatypes "github.com/onsi/gomega/types"
27-
corev1 "k8s.io/api/core/v1"
2827
"sigs.k8s.io/controller-runtime/pkg/client"
2928

3029
core "k8s.io/api/core/v1"
@@ -111,7 +110,7 @@ func HaveClusterStatusReadyNodes(nodes int) gomegatypes.GomegaMatcher {
111110
}
112111

113112
// HaveClusterCond is a helper func that returns a matcher to check for an existing condition in a ClusterCondition list.
114-
func HaveClusterCond(condType api.ClusterConditionType, status corev1.ConditionStatus) gomegatypes.GomegaMatcher {
113+
func HaveClusterCond(condType api.ClusterConditionType, status core.ConditionStatus) gomegatypes.GomegaMatcher {
115114
return PointTo(MatchFields(IgnoreExtras, Fields{
116115
"Status": MatchFields(IgnoreExtras, Fields{
117116
"Conditions": ContainElement(MatchFields(IgnoreExtras, Fields{

pkg/controller/mysqlcluster/mysqlcluster_controller.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import (
3737

3838
mysqlv1alpha1 "github.com/bitpoke/mysql-operator/pkg/apis/mysql/v1alpha1"
3939

40-
api "github.com/bitpoke/mysql-operator/pkg/apis/mysql/v1alpha1"
4140
cleaner "github.com/bitpoke/mysql-operator/pkg/controller/mysqlcluster/internal/cleaner"
4241
clustersyncer "github.com/bitpoke/mysql-operator/pkg/controller/mysqlcluster/internal/syncer"
4342
"github.com/bitpoke/mysql-operator/pkg/controller/mysqlcluster/internal/upgrades"
@@ -191,11 +190,11 @@ func (r *ReconcileMysqlCluster) Reconcile(ctx context.Context, request reconcile
191190
// condition will be true all the time. When user set cluster's replicas to a value greater than 0,
192191
// the pods of the cluster will boot one by one, but node controller will not init mysql when FailoverInProgress
193192
// is true.
194-
fip := cluster.GetClusterCondition(api.ClusterConditionFailoverInProgress)
193+
fip := cluster.GetClusterCondition(mysqlv1alpha1.ClusterConditionFailoverInProgress)
195194
if fip != nil && fip.Status == corev1.ConditionTrue &&
196195
*cluster.Spec.Replicas == 0 && cluster.Status.ReadyNodes == 0 {
197196

198-
cluster.UpdateStatusCondition(api.ClusterConditionFailoverInProgress, corev1.ConditionFalse,
197+
cluster.UpdateStatusCondition(mysqlv1alpha1.ClusterConditionFailoverInProgress, corev1.ConditionFalse,
199198
"ClusterNotRunning", "cluster is not running")
200199

201200
if sErr := r.Status().Update(context.TODO(), cluster.Unwrap()); sErr != nil {

pkg/controller/mysqldatabase/db_controller_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import (
2626

2727
corev1 "k8s.io/api/core/v1"
2828
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
29-
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3029
"k8s.io/apimachinery/pkg/types"
3130
"k8s.io/client-go/kubernetes/scheme"
3231
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -185,7 +184,7 @@ var _ = Describe("MySQL database controller", func() {
185184
It("should succeed if the cluster has been deleted", func() {
186185
// delete the cluster
187186
cluster := &mysqlv1alpha1.MysqlCluster{
188-
ObjectMeta: v1.ObjectMeta{
187+
ObjectMeta: metav1.ObjectMeta{
189188
Name: clusterName, Namespace: db.Namespace,
190189
},
191190
}

0 commit comments

Comments
 (0)