Skip to content
This repository was archived by the owner on May 6, 2026. It is now read-only.

Fix status updates only adding one device per claim#138

Merged
aojea merged 1 commit into
google:mainfrom
michaelasp:fixstatuss
Jun 25, 2025
Merged

Fix status updates only adding one device per claim#138
aojea merged 1 commit into
google:mainfrom
michaelasp:fixstatuss

Conversation

@michaelasp
Copy link
Copy Markdown
Contributor

@michaelasp michaelasp commented Jun 25, 2025

Due to SSA tracking owners, we need to do a batch update of status at the end of our NRI loop. Fix this by tracking all status updates needed and doing a batch update at the end.

Fixes #117

@michaelasp
Copy link
Copy Markdown
Contributor Author

Tested on kind

Previously with dummy0 + dummy1

    devices:
    - conditions:
      - lastTransitionTime: "2025-06-25T17:34:00Z"
        message: ""
        reason: NetworkDeviceReady
        status: "True"
        type: Ready
      - lastTransitionTime: "2025-06-25T17:34:00Z"
        message: ""
        reason: NetworkReady
        status: "True"
        type: NetworkReady
      device: dummy1
      driver: dra.net
      networkData:
        hardwareAddress: b6:1b:a9:c1:22:e2
        interfaceName: dummy1
        ips:
        - 169.254.169.14/32
      pool: dra-worker
    reservedFor:
    - name: server-deployment-5f5bfc84cf-xwxgv
      resource: pods
      uid: dac12658-45e3-44dd-99da-c0991be66673

After fix

devices:
    - conditions:
      - lastTransitionTime: "2025-06-25T17:45:20Z"
        message: ""
        reason: NetworkDeviceReady
        status: "True"
        type: Ready
      - lastTransitionTime: "2025-06-25T17:45:20Z"
        message: ""
        reason: NetworkReady
        status: "True"
        type: NetworkReady
      device: dummy1
      driver: dra.net
      networkData:
        hardwareAddress: 6e:51:9a:ba:f5:de
        interfaceName: dummy1
        ips:
        - 169.254.169.14/32
      pool: dra-worker
    - conditions:
      - lastTransitionTime: "2025-06-25T17:45:20Z"
        message: ""
        reason: NetworkDeviceReady
        status: "True"
        type: Ready
      - lastTransitionTime: "2025-06-25T17:45:20Z"
        message: ""
        reason: NetworkReady
        status: "True"
        type: NetworkReady
      device: dummy0
      driver: dra.net
      networkData:
        hardwareAddress: 8a:a0:a6:76:e2:18
        interfaceName: dummy0
        ips:
        - 169.254.169.13/32
      pool: dra-worker

Looks like it is working as expected

@aojea
Copy link
Copy Markdown
Contributor

aojea commented Jun 25, 2025

How hard is adding a bats e2e test to avoid regression?

@michaelasp
Copy link
Copy Markdown
Contributor Author

How hard is adding a bats e2e test to avoid regression?

Shouldn't be too difficult. Let me try it out!

Copy link
Copy Markdown
Member

@gauravkghildiyal gauravkghildiyal left a comment

Choose a reason for hiding this comment

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

Thank you!

Just a few nits

Comment thread pkg/driver/nri_hooks.go Outdated
Comment thread pkg/driver/nri_hooks.go
Comment thread tests/e2e.bats Outdated
@aojea aojea merged commit 1a13475 into google:main Jun 25, 2025
6 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Device Network data in Status is not updated correctly

3 participants