-
Notifications
You must be signed in to change notification settings - Fork 430
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
migrate private endpoints service to ASO #4108
migrate private endpoints service to ASO #4108
Conversation
Skipping CI for Draft Pull Request. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #4108 +/- ##
==========================================
+ Coverage 60.45% 60.89% +0.43%
==========================================
Files 191 190 -1
Lines 19195 18983 -212
==========================================
- Hits 11604 11559 -45
+ Misses 6947 6787 -160
+ Partials 644 637 -7 ☔ View full report in Codecov by Sentry. |
e39646d
to
e2ea835
Compare
cc54078
to
cd87db8
Compare
829cad7
to
61ef909
Compare
61ef909
to
7c8f0d3
Compare
Updating unit tests. |
7c8f0d3
to
3d96af5
Compare
/unhold |
/unhold |
/retest |
1ad6e60
to
948c69a
Compare
/retest |
/test pull-cluster-api-provider-azure-windows-containerd-upstream-custom-builds |
@nawazkh: The specified target(s) for
The following commands are available to trigger optional jobs:
Use
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
948c69a
to
1b4f345
Compare
if len(s.ApplicationSecurityGroups) > 0 { | ||
applicationSecurityGroups := make([]asonetworkv1.ApplicationSecurityGroupSpec_PrivateEndpoint_SubResourceEmbedded, 0, len(s.ApplicationSecurityGroups)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This length check (along with the other similar ones) could be made redundant if we initialize the slices as nil:
if len(s.ApplicationSecurityGroups) > 0 { | |
applicationSecurityGroups := make([]asonetworkv1.ApplicationSecurityGroupSpec_PrivateEndpoint_SubResourceEmbedded, 0, len(s.ApplicationSecurityGroups)) | |
var applicationSecurityGroups []asonetworkv1.ApplicationSecurityGroupSpec_PrivateEndpoint_SubResourceEmbedded |
Then the linter will complain that we're not pre-allocating the slice, but I'd be +1 to ignoring that since I can't imagine that makes any difference in performance unless users are defining 1000s of these in a single resource YAML.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. But if this minor over-engineering guardrails us from unforeseen scenarios and adds a bit of performance, I am happy to take it. 😃
PrivateEndpointNetworkPolicies: ptr.To(armnetwork.VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), | ||
PrivateLinkServiceNetworkPolicies: ptr.To(armnetwork.VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see where ASO lets us set these fields. Is that because they don't actually have any effect? Should we be setting these on the real subnet resource?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question @nojnhuh , Let me put a question on the ASO channel.
My theory from probing the Azure SDK request body params (xref: https://learn.microsoft.com/en-us/rest/api/virtualnetwork/private-endpoints/create-or-update?view=rest-virtualnetwork-2023-05-01&tabs=HTTP#request-body) is that PrivateEndpointNetworkPolicy: Disabled
and PrivateLinkServiceNetworkPolicy: Enabled
appear to be the default values for the fields being explicitly specified.
From the examples of creating PrivateEndpoints using Azure SDK, I see that privateEndpoints request payload only requires the SubnetIDs, I am guessing ASO is also following the same
But, let me confirm.
Update: scratch the theory.
@nawazkh If there isn't one already, could you please open an issue to track adding e2e coverage for private endpoints? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good pending one minor comment!
a106c3b
to
8effa61
Compare
CAPZ sets the following ASO fields if found: - ApplicationSecurityGroups - AzureName - CustomNetworkInterfaceName - IpConfigurations - Location - ManualPrivateLinkServiceConnections - Owner - PrivateLinkServiceConnections - Subnet - Tags ASO fields not managed by CAPZ - ExtendedLocation
8effa61
to
12a2c08
Compare
@nawazkh: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
LGTM label has been added. Git tree hash: e4ff7a484cb390fd12a7e365e1b45dcd4d63281a
|
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nojnhuh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #3530
Special notes for your reviewer:
I tested it locally, and I was able to bring up a private-endpoint using the default template.
cherry-pick candidate
TODOs:
Release note: