Skip to content

Conversation

@rbtr
Copy link
Collaborator

@rbtr rbtr commented Apr 6, 2022

…service to it

Signed-off-by: Evan Baker rbtr@users.noreply.github.com

Reason for Change:

Issue Fixed:

Requirements:

Notes:

…service to it

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
@rbtr rbtr added cns Related to CNS. swift Related to SWIFT networking. overlay Related to Overlay networking. labels Apr 6, 2022
@rbtr rbtr requested a review from a team as a code owner April 6, 2022 20:47
@rbtr rbtr self-assigned this Apr 6, 2022
@rbtr rbtr requested review from rsagasthya and thatmattlong and removed request for a team April 6, 2022 20:47

type NodeNetworkConfigListenerFunc func(*v1alpha.NodeNetworkConfig) error

func (f NodeNetworkConfigListenerFunc) Update(nnc *v1alpha.NodeNetworkConfig) error {
Copy link
Collaborator

Choose a reason for hiding this comment

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

neat, haven't seen this pattern much but seems pretty clean to me

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it is a little on the abstract side, but it is cleaner than needing to attach these funcs to a stub struct as methods when the right closure provides all the context we need. it's the same pattern as http.Handler/http.HandlerFunc 🙂

}
responseCode := cnscli.CreateOrUpdateNetworkContainerInternal(&ncRequest)
err = restserver.ResponseCodeToError(responseCode)
if err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can combine if err := restserver.ResponseCode ...; err != nil

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

incorporated this in the next one

@rbtr rbtr merged commit 3d5660c into Azure:master Apr 12, 2022
@rbtr rbtr deleted the nnc-listener branch April 12, 2022 00:34
matmerr pushed a commit to matmerr/azure-container-networking that referenced this pull request Jun 29, 2022
…service to it (Azure#1323)

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cns Related to CNS. overlay Related to Overlay networking. swift Related to SWIFT networking.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants