Skip to content

Commit d98a57d

Browse files
committed
feat: wip
1 parent cd1392d commit d98a57d

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

.golangci.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ linters:
3232
- errname
3333
- exhaustive
3434
- forcetypeassert
35-
- gochecknoinits
3635
- gochecksumtype
3736
- goconst
3837
- gocritic
@@ -97,6 +96,7 @@ linters:
9796
- lll
9897
- funcorder
9998
- nilnil
99+
- gochecknoinits
100100
settings:
101101
godox:
102102
# report any comments starting with keywords, this is useful for TODO or FIXME comments that
@@ -387,9 +387,6 @@ linters:
387387
- legacy
388388
- std-error-handling
389389
rules:
390-
- linters:
391-
- gochecknoinits
392-
path: cmd/.*
393390
- linters:
394391
- lll
395392
- govet
@@ -405,6 +402,7 @@ linters:
405402
- mnd
406403
- dupl
407404
- gosec
405+
- goconst
408406
path: internal/controller/.*/.*_test\.go
409407
- linters:
410408
- revive

internal/controller/postgresql/postgresqluserrole_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,7 @@ func (*PostgresqlUserRoleReconciler) getDBRoleFromPrivilege(
781781
dbInstance *v1alpha1.PostgresqlDatabase,
782782
userRolePrivilege *v1alpha1.PostgresqlUserRolePrivilege,
783783
) string {
784+
//nolint:exhaustive
784785
switch userRolePrivilege.Privilege {
785786
case v1alpha1.ReaderPrivilege:
786787
return dbInstance.Status.Roles.Reader

internal/controller/postgresql/postgresqluserrole_controller_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5517,7 +5517,7 @@ var _ = Describe("PostgresqlUserRole tests", func() {
55175517
item2 := &v1alpha1.PostgresqlUserRole{}
55185518
Eventually(
55195519
func() error {
5520-
k8sClient.Get(ctx, types.NamespacedName{
5520+
err = k8sClient.Get(ctx, types.NamespacedName{
55215521
Name: pgurName,
55225522
Namespace: pgurNamespace,
55235523
}, item2)
@@ -5554,7 +5554,7 @@ var _ = Describe("PostgresqlUserRole tests", func() {
55545554
item3 := &v1alpha1.PostgresqlUserRole{}
55555555
Eventually(
55565556
func() error {
5557-
k8sClient.Get(ctx, types.NamespacedName{
5557+
err = k8sClient.Get(ctx, types.NamespacedName{
55585558
Name: pgurName,
55595559
Namespace: pgurNamespace,
55605560
}, item3)

internal/controller/postgresql/suite_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ func deletePGPublication(ctx context.Context, cl client.Client, name, namespace
992992

993993
func deleteSQLDBs(name string) error {
994994
// Query template
995-
GetAllCreatedSQLDBTemplate := "SELECT datname FROM pg_database WHERE datname LIKE '%" + name + "%';"
995+
getAllCreatedSQLDBTemplate := "SELECT datname FROM pg_database WHERE datname LIKE '%" + name + "%';"
996996

997997
if mainDBConn == nil {
998998
db, err := sql.Open("postgres", postgresUrl)
@@ -1003,7 +1003,7 @@ func deleteSQLDBs(name string) error {
10031003
mainDBConn = db
10041004
}
10051005

1006-
res, err := mainDBConn.Query(GetAllCreatedSQLDBTemplate)
1006+
res, err := mainDBConn.Query(getAllCreatedSQLDBTemplate)
10071007
if err != nil {
10081008
return err
10091009
}

0 commit comments

Comments
 (0)