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

Change default nat gateway IP name #3424

Merged

Conversation

CecileRobertMichon
Copy link
Contributor

@CecileRobertMichon CecileRobertMichon commented Apr 13, 2023

What type of PR is this?

/kind failing-test

What this PR does / why we need it: The default name for nat gateway IP is currently "pip-" + cluster name + subnet name. Since the default subnet name already contains cluster name, this can lead to very long and repetitive IP names, such as this one observed in tests:

 Resource name pip-k8s-upgrade-and-conformance-ol1nwl-k8s-upgrade-and-conformance-ol1nwl-node-subnet-natgw is invalid. The name can be up to 80 characters long

This PR changes the default name to reuse the natgw name instead so the public IP name is consistent with the nat gateway it belongs too, and isn't so repetitive and long when cluster name is on the longer side.

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 #3421

Special notes for your reviewer:

This should be backwards compatible since it's changing the default value but not touching existing clusters.

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

Change default nat gateway IP name to generate shorter names

@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/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. labels Apr 13, 2023
@k8s-ci-robot k8s-ci-robot requested a review from nojnhuh April 13, 2023 20:54
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 13, 2023
@k8s-ci-robot k8s-ci-robot requested a review from willie-yao April 13, 2023 20:54
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Apr 13, 2023
@@ -128,11 +128,6 @@ func GenerateFrontendIPConfigName(lbName string) string {
return fmt.Sprintf("%s-%s", lbName, "frontEnd")
}

// GenerateNatGatewayIPName generates a NAT gateway IP name.
func GenerateNatGatewayIPName(clusterName, subnetName string) string {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

dead code

@CecileRobertMichon
Copy link
Contributor Author

/test ls

@k8s-ci-robot
Copy link
Contributor

@CecileRobertMichon: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test pull-cluster-api-provider-azure-build
  • /test pull-cluster-api-provider-azure-ci-entrypoint
  • /test pull-cluster-api-provider-azure-e2e
  • /test pull-cluster-api-provider-azure-e2e-aks
  • /test pull-cluster-api-provider-azure-test
  • /test pull-cluster-api-provider-azure-verify

The following commands are available to trigger optional jobs:

  • /test pull-cluster-api-provider-azure-apidiff
  • /test pull-cluster-api-provider-azure-apiversion-upgrade
  • /test pull-cluster-api-provider-azure-capi-e2e
  • /test pull-cluster-api-provider-azure-conformance
  • /test pull-cluster-api-provider-azure-conformance-with-ci-artifacts
  • /test pull-cluster-api-provider-azure-e2e-optional
  • /test pull-cluster-api-provider-azure-e2e-workload-upgrade
  • /test pull-cluster-api-provider-azure-windows-containerd-upstream-with-ci-artifacts
  • /test pull-cluster-api-provider-azure-windows-containerd-upstream-with-ci-artifacts-serial-slow

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

  • pull-cluster-api-provider-azure-apidiff
  • pull-cluster-api-provider-azure-build
  • pull-cluster-api-provider-azure-ci-entrypoint
  • pull-cluster-api-provider-azure-e2e
  • pull-cluster-api-provider-azure-e2e-aks
  • pull-cluster-api-provider-azure-test
  • pull-cluster-api-provider-azure-verify

In response to this:

/test ls

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.

@CecileRobertMichon
Copy link
Contributor Author

/test pull-cluster-api-provider-azure-e2e-workload-upgrade

@jackfrancis
Copy link
Contributor

This is a really clean change that addresses the problem, nice.

/lgtm

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

LGTM label has been added.

Git tree hash: 15b414fc25dbac9b6d09c20dc0865e4f8dc50ccc

Copy link
Contributor Author

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

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

/assign @willie-yao

@codecov-commenter
Copy link

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.01 🎉

Comparison is base (80d11de) 51.65% compared to head (aeee6e1) 51.66%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3424      +/-   ##
==========================================
+ Coverage   51.65%   51.66%   +0.01%     
==========================================
  Files         182      182              
  Lines       18104    18102       -2     
==========================================
+ Hits         9351     9353       +2     
+ Misses       8222     8218       -4     
  Partials      531      531              
Impacted Files Coverage Δ
azure/defaults.go 8.06% <ø> (+0.12%) ⬆️
api/v1beta1/azurecluster_default.go 92.28% <100.00%> (ø)

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@willie-yao willie-yao left a comment

Choose a reason for hiding this comment

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

/lgtm

@CecileRobertMichon
Copy link
Contributor Author

This is technically not a bug fix (but it does fix a specific scenario so one could argue it is) but for the sake of fixing our tests, should we cherry-pick?

@CecileRobertMichon
Copy link
Contributor Author

/cherry-pick release-1.8

@k8s-infra-cherrypick-robot

@CecileRobertMichon: once the present PR merges, I will cherry-pick it on top of release-1.8 in a new PR and assign it to you.

In response to this:

/cherry-pick release-1.8

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.

Copy link
Contributor

@mboersma mboersma left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mboersma

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 14, 2023
@k8s-ci-robot k8s-ci-robot merged commit d662a91 into kubernetes-sigs:main Apr 14, 2023
@k8s-ci-robot k8s-ci-robot added this to the v1.9 milestone Apr 14, 2023
@k8s-infra-cherrypick-robot

@CecileRobertMichon: #3424 failed to apply on top of branch "release-1.8":

Applying: Change default nat gateway IP name
Using index info to reconstruct a base tree...
M	api/v1beta1/azurecluster_default.go
M	api/v1beta1/azurecluster_default_test.go
M	azure/defaults.go
Falling back to patching base and 3-way merge...
Auto-merging azure/defaults.go
Auto-merging api/v1beta1/azurecluster_default_test.go
CONFLICT (content): Merge conflict in api/v1beta1/azurecluster_default_test.go
Auto-merging api/v1beta1/azurecluster_default.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Change default nat gateway IP name
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.8

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.

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/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. 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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

capi-periodic-upgrade-main-1-25-1-26 test failing due to NAT GW name length
7 participants