Skip to main content
Version: Deploy 24.1

Custom resource keys migration during upgrade

From 23.3 version, there are changes how is working answer to the question: Edit list of custom resource keys that will migrate to the new Deploy CR:.

The list of the custom resource keys that are used in migration is for mapping between a previous version and new version to which we are doing upgrade.

Here is a snippet of the answer:

.metadata.name: .
.spec.global.storageClass:
0.0: .spec.Persistence.StorageClass
23.3: .
.spec.auth.adminPassword:
0.0: .spec.AdminPassword
23.3: .
.spec.centralConfiguration.replicaCount: .
.spec.centralConfiguration.persistence.accessModes[0]:
0.0: .spec.Persistence.AccessMode
23.3:
.spec.centralConfiguration.persistence.accessModes:
0.0:
23.3: .
.spec.centralConfiguration.persistence.size:
0.0: .spec.centralConfiguration.persistence.pvcSize
23.3: .
.spec.centralConfiguration.persistence.existingClaim:
0.0:
existence: .spec.deploy.centralConfiguration.persistence.existingClaim
expression: .spec.deploy.centralConfiguration.persistence.existingClaim
23.3: .

Here we will explain different mapping types:

.metadata.name: .

The .metadata.name is path in the new version CR. The value . represents the same path. This mapping defines that old version CR value under path .metadata.name will be copied to the new version CR under the same path.

.spec.auth.adminPassword:
0.0: .spec.AdminPassword
23.3: .

The .spec.auth.adminPassword is path in the new version CR. The value here is composed of two parts:

  • 0.0: .spec.AdminPassword - for versions below 23.3 (the next key below) it is using this mapping path for the old version CR.
  • 23.3: . - for versions from 23.3 it is using this mapping path for the old version CR.

This mapping defined that old version CR, for versions below 23.3, is using .spec.AdminPassword as a source of value, that is migrated under path .spec.auth.adminPassword in the new version CR. From version 23.3 it is using .spec.auth.adminPassword as a source of value, same path as where the value will be migrated to the new CR.

.spec.centralConfiguration.persistence.accessModes:
0.0:
23.3: .

The .spec.centralConfiguration.persistence.accessModes is path in the new version CR. The value here is composed of two parts:

  • 0.0: - for versions below 23.3 (the next key below) it is not mapping the value because this mapping is empty.
  • 23.3: . - for versions from 23.3 it is using this mapping path for the old version CR.

This mapping does not define that old version CR, for versions below 23.3, it it not migrating the value. From version 23.3 it is using .spec.centralConfiguration.persistence.accessModes as a source of value, same path as where the value will be migrated to the new CR.

.spec.centralConfiguration.persistence.existingClaim:
0.0:
existence: .spec.deploy.centralConfiguration.persistence.existingClaim
expression: .spec.deploy.centralConfiguration.persistence.existingClaim
23.3: .

The .spec.centralConfiguration.persistence.existingClaim is path in the new version CR. The value here is composed of two parts:

0.0:
existence: .spec.deploy.centralConfiguration.persistence.existingClaim
expression: .spec.deploy.centralConfiguration.persistence.existingClaim
  • for versions below 23.3 (the next key below) it is using this complex expression for the old version CR.
  • 23.3: . - for versions from 23.3 it is using this mapping path for the old version CR.

This mapping defined that old version CR, for versions below 23.3, is checking if there is true value under .spec.deploy.centralConfiguration.persistence.existingClaim and it is using same value as a source of value (defined by expression), that is migrated under path .spec.centralConfiguration.persistence.existingClaim in the new version CR. expression can be any kind of expression that is possible to evaluate with yq. From version 23.3 it is using .spec.centralConfiguration.persistence.existingClaim as a source of value, same path as where the value will be migrated to the new CR.