Skip to content

Conversation

@nddq
Copy link
Member

@nddq nddq commented Jun 16, 2022

This is the draft PR for the delegated Azure IPAM

@nddq nddq requested review from a team, matmerr and rbtr as code owners June 16, 2022 23:21
@nddq nddq added work-in-progress cns Related to CNS. cni Related to CNI. swift Related to SWIFT networking. labels Jun 17, 2022
@nddq nddq assigned nddq and unassigned nddq Jun 17, 2022
@rbtr rbtr requested review from neaggarwMS and tamilmani1989 June 21, 2022 17:27
@rbtr
Copy link
Collaborator

rbtr commented Jun 21, 2022

@wedaly fyi

@@ -0,0 +1,108 @@
package main
Copy link
Member

Choose a reason for hiding this comment

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

can directory be named "delegated-ipam" to avoid confusion with v1 ipam?

Copy link
Member Author

Choose a reason for hiding this comment

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

would swift-ipam works? I think the name got thrown around in meetings :)

Copy link
Member

Choose a reason for hiding this comment

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

lets keep it delegated-ipam.. if we want to merge v1ipam tomorrow, then it wouldn't make sense to have swift-ipam

Copy link
Collaborator

@rbtr rbtr Jun 21, 2022

Choose a reason for hiding this comment

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

I'll suggest again that if we're going to converge to a single IPAM, it should just be azure-ipam.

Copy link
Member

Choose a reason for hiding this comment

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

we already have ipam directory in our repo..having azure-ipam directory would be confusing/conflicting.. i dont think we gonna remove ipam directory in near future... also delegated-ipam makes sense to me since this ipam delegating to cns to allocate/release ip and not involved in ip address management.

@nddq nddq requested review from rbtr, tamilmani1989 and wedaly June 24, 2022 23:42
@nddq nddq self-assigned this Jun 24, 2022
@nddq nddq requested a review from rbtr June 27, 2022 23:31
@nddq nddq requested a review from wedaly June 29, 2022 19:02
wedaly
wedaly previously approved these changes Jun 29, 2022
Copy link

@wedaly wedaly left a comment

Choose a reason for hiding this comment

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

all my comments have been addressed, thanks! please check whether you need / should remove the go.mod in azure-ipam

@@ -0,0 +1,82 @@
module github.com/Azure/azure-container-networking/azure-ipam
Copy link

Choose a reason for hiding this comment

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

Could you try running a go mod tidy from within the azure-ipam directory? When I tried it, I got this error:

go: finding module for package github.com/containernetworking/cni/pkg/types/current
github.com/Azure/azure-container-networking/azure-ipam imports
        github.com/Azure/azure-container-networking/cns/client imports
        github.com/Azure/azure-container-networking/cns/restserver imports
        github.com/Azure/azure-container-networking/cns/ipamclient imports
        github.com/Azure/azure-container-networking/ipam tested by
        github.com/Azure/azure-container-networking/ipam.test imports
        github.com/containernetworking/cni/pkg/types/current: module github.com/containernetworking/cni@latest found (v1.1.1), but does not contain package github.com/containernetworking/cni/pkg/types/current

Actually, do we even need azure-ipam to be a go module? It seems like there's already a go.mod at the repository root.

Copy link
Collaborator

@rbtr rbtr Jun 29, 2022

Choose a reason for hiding this comment

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

I want it to be a separate module; I've been trying to move the functionally distinct binaries in this monorepo to modules for a while so that they can be released and versioned separately (it's not super clear from reading the mod proposal, but you can tag path/v#.#.# and go understands that as the submodule version).
As for your build error - multimodule workspaces are new in go1.18 and with nested modules require that you have a go.work in the root module. (there is a make workspace target that should set this up but I wouldn't rely on it yet)

for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
fmt.Printf("test : %v\n", tt.name)
Copy link

Choose a reason for hiding this comment

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

nit: the Go test framework should print the (sub)test name for you, I think? (Same for the other tests in this file)

Copy link
Collaborator

Choose a reason for hiding this comment

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

@nddq tests shouldn't print directly to stdout, they should just pass or fail with message - testify's assert and require functions have an optional message parameter at the end. Parallel tests all printing to stdout just make a mess 🥲

Copy link
Member Author

Choose a reason for hiding this comment

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

should I try using Ginko 🙂

@nddq nddq merged commit ee41b8b into Azure:master Jul 11, 2022
@nddq nddq deleted the delegated-ipam branch July 19, 2022 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cni Related to CNI. cns Related to CNS. swift Related to SWIFT networking.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants