Skip to content

Commit

Permalink
Reuse local contains func
Browse files Browse the repository at this point in the history
  • Loading branch information
josvazg committed Oct 10, 2024
1 parent e3e72d1 commit 521a9af
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions pkg/controller/connectionsecret/connectionsecrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func ReapOrphanConnectionSecrets(ctx context.Context, k8sClient client.Client, p
if !ok {
continue
}
if clusterExists := contains(projectDeploymentNames, clusterName); clusterExists {
if clusterExists := stringutil.Contains(projectDeploymentNames, clusterName); clusterExists {
continue
}
if err := k8sClient.Delete(ctx, &secret); err != nil {
Expand All @@ -51,15 +51,6 @@ func ReapOrphanConnectionSecrets(ctx context.Context, k8sClient client.Client, p
return removedOrphanSecrets, nil
}

func contains(list []string, item string) bool {
for _, v := range list {
if v == item {
return true
}
}
return false
}

func CreateOrUpdateConnectionSecrets(ctx *workflow.Context, k8sClient client.Client, ds deployment.AtlasDeploymentsService, recorder record.EventRecorder, project *project.Project, dbUser akov2.AtlasDatabaseUser) workflow.Result {
conns, err := ds.ListDeploymentConnections(ctx.Context, project.ID)
if err != nil {
Expand Down

0 comments on commit 521a9af

Please sign in to comment.