Skip to content

Commit

Permalink
Merge pull request #4223 from cdoern/mcn-owner
Browse files Browse the repository at this point in the history
OCPBUGS-30090: add node owner to MCN
  • Loading branch information
openshift-merge-bot[bot] committed Mar 1, 2024
2 parents 1738652 + fdf150e commit 922db99
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/operator/sync.go
Expand Up @@ -764,6 +764,14 @@ func (optr *Operator) syncMachineConfigNodes(_ *renderConfig) error {
},
ObjectMeta: metav1.ObjectMeta{
Name: node.Name,
OwnerReferences: []metav1.OwnerReference{
{
APIVersion: node.APIVersion,
Name: node.ObjectMeta.Name,
Kind: node.Kind,
UID: node.ObjectMeta.UID,
},
},
},
}
mcsBytes, err := json.Marshal(newMCS)
Expand Down
8 changes: 8 additions & 0 deletions pkg/upgrademonitor/upgrade_monitor.go
Expand Up @@ -249,6 +249,14 @@ func GenerateAndApplyMachineConfigNodeSpec(fgAccessor featuregates.FeatureGateAc
mcNode, needNewMCNode := createOrGetMachineConfigNode(mcfgClient, node)
newMCNode := mcNode.DeepCopy()
// set the spec config version
newMCNode.ObjectMeta.OwnerReferences = []metav1.OwnerReference{
{
APIVersion: node.APIVersion,
Name: node.ObjectMeta.Name,
Kind: node.Kind,
UID: node.ObjectMeta.UID,
},
}
newMCNode.Spec.ConfigVersion = mcfgalphav1.MachineConfigNodeSpecMachineConfigVersion{
Desired: node.Annotations["machineconfiguration.openshift.io/desiredConfig"],
}
Expand Down

0 comments on commit 922db99

Please sign in to comment.