Skip to content
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

Add PodUID to the OVSDB #311

Merged

Conversation

jiayoukun
Copy link
Contributor

@jiayoukun jiayoukun commented May 21, 2024

What this PR does / why we need it:

By adding the UID of a Pod to the external_ids field of the corresponding veth interface in the OVSDB, it becomes convenient for the Pod object to query the OVSDB using the UID to find the vethName of the Pod on the host machine, and then deliver OVS flow tables accordingly.

Currently, the host machine's veth interface in the OVSDB only stores the Netns field, which is useful, but for Pod objects, their netns is not publicly accessible. This change addresses this limitation by allowing Pod objects to query the OVSDB directly using their UID.

Special notes for your reviewer:

Release note:

Added the Pod UID to the external_ids field of the corresponding veth interface in the OVSDB.
This change allows querying the vethName of a Pod on the host machine using its UID, improving the ability to deliver OVS flow tables for Pod objects.

@kubevirt-bot kubevirt-bot added dco-signoff: no Indicates the PR's author has not DCO signed all their commits. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 21, 2024
@kubevirt-bot
Copy link
Collaborator

Hi @jiayoukun. Thanks for your PR.

I'm waiting for a k8snetworkplumbingwg member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@jiayoukun
Copy link
Contributor Author

fix #309

OvnPort cnitypes.UnmarshallableString `json:"ovnPort,omitempty"`
MAC cnitypes.UnmarshallableString `json:"mac,omitempty"`
OvnPort cnitypes.UnmarshallableString `json:"ovnPort,omitempty"`
K8S_POD_UID cnitypes.UnmarshallableString
Copy link
Contributor

Choose a reason for hiding this comment

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

there is no assurance runtime will provide this value (altohugh for k8s we do get this information passed down by the runtime)

so in case this arg is not provided should we store an empty value ? or just avoid adding this key to external-ids ?

Copy link
Contributor

Choose a reason for hiding this comment

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

While I do not believe it is critical, I would prefer not to have an empty value inside the external_id section of the port. Ideally, the field should be added conditionally only if the runtime provides a value for it.

.idea/.gitignore Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you remove .idea folder from the commit?

@phoracek
Copy link
Member

CC @SchSeba

@jiayoukun
Copy link
Contributor Author

@SchSeba Can you confirm the code for me?

@filanov
Copy link

filanov commented Dec 5, 2024

Looks like this PR can help me as well, any progress on this one?

@jiayoukun
Copy link
Contributor Author

Looks like this PR can help me as well, any progress on this one?

I achieved my goal by modifying the code through PR, but it seems that no one in the current community maintains it.

@jiayoukun
Copy link
Contributor Author

@phoracek Hope PR can help everyone :)

@filanov
Copy link

filanov commented Dec 6, 2024

@ykulazhenkov maybe you can help with that?

@jiayoukun the only thing that i can suggest is to add a test, you can get a reference from the PR that i closed, #339 should be simple enough.

@ykulazhenkov
Copy link
Contributor

@jiayoukun Thanks for the PR.
Could you please squash all commits into a single one with a meaningful name and description?

Please share your thoughts about #311 (comment).

To make CI happy, you need to change the description of the PR according to the PR template https://github.com/k8snetworkplumbingwg/ovs-cni/blob/main/.github/PULL_REQUEST_TEMPLATE.md.
Your PR is missing the Release note section, which is mandatory.

To make the DCO check pass for your PR, you need to sign off your commit with git commit --signoff.

@kubevirt-bot kubevirt-bot added dco-signoff: yes Indicates the PR's author has DCO signed all their commits. and removed dco-signoff: no Indicates the PR's author has not DCO signed all their commits. labels Dec 12, 2024
@jiayoukun
Copy link
Contributor Author

@jiayoukun Thanks for the PR. Could you please squash all commits into a single one with a meaningful name and description?

Please share your thoughts about #311 (comment).

To make CI happy, you need to change the description of the PR according to the PR template https://github.com/k8snetworkplumbingwg/ovs-cni/blob/main/.github/PULL_REQUEST_TEMPLATE.md. Your PR is missing the Release note section, which is mandatory.

To make the DCO check pass for your PR, you need to sign off your commit with git commit --signoff.

The modification has been completed, thank you for your guidance. :)

@phoracek
Copy link
Member

Thanks for the PR and the reviews too.

@ykulazhenkov wanted to ask you, would you please own the review of this PR? If you trust and like the code, I'd be happy to merge this

@phoracek
Copy link
Member

/retest

Copy link
Contributor

@ykulazhenkov ykulazhenkov left a comment

Choose a reason for hiding this comment

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

I tested the PR and it works as expected. LGTM

@jiayoukun can you updated PR description to include release note? (check the PR template for details). I think this change should be reflected in the changelog.

@jiayoukun
Copy link
Contributor Author

I tested the PR and it works as expected. LGTM

@jiayoukun can you updated PR description to include release note? (check the PR template for details). I think this change should be reflected in the changelog.

@AlonaKaplan Is that right? I have made the changes, please help me confirm.

@ykulazhenkov
Copy link
Contributor

@jiayoukun

copy content of the block below as is to you PR description:

**What this PR does / why we need it**:

By adding the UID of a Pod to the external_ids field of the corresponding veth interface in the OVSDB, it becomes convenient for the Pod object to query the OVSDB using the UID to find the vethName of the Pod on the host machine, and then deliver OVS flow tables accordingly.

Currently, the host machine's veth interface in the OVSDB only stores the Netns field, which is useful, but for Pod objects, their netns is not publicly accessible. This change addresses this limitation by allowing Pod objects to query the OVSDB directly using their UID.

**Special notes for your reviewer**:

**Release note**:


```release-note
Added the Pod UID to the external_ids field of the corresponding veth interface in the OVSDB.
This change allows querying the vethName of a Pod on the host machine using its UID, improving the ability to deliver OVS flow tables for Pod objects.
```

**What this PR does / why we need it**:

By adding the UID of a Pod to the external_ids field of the
corresponding veth interface in the OVSDB, it becomes convenient for the
Pod object to query the OVSDB using the UID to find the vethName of the
Pod on the host machine, and then deliver OVS flow tables accordingly.

Currently, the host machine's veth interface in the OVSDB only stores
the Netns field, which is useful, but for Pod objects, their netns is
not publicly accessible. This change addresses this limitation by
allowing Pod objects to query the OVSDB directly using their UID.

**Special notes for your reviewer**:

**Release note**:

```release-note
Added the Pod UID to the external_ids field of the corresponding veth
interface in the OVSDB.
This change allows querying the vethName of a Pod on the host machine
using its UID, improving the ability to deliver OVS flow tables for Pod
objects.
```

Signed-off-by: jiayoukun <[email protected]>
@jiayoukun
Copy link
Contributor Author

@jiayoukun

copy content of the block below as is to you PR description:

**What this PR does / why we need it**:

By adding the UID of a Pod to the external_ids field of the corresponding veth interface in the OVSDB, it becomes convenient for the Pod object to query the OVSDB using the UID to find the vethName of the Pod on the host machine, and then deliver OVS flow tables accordingly.

Currently, the host machine's veth interface in the OVSDB only stores the Netns field, which is useful, but for Pod objects, their netns is not publicly accessible. This change addresses this limitation by allowing Pod objects to query the OVSDB directly using their UID.

**Special notes for your reviewer**:

**Release note**:


```release-note
Added the Pod UID to the external_ids field of the corresponding veth interface in the OVSDB.
This change allows querying the vethName of a Pod on the host machine using its UID, improving the ability to deliver OVS flow tables for Pod objects.

Thanks! : )

@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Dec 13, 2024
@phoracek
Copy link
Member

/retest

@phoracek
Copy link
Member

/approve
/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 13, 2024
@kubevirt-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jiayoukun, phoracek, ykulazhenkov

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

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 13, 2024
@kubevirt-bot kubevirt-bot merged commit dbf2164 into k8snetworkplumbingwg:main Dec 13, 2024
5 checks passed
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. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants