don't be too hard to 9.5
This commit is contained in:
		
							parent
							
								
									3debbe2749
								
							
						
					
					
						commit
						578a2f5fd2
					
				| 
						 | 
					@ -362,6 +362,7 @@ spec:
 | 
				
			||||||
                  version:
 | 
					                  version:
 | 
				
			||||||
                    type: string
 | 
					                    type: string
 | 
				
			||||||
                    enum:
 | 
					                    enum:
 | 
				
			||||||
 | 
					                      - "9.5"
 | 
				
			||||||
                      - "9.6"
 | 
					                      - "9.6"
 | 
				
			||||||
                      - "10"
 | 
					                      - "10"
 | 
				
			||||||
                      - "11"
 | 
					                      - "11"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -358,6 +358,7 @@ spec:
 | 
				
			||||||
                  version:
 | 
					                  version:
 | 
				
			||||||
                    type: string
 | 
					                    type: string
 | 
				
			||||||
                    enum:
 | 
					                    enum:
 | 
				
			||||||
 | 
					                      - "9.5"
 | 
				
			||||||
                      - "9.6"
 | 
					                      - "9.6"
 | 
				
			||||||
                      - "10"
 | 
					                      - "10"
 | 
				
			||||||
                      - "11"
 | 
					                      - "11"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -504,6 +504,9 @@ var PostgresCRDResourceValidation = apiextv1.CustomResourceValidation{
 | 
				
			||||||
							"version": {
 | 
												"version": {
 | 
				
			||||||
								Type: "string",
 | 
													Type: "string",
 | 
				
			||||||
								Enum: []apiextv1.JSON{
 | 
													Enum: []apiextv1.JSON{
 | 
				
			||||||
 | 
														{
 | 
				
			||||||
 | 
															Raw: []byte(`"9.5"`),
 | 
				
			||||||
 | 
														},
 | 
				
			||||||
									{
 | 
														{
 | 
				
			||||||
										Raw: []byte(`"9.6"`),
 | 
															Raw: []byte(`"9.6"`),
 | 
				
			||||||
									},
 | 
														},
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -9,6 +9,7 @@ import (
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// VersionMap Map of version numbers
 | 
					// VersionMap Map of version numbers
 | 
				
			||||||
var VersionMap = map[string]int{
 | 
					var VersionMap = map[string]int{
 | 
				
			||||||
 | 
						"9.5": 90500,
 | 
				
			||||||
	"9.6": 90600,
 | 
						"9.6": 90600,
 | 
				
			||||||
	"10":  100000,
 | 
						"10":  100000,
 | 
				
			||||||
	"11":  110000,
 | 
						"11":  110000,
 | 
				
			||||||
| 
						 | 
					@ -33,7 +34,7 @@ func (c *Cluster) GetDesiredMajorVersionAsInt() int {
 | 
				
			||||||
func (c *Cluster) GetDesiredMajorVersion() string {
 | 
					func (c *Cluster) GetDesiredMajorVersion() string {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if c.Config.OpConfig.MajorVersionUpgradeMode == "full" {
 | 
						if c.Config.OpConfig.MajorVersionUpgradeMode == "full" {
 | 
				
			||||||
		// current is 9.6, minimal is 11 allowing 11 to 14 clusters, everything below is upgraded
 | 
							// e.g. current is 9.6, minimal is 11 allowing 11 to 14 clusters, everything below is upgraded
 | 
				
			||||||
		if IsBiggerPostgresVersion(c.Spec.PgVersion, c.Config.OpConfig.MinimalMajorVersion) {
 | 
							if IsBiggerPostgresVersion(c.Spec.PgVersion, c.Config.OpConfig.MinimalMajorVersion) {
 | 
				
			||||||
			c.logger.Infof("overwriting configured major version %s to %s", c.Spec.PgVersion, c.Config.OpConfig.TargetMajorVersion)
 | 
								c.logger.Infof("overwriting configured major version %s to %s", c.Spec.PgVersion, c.Config.OpConfig.TargetMajorVersion)
 | 
				
			||||||
			return c.Config.OpConfig.TargetMajorVersion
 | 
								return c.Config.OpConfig.TargetMajorVersion
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -308,7 +308,7 @@ def read_versions(
 | 
				
			||||||
        if uid == 'wal' or defaulting(lambda: UUID(uid))
 | 
					        if uid == 'wal' or defaulting(lambda: UUID(uid))
 | 
				
			||||||
    ]
 | 
					    ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
BACKUP_VERSION_PREFIXES = ['', '9.6/', '10/', '11/', '12/', '13/', '14/']
 | 
					BACKUP_VERSION_PREFIXES = ['', '9.5/', '9.6/', '10/', '11/', '12/', '13/', '14/']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def read_basebackups(
 | 
					def read_basebackups(
 | 
				
			||||||
    pg_cluster,
 | 
					    pg_cluster,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue