New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[release-4.9] Bug 2098099: configure-ovs: clone connection to avoid selinux problems #3188
Conversation
@jcaamano: No Bugzilla bug is referenced in the title of this pull request. In response to this:
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/test-infra repository. |
Skipping CI for Draft Pull Request. |
/test 4.9-upgrade-from-stable-4.8-e2e-aws-ovn-upgrade |
Seems to work with static IP.
|
/etc/NetworkManager/systemConnectionsMerged is not correctly registered in selinux as a location for NM to manage its connection profiles so attempting to update a profile through NM after manually copying and doing a restorecon from that location fails. So instead of copying files there and restorecon manuall, rely on `nmcli clone` to copy a connection and let that handle selinux attributes. Signed-off-by: Jaime Caamaño Ruiz <jcaamano@redhat.com>
Only updated comments and commit message. |
/bugzilla refresh |
@jcaamano: This pull request references Bugzilla bug 2089763, which is invalid:
Comment In response to this:
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/test-infra repository. |
@jcaamano: This pull request references Bugzilla bug 2089763, which is invalid:
Comment In response to this:
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/test-infra repository. |
/test 4.9-upgrade-from-stable-4.8-e2e-aws-ovn-upgrade |
/test e2e-aws-ovn-workers-rhel8 |
/bugzilla refresh |
@rbbratta: This pull request references Bugzilla bug 2089763, which is valid. 6 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
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/test-infra repository. |
/label cherry-pick-approved |
@jcaamano: This pull request references Bugzilla bug 2095264, which is invalid:
Comment In response to this:
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/test-infra repository. |
@jcaamano: This pull request references Bugzilla bug 2098099, which is invalid:
Comment In response to this:
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/test-infra repository. |
/bugzilla refresh |
@jcaamano: This pull request references Bugzilla bug 2098099, which is invalid:
Comment In response to this:
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/test-infra repository. |
/bugzilla refresh |
@jcaamano: This pull request references Bugzilla bug 2098099, which is invalid:
Comment In response to this:
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/test-infra repository. |
Did this get a backport into 4.10 yet? I don't see a pr attached to that BZ (which is blocking this 4.9 BZ): https://bugzilla.redhat.com/show_bug.cgi?id=2098097 |
We don't require code changes in 4.10 or 4.11 as we don't have the problem there. |
/bugzilla refresh |
@jcaamano: This pull request references Bugzilla bug 2098099, which is valid. 6 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
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/test-infra repository. |
# NM selinux attributes vs using restorecon on systemConnectionsMerged | ||
nmcli conn clone "${old_conn}" "${ovs_interface}" | ||
shopt -s nullglob | ||
new_conn_files=(${NM_CONN_PATH}/"${ovs_interface}"*) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you need to use an array here of files, cant you just set a new_conn_file var and onl in 242 use your ! -f check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am doing the same that we were doing when we cloned old_conn
with old_conn_files
before, as it is the same problem.
I guess this is done to avoid assuming the precise file name, nmconnection vs no nmconnection. It could be done different but I took what was already there.
# modify file to work with OVS and have unique settings | ||
sed -i '/^\[connection\]$/,/^\[/ s/^uuid=.*$/uuid='"$br_iface_uuid"'/' ${new_conn_file} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why remove this? My guess is because cloning automatically provides a new uuid? But we cloned in the old code, so this must have been here for a reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we did not always clone, first there was the copy attempt with which we would end up with the same uuid.
But now we always clone, so always get a fresh uuid.
sed -i '/^multi-connect=.*$/d' ${new_conn_file} | ||
sed -i '/^autoconnect=.*$/d' ${new_conn_file} | ||
sed -i '/^\[connection\]$/a autoconnect=false' ${new_conn_file} | ||
sed -i '/^\[connection\]$/,/^\[/ s/^type=.*$/type=ovs-interface/' ${new_conn_file} | ||
sed -i '/^\[connection\]$/,/^\[/ s/^id=.*$/id='"$ovs_interface"'/' ${new_conn_file} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why remove this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nmcli conn clone "${old_conn}" "${ovs_interface}"
already produces a connection with id="${ovs_interface}"
/retest |
@jcaamano: The following tests failed, say
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/test-infra repository. I understand the commands that are listed here. |
/lgtm |
Back-port risk assessment does not make sense on this PR as it is not a back-port and the problem is specific to the 4.9 release. |
/approve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving since basic MCO tests are green and networking team has reviewed the PR
/label backport-risk-assessed
You were quick Jerry! 😆 |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jcaamano, sinnykumari, trozet, yuqi-zhang 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 |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jcaamano, sinnykumari, trozet, yuqi-zhang 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 |
@jcaamano: All pull requests linked via external trackers have merged: Bugzilla bug 2098099 has been moved to the MODIFIED state. In response to this:
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/test-infra repository. |
On older releases, /etc/NetworkManager/systemConnectionsMerged is not
correctly registered in selinux as a location for NM to manage its
connection profiles. So instead of copying files there and restorecon,
rely always on nmcli clone to copy a connection and let that handle selinux
attributes.
Signed-off-by: Jaime Caamaño Ruiz jcaamano@redhat.com
- What I did
- How to verify it
- Description for the changelog