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

Update loadbalancers service to SDK v2 #3917

Closed
Tracked by #3409
nawazkh opened this issue Aug 31, 2023 · 3 comments · Fixed by #3969
Closed
Tracked by #3409

Update loadbalancers service to SDK v2 #3917

nawazkh opened this issue Aug 31, 2023 · 3 comments · Fixed by #3969
Assignees
Labels
priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Milestone

Comments

@nawazkh
Copy link
Member

nawazkh commented Aug 31, 2023

part of #3409

@nawazkh
Copy link
Member Author

nawazkh commented Aug 31, 2023

/assign

@nawazkh nawazkh added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Aug 31, 2023
@nawazkh nawazkh moved this to Todo in CAPZ Planning Aug 31, 2023
@mboersma
Copy link
Contributor

My approach to these has basically been:

  • Change the import line to reference the new SDK v2 package
  • Replace network. with armnetwork. (for example) in the loadbalancers.go file
  • Fix the resulting compilation errors according to SDK v2 changes
  • Repeat the above three steps for the remaining files in the package
  • Update the client.go file following the pattern of other SDK v2 PRs
  • Run make generate-go lint go-test
  • Fix errors and repeat

That should do most of it, but in this case there's some special behavior to replicate. The current client adds the If-Match header when the loadbalancer has an ETag set.

We don't have direct access to the request or its "preparer" in SDK v2, so we have to add a custom Policy class whose behavior can be controller from within the CreateOrUpdateAsync func. The CustomPutPatchHeaderPolicy is one example of a custom policy.

@nojnhuh
Copy link
Contributor

nojnhuh commented Sep 1, 2023

That should do most of it, but in this case there's some special behavior to replicate. The current client adds the If-Match header when the loadbalancer has an ETag set.

I added something to do this in the second commit of #3938

@nawazkh nawazkh moved this from Todo to In Progress in CAPZ Planning Sep 7, 2023
@nawazkh nawazkh added this to the v1.11 milestone Sep 7, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in CAPZ Planning Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants