Skip to content

Conversation

@openshift-cherrypick-robot

This is an automated cherry-pick of #5086

/assign sdodson

If a MachineConfig is applied with empty systemd unit contents, the MCD
will degrade because it skips writing the file in that particular
situation. For parity with the CoreOS Ignition implementation, we should
not attempt to enable or disable any systemd units where the unit file
does not have any contents.
@openshift-ci-robot
Copy link
Contributor

@openshift-cherrypick-robot: Jira Issue OCPBUGS-56648 has been cloned as Jira Issue OCPBUGS-65898. Will retitle bug to link to clone.
/retitle [release-4.20] OCPBUGS-65898: fixes systemd unit creation for empty units

In response to this:

This is an automated cherry-pick of #5086

/assign sdodson

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot changed the title [release-4.20] OCPBUGS-56648: fixes systemd unit creation for empty units [release-4.20] OCPBUGS-65898: fixes systemd unit creation for empty units Nov 23, 2025
@openshift-ci-robot openshift-ci-robot added jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Nov 23, 2025
@openshift-ci-robot
Copy link
Contributor

@openshift-cherrypick-robot: This pull request references Jira Issue OCPBUGS-65898, which is invalid:

  • release note text must be set and not match the template OR release note type must be set to "Release Note Not Required". For more information you can reference the OpenShift Bug Process.

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

This is an automated cherry-pick of #5086

/assign sdodson

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@sdodson
Copy link
Member

sdodson commented Nov 23, 2025

/assign @cheesesashimi

Copy link
Member

@isabella-janssen isabella-janssen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/label backport-risk-assessed

Looks like a clean backport to me!

@openshift-ci openshift-ci bot added the backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. label Dec 3, 2025
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 3, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 3, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: isabella-janssen, openshift-cherrypick-robot

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 3, 2025
@cheesesashimi
Copy link
Member

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Dec 3, 2025
@openshift-ci-robot
Copy link
Contributor

@cheesesashimi: This pull request references Jira Issue OCPBUGS-65898, which is valid. The bug has been moved to the POST state.

7 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.20.z) matches configured target version for branch (4.20.z)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)
  • release note type set to "Release Note Not Required"
  • dependent bug Jira Issue OCPBUGS-56648 is in the state Verified, which is one of the valid states (VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA))
  • dependent Jira Issue OCPBUGS-56648 targets the "4.21.0" version, which is one of the valid target versions: 4.21.0
  • bug has dependents

Requesting review from QA contact:
/cc @sergiordlr

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested a review from sergiordlr December 3, 2025 19:50
@sergiordlr
Copy link
Contributor

Verified using IPI on AWS

  1. Apply a MC with an enabled empty unit
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
  labels:
    machineconfiguration.openshift.io/role: worker
  name: mc-unit-22
spec:
  config:
    ignition:
      version: 2.2.0
    systemd:
      units:
      - name: my22unit.service
        enable: true
  1. Wait for the configuration to be applied. No degradation happens
  2. Check the logs
2025-12-05T10:02:50.927719111+00:00 stderr F I1205 10:02:50.927676    2696 file_writers.go:330] Unit "my22unit.service" has no content, skipping write
2025-12-05T10:02:50.927719111+00:00 stderr F I1205 10:02:50.927699    2696 update.go:2140] Could not enable unit "my22unit.service", because it has no contents, skipping

  1. No unit is created
$ oc debug node/ip-10-0-29-169.us-east-2.compute.internal -q -- chroot /host systemctl status my22unit.service
Unit my22unit.service could not be found.
error: non-zero exit code from debug container
  1. Repeat verification steps in master pool. No issues found.

The following tests were executed and passed:

passed: (14m18s) 2025-12-05T10:33:47 "[sig-mco] MCO NodeDisruptionPolicy Author:rioliu-NonPreRelease-Longduration-High-73411-NodeDisruptionPolicy units with multiple actions [Disruptive] [Serial]"
passed: (25m30s) 2025-12-05T10:59:17 "[sig-mco] MCO Author:sregidor-Longduration-NonPreRelease-High-47008-Config Drift. Dropin file. [Serial]"
passed: (18m29s) 2025-12-05T11:17:46 "[sig-mco] MCO NodeDisruptionPolicy Author:rioliu-NonPreRelease-Longduration-High-73413-[P2] NodeDisruptionPolicy units with action Reboot [Disruptive] [Serial]"
passed: (19m30s) 2025-12-05T11:37:16 "[sig-mco] MCO Author:sregidor-NonPreRelease-Longduration-Medium-56614-[P2][OnCLayer] Create unit with content and mask=true[Disruptive] [Serial]"
passed: (3m32s) 2025-12-05T11:40:48 "[sig-mco] MCO NodeDisruptionPolicy Author:rioliu-NonPreRelease-High-73414-[P1] NodeDisruptionPolicy units with action None [Disruptive] [Serial]"
passed: (25m35s) 2025-12-05T12:06:23 "[sig-mco] MCO Author:sregidor-Longduration-NonPreRelease-High-47009-Config Drift. New Service Unit. [Serial]"


/label qe-approved
/label cherry-pick-approved
/verified by @sergiordlr

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Dec 5, 2025
@openshift-ci-robot
Copy link
Contributor

@sergiordlr: This PR has been marked as verified by @sergiordlr.

In response to this:

Verified using IPI on AWS

  1. Apply a MC with an enabled empty unit
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
 labels:
   machineconfiguration.openshift.io/role: worker
 name: mc-unit-22
spec:
 config:
   ignition:
     version: 2.2.0
   systemd:
     units:
     - name: my22unit.service
       enable: true
  1. Wait for the configuration to be applied. No degradation happens
  2. Check the logs
2025-12-05T10:02:50.927719111+00:00 stderr F I1205 10:02:50.927676    2696 file_writers.go:330] Unit "my22unit.service" has no content, skipping write
2025-12-05T10:02:50.927719111+00:00 stderr F I1205 10:02:50.927699    2696 update.go:2140] Could not enable unit "my22unit.service", because it has no contents, skipping

  1. No unit is created
$ oc debug node/ip-10-0-29-169.us-east-2.compute.internal -q -- chroot /host systemctl status my22unit.service
Unit my22unit.service could not be found.
error: non-zero exit code from debug container
  1. Repeat verification steps in master pool. No issues found.

The following tests were executed and passed:

passed: (14m18s) 2025-12-05T10:33:47 "[sig-mco] MCO NodeDisruptionPolicy Author:rioliu-NonPreRelease-Longduration-High-73411-NodeDisruptionPolicy units with multiple actions [Disruptive] [Serial]"
passed: (25m30s) 2025-12-05T10:59:17 "[sig-mco] MCO Author:sregidor-Longduration-NonPreRelease-High-47008-Config Drift. Dropin file. [Serial]"
passed: (18m29s) 2025-12-05T11:17:46 "[sig-mco] MCO NodeDisruptionPolicy Author:rioliu-NonPreRelease-Longduration-High-73413-[P2] NodeDisruptionPolicy units with action Reboot [Disruptive] [Serial]"
passed: (19m30s) 2025-12-05T11:37:16 "[sig-mco] MCO Author:sregidor-NonPreRelease-Longduration-Medium-56614-[P2][OnCLayer] Create unit with content and mask=true[Disruptive] [Serial]"
passed: (3m32s) 2025-12-05T11:40:48 "[sig-mco] MCO NodeDisruptionPolicy Author:rioliu-NonPreRelease-High-73414-[P1] NodeDisruptionPolicy units with action None [Disruptive] [Serial]"
passed: (25m35s) 2025-12-05T12:06:23 "[sig-mco] MCO Author:sregidor-Longduration-NonPreRelease-High-47009-Config Drift. New Service Unit. [Serial]"


/label qe-approved
/label cherry-pick-approved
/verified by @sergiordlr

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label Dec 5, 2025
@openshift-ci-robot
Copy link
Contributor

@openshift-cherrypick-robot: This pull request references Jira Issue OCPBUGS-65898, which is valid.

7 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.20.z) matches configured target version for branch (4.20.z)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
  • release note type set to "Release Note Not Required"
  • dependent bug Jira Issue OCPBUGS-56648 is in the state Verified, which is one of the valid states (VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA))
  • dependent Jira Issue OCPBUGS-56648 targets the "4.21.0" version, which is one of the valid target versions: 4.21.0
  • bug has dependents

Requesting review from QA contact:
/cc @sergiordlr

In response to this:

This is an automated cherry-pick of #5086

/assign sdodson

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added the cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. label Dec 5, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 5, 2025

@openshift-cherrypick-robot: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/bootstrap-unit 702dd8b link false /test bootstrap-unit

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 5fe9249 and 2 for PR HEAD 702dd8b in total

@sdodson sdodson merged commit d6ee32f into openshift:release-4.20 Dec 5, 2025
12 of 15 checks passed
@openshift-ci-robot
Copy link
Contributor

@openshift-cherrypick-robot: Jira Issue Verification Checks: Jira Issue OCPBUGS-65898
✔️ This pull request was pre-merge verified.
✔️ All associated pull requests have merged.
✔️ All associated, merged pull requests were pre-merge verified.

Jira Issue OCPBUGS-65898 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓

In response to this:

This is an automated cherry-pick of #5086

/assign sdodson

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. qe-approved Signifies that QE has signed off on this PR verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.