Skip to content

Commit 5968c11

Browse files
Merge pull request #4960 from RishabhSaini/pisMCNspec
MCO-1627: Get rid of setting mcn.Spec.PinnedImageSets field
2 parents 9026ff2 + ae28e0f commit 5968c11

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

pkg/daemon/pinned_image_set.go

-7
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,6 @@ func (p *PinnedImageSetManager) updateStatusProgressing(pools []*mcfgv1.MachineC
540540
if err != nil {
541541
return fmt.Errorf("failed to get image set apply configs: %w", err)
542542
}
543-
imageSetSpec := getPinnedImageSetSpecForPools(pools)
544543

545544
// Get MCP associated with node
546545
pool, err := helpers.GetPrimaryPoolNameForMCN(p.mcpLister, node)
@@ -560,7 +559,6 @@ func (p *PinnedImageSetManager) updateStatusProgressing(pools []*mcfgv1.MachineC
560559
node,
561560
p.mcfgClient,
562561
applyCfg,
563-
imageSetSpec,
564562
p.featureGatesAccessor,
565563
pool,
566564
)
@@ -577,7 +575,6 @@ func (p *PinnedImageSetManager) updateStatusProgressingComplete(pools []*mcfgv1.
577575
if err != nil {
578576
return fmt.Errorf("failed to get image set apply configs: %w", err)
579577
}
580-
imageSetSpec := getPinnedImageSetSpecForPools(pools)
581578

582579
// Get MCP associated with node
583580
pool, err := helpers.GetPrimaryPoolNameForMCN(p.mcpLister, node)
@@ -597,7 +594,6 @@ func (p *PinnedImageSetManager) updateStatusProgressingComplete(pools []*mcfgv1.
597594
node,
598595
p.mcfgClient,
599596
applyCfg,
600-
imageSetSpec,
601597
p.featureGatesAccessor,
602598
pool,
603599
)
@@ -618,7 +614,6 @@ func (p *PinnedImageSetManager) updateStatusProgressingComplete(pools []*mcfgv1.
618614
node,
619615
p.mcfgClient,
620616
nil,
621-
nil,
622617
p.featureGatesAccessor,
623618
pool,
624619
)
@@ -635,7 +630,6 @@ func (p *PinnedImageSetManager) updateStatusError(pools []*mcfgv1.MachineConfigP
635630
if err != nil {
636631
return fmt.Errorf("failed to get image set apply configs: %w", err)
637632
}
638-
imageSetSpec := getPinnedImageSetSpecForPools(pools)
639633

640634
var errMsg string
641635
if isErrNoSpace(statusErr) {
@@ -663,7 +657,6 @@ func (p *PinnedImageSetManager) updateStatusError(pools []*mcfgv1.MachineConfigP
663657
node,
664658
p.mcfgClient,
665659
applyCfg,
666-
imageSetSpec,
667660
p.featureGatesAccessor,
668661
pool,
669662
)

pkg/upgrademonitor/upgrade_monitor.go

+2-7
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func GenerateAndApplyMachineConfigNodes(
4343
fgAccessor featuregates.FeatureGateAccess,
4444
pool string,
4545
) error {
46-
return generateAndApplyMachineConfigNodes(parentCondition, childCondition, parentStatus, childStatus, node, mcfgClient, nil, nil, fgAccessor, pool)
46+
return generateAndApplyMachineConfigNodes(parentCondition, childCondition, parentStatus, childStatus, node, mcfgClient, nil, fgAccessor, pool)
4747
}
4848

4949
func UpdateMachineConfigNodeStatus(
@@ -54,11 +54,10 @@ func UpdateMachineConfigNodeStatus(
5454
node *corev1.Node,
5555
mcfgClient mcfgclientset.Interface,
5656
imageSetApplyConfig []*machineconfigurationalphav1.MachineConfigNodeStatusPinnedImageSetApplyConfiguration,
57-
imageSetSpec []mcfgalphav1.MachineConfigNodeSpecPinnedImageSet,
5857
fgAccessor featuregates.FeatureGateAccess,
5958
pool string,
6059
) error {
61-
return generateAndApplyMachineConfigNodes(parentCondition, childCondition, parentStatus, childStatus, node, mcfgClient, imageSetApplyConfig, imageSetSpec, fgAccessor, pool)
60+
return generateAndApplyMachineConfigNodes(parentCondition, childCondition, parentStatus, childStatus, node, mcfgClient, imageSetApplyConfig, fgAccessor, pool)
6261
}
6362

6463
// Helper function to convert metav1.Condition to ConditionApplyConfiguration
@@ -90,7 +89,6 @@ func generateAndApplyMachineConfigNodes(
9089
node *corev1.Node,
9190
mcfgClient mcfgclientset.Interface,
9291
imageSetApplyConfig []*machineconfigurationalphav1.MachineConfigNodeStatusPinnedImageSetApplyConfiguration,
93-
imageSetSpec []mcfgalphav1.MachineConfigNodeSpecPinnedImageSet,
9492
fgAccessor featuregates.FeatureGateAccess,
9593
pool string,
9694
) error {
@@ -300,9 +298,6 @@ func generateAndApplyMachineConfigNodes(
300298
newMCNode.Name = node.Name
301299
newMCNode.Spec.Pool = mcfgalphav1.MCOObjectReference{Name: pool}
302300
newMCNode.Spec.Node = mcfgalphav1.MCOObjectReference{Name: node.Name}
303-
if imageSetSpec != nil {
304-
newMCNode.Spec.PinnedImageSets = imageSetSpec
305-
}
306301

307302
_, err := mcfgClient.MachineconfigurationV1alpha1().MachineConfigNodes().Create(context.TODO(), newMCNode, metav1.CreateOptions{})
308303
if err != nil {

0 commit comments

Comments
 (0)