Skip to content

Conversation

@shreyashastantram
Copy link
Contributor

@shreyashastantram shreyashastantram commented Oct 14, 2025

Reason for Change:

Adding check to MTPNC to ensure that CNS doesn't respond back with the ipaddress if mtpnc is set for deletion.

Issue Fixed:

Requirements:

Notes:

rbtr
rbtr previously requested changes Oct 15, 2025
@shreyashastantram shreyashastantram marked this pull request as ready for review October 15, 2025 23:10
@shreyashastantram shreyashastantram requested review from a team as code owners October 15, 2025 23:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds validation to prevent IP configuration requests for pods with terminating MultitenantPodNetworkConfig (MTPNC) resources by checking if the deletion timestamp is set.

  • Introduces an IsTerminating() method to check if a MTPNC resource has a deletion timestamp
  • Adds validation in the middleware to reject requests when MTPNC is terminating
  • Includes test coverage for the terminating state scenario

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
crd/multitenancy/api/v1alpha1/utils.go Adds IsTerminating() method to check deletion timestamp
cns/middlewares/k8sSwiftV2.go Implements validation to reject IP config requests when MTPNC is terminating
cns/middlewares/mock/mockClient.go Adds mock data for testing MTPNC terminating state
cns/middlewares/k8sSwiftV2_linux_test.go Adds test case to verify terminating state is properly handled

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@shreyashastantram shreyashastantram changed the title Adding delete timestamp check fix: Adding delete timestamp check Oct 15, 2025
Co-authored-by: Copilot <[email protected]>
Signed-off-by: shreyashastantram <[email protected]>
miguelgoms
miguelgoms previously approved these changes Oct 20, 2025
isaac-dasan
isaac-dasan previously approved these changes Oct 21, 2025
ashvindeodhar
ashvindeodhar previously approved these changes Oct 21, 2025
miguelgoms
miguelgoms previously approved these changes Oct 21, 2025
@rbtr
Copy link
Collaborator

rbtr commented Oct 21, 2025

/azp run Azure Container Networking PR

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@rbtr rbtr dismissed their stale review October 21, 2025 20:56

unblocking

@shreyashastantram
Copy link
Contributor Author

/azp run Azure Container Networking PR

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@shreyashastantram shreyashastantram added this pull request to the merge queue Oct 22, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 22, 2025
@shreyashastantram shreyashastantram added this pull request to the merge queue Oct 22, 2025
@shreyashastantram
Copy link
Contributor Author

/azp run Azure Container Networking PR

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Merged via the queue into master with commit 0a265f6 Oct 22, 2025
12 of 13 checks passed
@shreyashastantram shreyashastantram deleted the swiftv2/deletetimestampcheck branch October 22, 2025 21:28
sivakami-projects pushed a commit that referenced this pull request Oct 23, 2025
* Adding delete timestamp check

* Adding UT and refactoring getmtpnc

* Update cns/middlewares/k8sSwiftV2_linux_test.go

Co-authored-by: Copilot <[email protected]>
Signed-off-by: shreyashastantram <[email protected]>

* Changing the MTPNC error message

* Removing unused fields

* Revert manifest changes for CRD files

* Fixing error message and adding comments

* Revert CRD API files to master state

* fix: correcting comment assertion

---------

Signed-off-by: shreyashastantram <[email protected]>
Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants