Skip to content
Merged
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
4 changes: 4 additions & 0 deletions api/v1/postgres_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ const (
StandbyMethod = "streaming_host"
// PartitionIDLabelName Name of the managed-by label
PartitionIDLabelName string = "postgres.database.fits.cloud/partition-id"
// PostgresVersionLabelName Name of the version label
PostgresVersionLabelName string = "postgres.database.fits.cloud/version"

ApplicationLabelName = "application"
ApplicationLabelValue = "spilo"
Expand Down Expand Up @@ -679,6 +681,8 @@ func (p *Postgres) ToUnstructuredZalandoPostgresql(z *zalando.Postgresql, c *cor
// Add the newly introduced label only here, not in p.ToZalandoPostgresqlMatchingLabels() (so that the selectors using p.ToZalandoPostgresqlMatchingLabels() will still work until all postgres resources have that new label)
// TODO once all the custom resources have that new label, move this part to p.ToZalandoPostgresqlMatchingLabels()
z.Labels[PartitionIDLabelName] = p.Spec.PartitionID
// Add the additional version label to the custom resource
z.Labels[PostgresVersionLabelName] = p.Spec.Version

if image != "" {
z.Spec.DockerImage = image
Expand Down
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ func main() {
pgParamBlockList[blockedParam] = true
}

// be careful changing this value if you also set the pg.PostgresVersionLabelName inherited_label
viper.SetDefault(majorVersionUpgradeModeFlg, "manual")
majorVersionUpgradeMode = viper.GetString(majorVersionUpgradeModeFlg)

Expand Down
2 changes: 1 addition & 1 deletion pkg/operatormanager/operatormanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ func (m *OperatorManager) editConfigMap(cm *corev1.ConfigMap, namespace string,
// set the reference to our custom pod environment secret
cm.Data["pod_environment_secret"] = PodEnvSecretName
// set the list of inherited labels that will be passed on to the pods
s := []string{pg.TenantLabelName, pg.ProjectIDLabelName, pg.UIDLabelName, pg.NameLabelName, pg.PartitionIDLabelName}
s := []string{pg.TenantLabelName, pg.ProjectIDLabelName, pg.UIDLabelName, pg.NameLabelName, pg.PartitionIDLabelName, pg.PostgresVersionLabelName}
// TODO maybe use a precompiled string here
cm.Data["inherited_labels"] = strings.Join(s, ",")

Expand Down
Loading