Skip to content

Commit

Permalink
Fix availabilityGroup panic; Set defults to logBackupOptions
Browse files Browse the repository at this point in the history
Signed-off-by: Arnob kumar saha <[email protected]>
  • Loading branch information
ArnobKumarSaha committed Dec 18, 2024
1 parent e677abc commit ab19a9d
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 30 deletions.
2 changes: 1 addition & 1 deletion apis/archiver/v1alpha1/mariadbarchiver_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ type MariaDBArchiverSpec struct {
FullBackup *FullBackupOptions `json:"fullBackup"`
// LogBackup defines the sidekick configuration for the log backup
// +optional
LogBackup *LogBackupOptions `json:"logBackup"`
LogBackup LogBackupOptions `json:"logBackup"`
// ManifestBackup defines the session configuration for the manifest backup
// This options will eventually go to the manifest-backup job's yaml
// +optional
Expand Down
2 changes: 1 addition & 1 deletion apis/archiver/v1alpha1/mongodbarchiver_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ type MongoDBArchiverSpec struct {
FullBackup *FullBackupOptions `json:"fullBackup"`
// LogBackup defines the sidekick configuration for the log backup
// +optional
LogBackup *LogBackupOptions `json:"logBackup"`
LogBackup LogBackupOptions `json:"logBackup"`
// ManifestBackup defines the sessionConfig of the manifestBackup
// This options will eventually go to the manifest-backup job's yaml
// +optional
Expand Down
2 changes: 1 addition & 1 deletion apis/archiver/v1alpha1/mssqlserverarchiver_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ type MSSQLServerArchiverSpec struct {
FullBackup *FullBackupOptions `json:"fullBackup"`
// LogBackup defines the sidekick configuration for the log backup
// +optional
LogBackup *LogBackupOptions `json:"logBackup"`
LogBackup LogBackupOptions `json:"logBackup"`
// ManifestBackup defines the sessionConfig of the manifestBackup
// This options will eventually go to the manifest-backup job's yaml
// +optional
Expand Down
2 changes: 1 addition & 1 deletion apis/archiver/v1alpha1/mysqlarchiver_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ type MySQLArchiverSpec struct {
FullBackup *FullBackupOptions `json:"fullBackup"`
// LogBackup defines the sidekick configuration for the log backup
// +optional
LogBackup *LogBackupOptions `json:"logBackup"`
LogBackup LogBackupOptions `json:"logBackup"`
// ManifestBackup defines the sessionConfig of the manifestBackup
// This options will eventually go to the manifest-backup job's yaml
// +optional
Expand Down
5 changes: 5 additions & 0 deletions apis/archiver/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apis/archiver/v1alpha1/postgresarchiver_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ type PostgresArchiverSpec struct {
FullBackup *FullBackupOptions `json:"fullBackup"`
// LogBackup defines the sidekick configuration for the log backup
// +optional
LogBackup *LogBackupOptions `json:"logBackup"`
LogBackup LogBackupOptions `json:"logBackup"`
// ManifestBackup defines the sessionConfig of the manifestBackup
// This options will eventually go to the manifest-backup job's yaml
// +optional
Expand Down
30 changes: 5 additions & 25 deletions apis/archiver/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions apis/kubedb/v1alpha2/mssqlserver_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,9 @@ func (m *MSSQLServer) SetDefaults() {
m.Spec.Replicas = pointer.Int32P(1)
}
} else if m.IsAvailabilityGroup() {
if m.Spec.Topology.AvailabilityGroup == nil {
m.Spec.Topology.AvailabilityGroup = &MSSQLServerAvailabilityGroupSpec{}
}
if m.Spec.Topology.AvailabilityGroup.LeaderElection == nil {
m.Spec.Topology.AvailabilityGroup.LeaderElection = &MSSQLServerLeaderElectionConfig{
// The upper limit of election timeout is 50000ms (50s), which should only be used when deploying a
Expand Down

0 comments on commit ab19a9d

Please sign in to comment.