Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify Repack and Vacuum API docs and fix wrong error message #248

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apis/vshn/v1/dbaas_vshn_postgresql.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package v1

import (
"fmt"

xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
sgv1 "github.com/vshn/appcat/v4/apis/stackgres/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -148,9 +149,11 @@ type VSHNPostgreSQLServiceSpec struct {
PgBouncerSettings *sgv1.SGPoolingConfigSpecPgBouncerPgbouncerIni `json:"pgBouncerSettings,omitempty"`

// +kubebuilder:default=true
// This is default option if neither repack or vacuum are selected
// RepackEnabled defines if `pg_repack` should be performed during the maintenance. Defaults to true.
RepackEnabled bool `json:"repackEnabled,omitempty"`

// +kubebuilder:default=false
// VacuumEnabled defines if `VACUUM` should be performed during the maintenace. Defaults to false.
VacuumEnabled bool `json:"vacuumEnabled,omitempty"`

// Access defines additional users and databases for this instance.
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/webhooks/postgresql.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ func (p *PostgreSQLWebhookHandler) checkGuaranteedAvailability(pg *vshnv1.VSHNPo
// validate vacuum and repack settings
func validateVacuumRepack(vacuum, repack bool) error {
if !vacuum && !repack {
return fmt.Errorf("repack cannot be enabled without vacuum")
return fmt.Errorf("can't disable vacuum and repack at the same time")
}
return nil
}
Expand Down
Loading