Skip to content

Commit

Permalink
moving variable to be global
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz.widera@vshn.ch committed Sep 12, 2024
1 parent fa730c5 commit b603114
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions pkg/controller/webhooks/postgresql.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,24 @@ var (

var _ webhook.CustomValidator = &PostgreSQLWebhookHandler{}

var blocklist = map[string]string{
"listen_addresses": "",
"port": "",
"cluster_name": "",
"hot_standby": "",
"fsync": "",
"full_page_writes": "",
"log_destination": "",
"logging_collector": "",
"max_replication_slots": "",
"max_wal_senders": "",
"wal_keep_segments": "",
"wal_level": "",
"wal_log_hints": "",
"archive_mode": "",
"archive_command": "",
}

// PostgreSQLWebhookHandler handles all quota webhooks concerning postgresql by vshn.
type PostgreSQLWebhookHandler struct {
DefaultWebhookHandler
Expand Down Expand Up @@ -317,24 +335,6 @@ func validatePgConf(pg *vshnv1.VSHNPostgreSQL) (fErros field.ErrorList) {
}
}

blocklist := map[string]string{
"listen_addresses": "",
"port": "",
"cluster_name": "",
"hot_standby": "",
"fsync": "",
"full_page_writes": "",
"log_destination": "",
"logging_collector": "",
"max_replication_slots": "",
"max_wal_senders": "",
"wal_keep_segments": "",
"wal_level": "",
"wal_log_hints": "",
"archive_mode": "",
"archive_command": "",
}

for key := range pgConf {
if _, ok := blocklist[key]; ok {
fErros = append(fErros, &field.Error{
Expand Down

0 comments on commit b603114

Please sign in to comment.