Skip to content

Commit 39b569c

Browse files
authored
Merge branch 'main' into merge_v10.0
2 parents b09a9a9 + 45ffa3f commit 39b569c

5 files changed

Lines changed: 41 additions & 1 deletion

File tree

pkg/apis/acid.zalan.do/v1/crds.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@ var PostgresCRDResourceValidation = apiextv1.CustomResourceValidation{
372372
Ref: ref("k8s.io/api/core/v1.TopologySpreadConstraint"),
373373
},
374374
},
375+
375376
},
376377
},
377378
},

pkg/apis/acid.zalan.do/v1/postgresql_type.go

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,3 +302,39 @@ type Configuration struct {
302302
type TDE struct {
303303
Enable bool `json:"enable"`
304304
}
305+
306+
type Backup struct {
307+
Pgbackrest *Pgbackrest `json:"pgbackrest"`
308+
}
309+
310+
type Pgbackrest struct {
311+
Image string `json:"image"`
312+
Global map[string]string `json:"global"`
313+
Repos []Repo `json:"repos"`
314+
Restore Restore `json:"restore"`
315+
Configuration Configuration `json:"configuration"`
316+
Resources *Resources `json:"resources,omitempty"`
317+
}
318+
319+
type Repo struct {
320+
Name string `json:"name"`
321+
Storage string `json:"storage"`
322+
Resource string `json:"resource"`
323+
Endpoint string `json:"endpoint"`
324+
Region string `json:"region"`
325+
Schedule map[string]string `json:"schedule"`
326+
}
327+
328+
type Restore struct {
329+
ID string `json:"id"`
330+
Repo string `json:"repo"`
331+
Options []string `json:"options"`
332+
}
333+
334+
type Configuration struct {
335+
Secret string `json:"secret"`
336+
}
337+
338+
type TDE struct {
339+
Enable bool `json:"enable"`
340+
}

pkg/cluster/cluster.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,6 @@ func (c *Cluster) Update(oldSpec, newSpec *acidv1.Postgresql) error {
982982
c.Status.PgbackrestRestoreID = c.Postgresql.Spec.Backup.Pgbackrest.Restore.ID
983983
c.logger.Info("a pgbackrest restore config has been successfully synced")
984984
}
985-
986985
} else {
987986

988987
if err := c.deletePgbackrestConfig(); err != nil {

pkg/cluster/connection_pooler.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ func (c *Cluster) generateConnectionPoolerPodTemplate(role PostgresRole) (
380380
poolerContainer.Env = envVars
381381
poolerContainer.VolumeMounts = volumeMounts
382382
tolerationsSpec := tolerations(&spec.Tolerations, c.OpConfig.PodToleration)
383+
383384
securityContext := v1.PodSecurityContext{}
384385

385386
// determine the User, Group and FSGroup for the pooler pod
@@ -393,6 +394,7 @@ func (c *Cluster) generateConnectionPoolerPodTemplate(role PostgresRole) (
393394
if effectiveFSGroup != nil {
394395
securityContext.FSGroup = effectiveFSGroup
395396
}
397+
396398
topologySpreadConstraintsSpec := topologySpreadConstraints(&spec.TopologySpreadConstraints)
397399

398400
podTemplate := &v1.PodTemplateSpec{

pkg/cluster/k8sres.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1543,6 +1543,7 @@ func (c *Cluster) generateStatefulSet(spec *acidv1.PostgresSpec) (*appsv1.Statef
15431543
}
15441544
resources = *resourceRequirements
15451545
}
1546+
15461547
if c.Postgresql.Spec.Backup != nil && c.Postgresql.Spec.Backup.Pgbackrest != nil {
15471548

15481549
pgbackrestRestoreEnvVars := appendEnvVars(
@@ -1625,6 +1626,7 @@ func (c *Cluster) generateStatefulSet(spec *acidv1.PostgresSpec) (*appsv1.Statef
16251626
}
16261627
resources = *resourceRequirements
16271628
}
1629+
16281630
initContainers = append(initContainers, v1.Container{
16291631
Name: "pgbackrest-restore",
16301632
Image: spec.Backup.Pgbackrest.Image,

0 commit comments

Comments
 (0)