@@ -84,12 +84,8 @@ func (m *crdMigrator) run(ctx context.Context, newCRD *apiextensionsv1.CustomRes
84
84
85
85
// Gets the list of version supported by the new CRD
86
86
newVersions := sets.Set [string ]{}
87
- servedVersions := sets.Set [string ]{}
88
87
for _ , version := range newCRD .Spec .Versions {
89
88
newVersions .Insert (version .Name )
90
- if version .Served {
91
- servedVersions .Insert (version .Name )
92
- }
93
89
}
94
90
95
91
// Get the current CRD.
@@ -130,9 +126,8 @@ func (m *crdMigrator) run(ctx context.Context, newCRD *apiextensionsv1.CustomRes
130
126
// This way we can make sure that all CR objects are now stored in the current storage version.
131
127
// Alternatively, we would have to figure out which objects are stored in which version but this information is not
132
128
// exposed by the apiserver.
133
- storedVersionsToDelete := currentStatusStoredVersions .Difference (servedVersions )
134
- storedVersionsToPreserve := currentStatusStoredVersions .Intersection (servedVersions )
135
- log .Info ("CR migration required" , "kind" , newCRD .Spec .Names .Kind , "storedVersionsToDelete" , strings .Join (sets .List (storedVersionsToDelete ), "," ), "storedVersionsToPreserve" , strings .Join (sets .List (storedVersionsToPreserve ), "," ))
129
+ storedVersionsToDelete := currentStatusStoredVersions .Delete (currentStorageVersion )
130
+ log .Info ("CR migration required" , "kind" , newCRD .Spec .Names .Kind , "storedVersionsToDelete" , strings .Join (sets .List (storedVersionsToDelete ), "," ), "storedVersionToPreserve" , currentStorageVersion )
136
131
137
132
if err := m .migrateResourcesForCRD (ctx , currentCRD , currentStorageVersion ); err != nil {
138
133
return false , err
@@ -239,12 +234,12 @@ func storageVersionForCRD(crd *apiextensionsv1.CustomResourceDefinition) (string
239
234
// During this timespan conversion, validating- or mutationwebhooks may be unavailable and cause a failure.
240
235
func newCRDMigrationBackoff () wait.Backoff {
241
236
// Return a exponential backoff configuration which returns durations for a total time of ~1m30s.
242
- // Example: 0, .25s, .6s, 1.2, 2.1s, 3. 4s, 5.5s, 8s , 12s, 19s, 28s, 43s, 64s, 97s
237
+ // Example: 0, .25s, .6s, 1.1s, 1.8s, 2.7s, 4s, 6s, 9s , 12s, 17s, 25s, 35s, 49s, 69s, 97s, 135s
243
238
// Jitter is added as a random fraction of the duration multiplied by the jitter factor.
244
239
return wait.Backoff {
245
- Duration : 500 * time .Millisecond ,
246
- Factor : 1.5 ,
247
- Steps : 9 ,
240
+ Duration : 250 * time .Millisecond ,
241
+ Factor : 1.4 ,
242
+ Steps : 17 ,
248
243
Jitter : 0.1 ,
249
244
}
250
245
}
0 commit comments