Custom Resource Keys Migration During Upgrade
This guide explains how custom resource keys are migrated during the Digital.ai Release operator upgrade process. Understanding this process is crucial for maintaining your configuration when upgrading to newer versions of the operator.
Starting from Release 23.3, there are changes to how the system handles the response to the following upgrade prompt:
Edit list of custom resource keys that will migrate to the new Release CR:
The custom resource keys migration list defines the mapping between previous versions and the target upgrade version. This mapping ensures your configuration data is correctly preserved during the upgrade process.
Migration Mapping Examples
Here is an example of the migration mapping structure:
.metadata.name: .
.spec.persistence.storageClass:
    0.0: .spec.Persistence.StorageClass
    23.3: .
.spec.auth.adminPassword: 
    0.0: .spec.AdminPassword
    23.3: .
.spec.replicaCount: .
.spec.persistence.accessModes.[0]:
    0.0: .spec.Persistence.AccessMode
    23.3:
.spec.persistence.accessModes:
    0.0:
    23.3: .
.spec.persistence.size:
    0.0: .spec.Persistence.Size
    23.3: .
.spec.persistence.existingClaim:
    0.0:
        existance: .spec.Persistence.ExistingClaim
        expression: .spec.Persistence.ExistingClaim
    23.3: .
Understanding Different Mapping Types
Let's examine the different types of mappings and their purposes:
Simple Path Mapping
.metadata.name: .
This represents the simplest form of mapping. Here, .metadata.name from the old CR will be copied directly to the same path in the new CR. The . indicates the path remains identical.
Version-Specific Path Mapping
.spec.auth.adminPassword:
  0.0: .spec.AdminPassword
  23.3: .
This type of mapping defines different paths based on the source version:
- For versions before 23.3: Uses 
.spec.AdminPasswordas the source path - From version 23.3 onwards: Uses the same path (
.spec.auth.adminPassword) 
Conditional Mapping
.spec.persistence.accessModes:
  0.0:
  23.3: .
This mapping type:
- For versions before 23.3: No migration occurs (empty mapping)
 - From version 23.3 onwards: Migrates from the same path
 
Complex Expression Mapping
.spec.persistence.existingClaim:
  0.0:
    existence: .spec.persistence.existingClaim
    expression: .spec.persistence.existingClaim
  23.3: .
This advanced mapping type uses conditions and expressions:
- For versions before 23.3: Checks for a 
truevalue and uses a customyqexpression - From version 23.3 onwards: Uses direct path mapping