File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -268,11 +268,15 @@ func generateAndApplyMachineConfigNodes(
268
268
if fg .Enabled (features .FeatureGatePinnedImages ) {
269
269
if imageSetApplyConfig == nil {
270
270
for _ , imageSet := range newMCNode .Status .PinnedImageSets {
271
+ // By default, a PinnedImageSet reference must include the name of the PIS and the desired generation
271
272
pisApplyConfig := & machineconfigurationv1.MachineConfigNodeStatusPinnedImageSetApplyConfiguration {
272
273
DesiredGeneration : ptr .To (imageSet .DesiredGeneration ),
273
- CurrentGeneration : ptr .To (imageSet .CurrentGeneration ),
274
274
Name : ptr .To (imageSet .Name ),
275
275
}
276
+ // Only set `CurrentGeneration` value when we are currently on a valid generation (imageSet.CurrentGeneration value is non-0)
277
+ if imageSet .CurrentGeneration != 0 {
278
+ pisApplyConfig .CurrentGeneration = ptr .To (imageSet .CurrentGeneration )
279
+ }
276
280
// Only set `LastFailedGeneration` value when it is a non-default (non-0) value
277
281
if imageSet .LastFailedGeneration != 0 {
278
282
pisApplyConfig .LastFailedGeneration = ptr .To (imageSet .LastFailedGeneration )
You can’t perform that action at this time.
0 commit comments