Skip to content

Conversation

@nilo19
Copy link
Contributor

@nilo19 nilo19 commented Feb 24, 2025

…ource group

What type of PR is this?

/kind bug

What this PR does / why we need it:

We should remove managed pip when the service switches to a different pip in another resource group.

Which issue(s) this PR fixes:

Fixes #8113

Special notes for your reviewer:

Does this PR introduce a user-facing change?

fix: Remove managed pip if switched to another pip in a different resource group

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. labels Feb 24, 2025
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 24, 2025
@coveralls
Copy link

coveralls commented Feb 24, 2025

Coverage Status

coverage: 74.64% (+0.02%) from 74.618%
when pulling a31b322 on nilo19:fix/pip
into 01e8d0f on kubernetes-sigs:master.

@nilo19 nilo19 force-pushed the fix/pip branch 4 times, most recently from a31b322 to e2f5b3b Compare February 25, 2025 22:36
@nilo19
Copy link
Contributor Author

nilo19 commented Feb 26, 2025

/retest pull-cloud-provider-azure-e2e-ccm-capz\

@k8s-ci-robot
Copy link
Contributor

@nilo19: The /retest command does not accept any targets.
The following commands are available to trigger required jobs:

/test pull-cloud-provider-azure-check
/test pull-cloud-provider-azure-e2e-capz
/test pull-cloud-provider-azure-e2e-ccm-capz
/test pull-cloud-provider-azure-e2e-ccm-dualstack-capz
/test pull-cloud-provider-azure-e2e-ccm-dualstack-vmss-capz
/test pull-cloud-provider-azure-e2e-ccm-ipv6-capz
/test pull-cloud-provider-azure-e2e-ccm-ipv6-vmss-capz
/test pull-cloud-provider-azure-e2e-ccm-vmss-capz
/test pull-cloud-provider-azure-e2e-ccm-vmss-ip-lb-capz
/test pull-cloud-provider-azure-e2e-ccm-vmss-multi-slb-capz
/test pull-cloud-provider-azure-e2e-ccm-vmss-shared-probe-capz
/test pull-cloud-provider-azure-e2e-ccm-vmssflex-capz
/test pull-cloud-provider-azure-unit

Use /test all to run the following jobs that were automatically triggered:

pull-cloud-provider-azure-check
pull-cloud-provider-azure-e2e-capz
pull-cloud-provider-azure-e2e-ccm-capz
pull-cloud-provider-azure-e2e-ccm-vmss-capz
pull-cloud-provider-azure-e2e-ccm-vmss-ip-lb-capz
pull-cloud-provider-azure-e2e-ccm-vmss-multi-slb-capz
pull-cloud-provider-azure-e2e-ccm-vmss-shared-probe-capz
pull-cloud-provider-azure-e2e-ccm-vmssflex-capz
pull-cloud-provider-azure-unit

In response to this:

/retest pull-cloud-provider-azure-e2e-ccm-capz\

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-sigs/prow repository.

@nilo19
Copy link
Contributor Author

nilo19 commented Feb 26, 2025

/test pull-cloud-provider-azure-e2e-ccm-capz

@nilo19
Copy link
Contributor Author

nilo19 commented Feb 26, 2025

/test pull-cloud-provider-azure-e2e-ccm-vmss-ip-lb-capz

@nilo19
Copy link
Contributor Author

nilo19 commented Feb 26, 2025

/retest

pipID := strings.ToLower((ptr.Deref(pipCopy.ID, "")))
rg, err := getPIPRGFromID(pipID)
if err != nil {
logger.Error(err, "Failed to get resource group from PIP ID", "pip-id", pipID)
Copy link
Member

Choose a reason for hiding this comment

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

return err here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

// reconcilePublicIPs reconciles the PublicIP resources similar to how the LB is reconciled.
func (az *Cloud) reconcilePublicIPs(ctx context.Context, clusterName string, service *v1.Service, lbName string, wantLb bool) ([]*armnetwork.PublicIPAddress, error) {
logger := klog.FromContext(ctx).WithName("reconcilePublicIPs").
WithValues("load-balancer", lbName)
Copy link
Member

@feiskyer feiskyer Feb 27, 2025

Choose a reason for hiding this comment

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

how about using the same log format for those keys, e.g. loadBalancer, resourceGroup (in the following lines)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@nilo19
Copy link
Contributor Author

nilo19 commented Feb 28, 2025

/retest

Copy link
Member

@feiskyer feiskyer left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 3, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: feiskyer, nilo19

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@nilo19
Copy link
Contributor Author

nilo19 commented Mar 3, 2025

/retest

@k8s-ci-robot k8s-ci-robot merged commit c86a3cb into kubernetes-sigs:master Mar 3, 2025
18 checks passed
@nilo19 nilo19 deleted the fix/pip branch March 5, 2025 00:48
@nilo19
Copy link
Contributor Author

nilo19 commented Mar 5, 2025

/cherrypick release-1.32

@nilo19
Copy link
Contributor Author

nilo19 commented Mar 5, 2025

/cherrypick release-1.31

@nilo19
Copy link
Contributor Author

nilo19 commented Mar 5, 2025

/cherrypick release-1.30

@nilo19
Copy link
Contributor Author

nilo19 commented Mar 5, 2025

/cherrypick release-1.29

@k8s-infra-cherrypick-robot

@nilo19: #8419 failed to apply on top of branch "release-1.31":

Applying: fix: Remove managed pip if switched to another pip in a different resource group
Using index info to reconstruct a base tree...
M	pkg/provider/azure_loadbalancer.go
M	pkg/provider/azure_loadbalancer_test.go
M	pkg/provider/azure_publicip_repo.go
M	pkg/provider/azure_test.go
M	tests/e2e/network/ensureloadbalancer.go
Falling back to patching base and 3-way merge...
Auto-merging tests/e2e/network/ensureloadbalancer.go
Auto-merging pkg/provider/azure_test.go
CONFLICT (content): Merge conflict in pkg/provider/azure_test.go
Auto-merging pkg/provider/azure_publicip_repo.go
CONFLICT (content): Merge conflict in pkg/provider/azure_publicip_repo.go
Auto-merging pkg/provider/azure_loadbalancer_test.go
CONFLICT (content): Merge conflict in pkg/provider/azure_loadbalancer_test.go
Auto-merging pkg/provider/azure_loadbalancer.go
CONFLICT (content): Merge conflict in pkg/provider/azure_loadbalancer.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 fix: Remove managed pip if switched to another pip in a different resource group

In response to this:

/cherrypick release-1.31

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-sigs/prow repository.

@k8s-infra-cherrypick-robot

@nilo19: new pull request created: #8516

In response to this:

/cherrypick release-1.32

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-sigs/prow repository.

@k8s-infra-cherrypick-robot

@nilo19: #8419 failed to apply on top of branch "release-1.30":

Applying: fix: Remove managed pip if switched to another pip in a different resource group
Using index info to reconstruct a base tree...
M	pkg/provider/azure_loadbalancer.go
M	pkg/provider/azure_loadbalancer_test.go
M	pkg/provider/azure_publicip_repo.go
M	pkg/provider/azure_test.go
M	tests/e2e/network/ensureloadbalancer.go
Falling back to patching base and 3-way merge...
Auto-merging tests/e2e/network/ensureloadbalancer.go
Auto-merging pkg/provider/azure_test.go
CONFLICT (content): Merge conflict in pkg/provider/azure_test.go
Auto-merging pkg/provider/azure_publicip_repo.go
CONFLICT (content): Merge conflict in pkg/provider/azure_publicip_repo.go
Auto-merging pkg/provider/azure_loadbalancer_test.go
CONFLICT (content): Merge conflict in pkg/provider/azure_loadbalancer_test.go
Auto-merging pkg/provider/azure_loadbalancer.go
CONFLICT (content): Merge conflict in pkg/provider/azure_loadbalancer.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 fix: Remove managed pip if switched to another pip in a different resource group

In response to this:

/cherrypick release-1.30

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-sigs/prow repository.

@k8s-infra-cherrypick-robot

@nilo19: #8419 failed to apply on top of branch "release-1.29":

Applying: fix: Remove managed pip if switched to another pip in a different resource group
Using index info to reconstruct a base tree...
M	pkg/provider/azure_loadbalancer.go
M	pkg/provider/azure_loadbalancer_test.go
M	pkg/provider/azure_publicip_repo.go
M	pkg/provider/azure_test.go
M	tests/e2e/network/ensureloadbalancer.go
Falling back to patching base and 3-way merge...
Auto-merging tests/e2e/network/ensureloadbalancer.go
Auto-merging pkg/provider/azure_test.go
CONFLICT (content): Merge conflict in pkg/provider/azure_test.go
Auto-merging pkg/provider/azure_publicip_repo.go
CONFLICT (content): Merge conflict in pkg/provider/azure_publicip_repo.go
Auto-merging pkg/provider/azure_loadbalancer_test.go
CONFLICT (content): Merge conflict in pkg/provider/azure_loadbalancer_test.go
Auto-merging pkg/provider/azure_loadbalancer.go
CONFLICT (content): Merge conflict in pkg/provider/azure_loadbalancer.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 fix: Remove managed pip if switched to another pip in a different resource group

In response to this:

/cherrypick release-1.29

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-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Public IP Address orphaned when updating LoadBalancer type Service to a user-provided PIP from another RG

5 participants