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 two more CNS endpoints to the CNS client #1541

Merged
merged 9 commits into from
Sep 13, 2022

Conversation

timraymond
Copy link
Member

These are the final two endpoints that DNC uses without going through the CNS client. Adding these makes it possible to use the CNS client exclusively in DNC.

Notes:

@timraymond timraymond requested a review from a team as a code owner August 23, 2022 13:11
@timraymond timraymond requested review from rbtr and removed request for a team August 23, 2022 13:11
cns/NetworkContainerContract.go Outdated Show resolved Hide resolved
cns/client/client.go Show resolved Hide resolved
@timraymond timraymond requested a review from rbtr August 25, 2022 19:12
rbtr
rbtr previously approved these changes Aug 25, 2022
@timraymond timraymond force-pushed the traymond/more-cns-endpoints branch 3 times, most recently from d1355d7 to 0b89fbf Compare September 7, 2022 16:10
@timraymond timraymond enabled auto-merge (squash) September 7, 2022 16:15
@timraymond timraymond requested a review from rbtr September 7, 2022 18:25
@timraymond timraymond force-pushed the traymond/more-cns-endpoints branch from 0b89fbf to bca6a18 Compare September 7, 2022 19:27
rbtr
rbtr previously approved these changes Sep 7, 2022
@timraymond timraymond disabled auto-merge September 7, 2022 21:18
@timraymond timraymond force-pushed the traymond/more-cns-endpoints branch from bca6a18 to f4fc43c Compare September 7, 2022 21:19
@rbtr rbtr force-pushed the traymond/more-cns-endpoints branch from f4fc43c to 2ad8778 Compare September 8, 2022 02:17
@timraymond timraymond force-pushed the traymond/more-cns-endpoints branch 5 times, most recently from 089037b to 55b2dcb Compare September 12, 2022 19:47
This is the last part of CNS's API surface that is used by DNC, but not
covered by a method from the CNS client.
The error handling here is simple enough that it doesn't really warrant
wrapping it with a lambda.
DNC uses this API to detect GRE key capabilities. Since it's not
supported by the client, it does this with direct HTTP requests
currently. In order to ensure that there's only one way of accessing
CNS, this implements the method so that the client can be used in DNC
instead.
This was forgotten in a previous iteration.
The NMAgentSupportedAPIs method did not error when a non-2XX status code
was encountered. This leads to surprising behavior on the part of the
consumer.
This was a linter suggestion, and a good one. http.NoBody is more
semantically meaningful than passing a nil.
This is in response to a linter complaint that dynamic errors were being
used instead of a static error. Declaring an error type with var
wouldn't carry along necessary debugging information (namely the HTTP
status code), so it wasn't really appropriate. Rather than disable the
check entirely with a linter directive, this defines a reusable error
type so that HTTP errors can be communicated upward consistently.
These really should be a single set of paths, but there's this existing
block of constants to define a "contract with DNC." Whether or not
that's complete, the spirit of it is somewhat clear. However, it's not
great to be duplicating constants all over the place. This is somewhat
of a compromise by defining the newer constants in terms of the older
ones.
This was a good suggestion from the linter.
@timraymond timraymond force-pushed the traymond/more-cns-endpoints branch from 55b2dcb to 04777c0 Compare September 12, 2022 21:18
@rbtr rbtr added enhancement cns Related to CNS. labels Sep 13, 2022
@timraymond timraymond merged commit a9a0a5f into Azure:master Sep 13, 2022
@timraymond timraymond deleted the traymond/more-cns-endpoints branch September 13, 2022 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cns Related to CNS. enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants