Skip to content

Commit

Permalink
refactor: rename function to drop Get prefix
Browse files Browse the repository at this point in the history
Signed-off-by: Manan Gupta <[email protected]>
  • Loading branch information
GuptaManan100 committed Dec 28, 2023
1 parent 637d481 commit cd5c5d1
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/controller/vitesskeyspace/reconcile_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (r *reconcileHandler) tsInit(ctx context.Context) error {
r.tmc = tmclient.NewTabletManagerClient()
}

collationEnv, parser, err := environment.GetCollationEnvAndParser()
collationEnv, parser, err := environment.CollationEnvAndParser()
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/vitessshard/reconcile_topo.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (r *ReconcileVitessShard) reconcileTopology(ctx context.Context, vts *plane
return resultBuilder.RequeueAfter(topoRequeueDelay)
}
defer ts.Close()
collationEnv, parser, err := environment.GetCollationEnvAndParser()
collationEnv, parser, err := environment.CollationEnvAndParser()
if err != nil {
return resultBuilder.Error(err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func (r *ReconcileVitessShard) Reconcile(cctx context.Context, request reconcile
tmc := tmclient.NewTabletManagerClient()
defer tmc.Close()

collationEnv, parser, err := environment.GetCollationEnvAndParser()
collationEnv, parser, err := environment.CollationEnvAndParser()
if err != nil {
return resultBuilder.Error(err)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/operator/environment/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ func ReconcileTimeout() time.Duration {
return reconcileTimeout
}

// GetCollationEnvAndParser gets the collation environment and parser to be used in the operator.
func GetCollationEnvAndParser() (*collations.Environment, *sqlparser.Parser, error) {
// CollationEnvAndParser gets the collation environment and parser to be used in the operator.
func CollationEnvAndParser() (*collations.Environment, *sqlparser.Parser, error) {
collationEnv := collations.NewEnvironment(mySQLServerVersion)
parser, err := sqlparser.New(sqlparser.Options{
MySQLServerVersion: mySQLServerVersion,
Expand Down
2 changes: 1 addition & 1 deletion pkg/operator/vitesstopo/prune_keyspaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func KeyspacesToPrune(keyspaceNames []string, desiredKeyspaces sets.String, orph
func DeleteKeyspaces(ctx context.Context, ts *topo.Server, recorder record.EventRecorder, eventObj runtime.Object, keyspaceNames []string) (reconcile.Result, error) {
resultBuilder := &results.Builder{}

collationEnv, parser, err := environment.GetCollationEnvAndParser()
collationEnv, parser, err := environment.CollationEnvAndParser()
if err != nil {
return resultBuilder.Error(err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/operator/vitesstopo/prune_shards.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func ShardsToPrune(currentShards []string, desiredShards sets.String, orphanedSh
func DeleteShards(ctx context.Context, ts *topo.Server, recorder record.EventRecorder, eventObj runtime.Object, keyspaceName string, shardNames []string) (reconcile.Result, error) {
resultBuilder := &results.Builder{}

collationEnv, parser, err := environment.GetCollationEnvAndParser()
collationEnv, parser, err := environment.CollationEnvAndParser()
if err != nil {
return resultBuilder.Error(err)
}
Expand Down

0 comments on commit cd5c5d1

Please sign in to comment.