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

Convert resource group name in Azure provider ID to lower cases #74882

Merged
merged 1 commit into from
Mar 5, 2019

Conversation

feiskyer
Copy link
Member

@feiskyer feiskyer commented Mar 4, 2019

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind api-change
/kind bug
/kind cleanup
/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake

What this PR does / why we need it:

The resource group name in Azure VM's ID may be in different cases from time to time. This would cause the node's providerID are also in different cases.

While it's still working, this different cases issue may introduce troubles for external components that are dpending on providerID (e.g. cluster autoscaler).

This PR converts the resource group name in Azure provider ID to lower cases, so that all nodes' providerID are still in same cases in such case.

Which issue(s) this PR fixes:

Fixes #71994

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

The resource group name in Azure providerID is not converted to lower cases.

/sig azure
/kind bug
/priority critical-urgent
/milestone v1.14

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. 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 Mar 4, 2019
@k8s-ci-robot k8s-ci-robot added this to the v1.14 milestone Mar 4, 2019
@k8s-ci-robot k8s-ci-robot added sig/azure priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 4, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: feiskyer

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 Mar 4, 2019
@feiskyer
Copy link
Member Author

feiskyer commented Mar 4, 2019

@k8s-ci-robot k8s-ci-robot added the sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. label Mar 4, 2019
@feiskyer
Copy link
Member Author

feiskyer commented Mar 4, 2019

/test pull-kubernetes-e2e-aks-engine-azure

Copy link
Member

@andyzhangx andyzhangx left a comment

Choose a reason for hiding this comment

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

there are other functions like getFrontendIPConfigID, getBackendPoolID, especially getFrontendIPConfigID func since az.ResourceGroup is read from azure.json config file, it's controlled by user config, could be upper case.

func (az *Cloud) getFrontendIPConfigID(lbName, fipConfigName string) string {
	return fmt.Sprintf(
		frontendIPConfigIDTemplate,
		az.SubscriptionID,
		az.ResourceGroup,
		lbName,
		fipConfigName)
}

@@ -185,7 +185,13 @@ func (ss *scaleSet) GetInstanceIDByNodeName(name string) (string, error) {
return "", err
}

return *vm.ID, nil
resourceID := *vm.ID
Copy link
Member

Choose a reason for hiding this comment

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

return convertResourceGroupNameToLower(*vm.ID)

Copy link
Member Author

Choose a reason for hiding this comment

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

add an error log here

Copy link
Member

Choose a reason for hiding this comment

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

then add this log into function convertResourceGroupNameToLower?

pkg/cloudprovider/providers/azure/azure_wrap.go Outdated Show resolved Hide resolved
@feiskyer
Copy link
Member Author

feiskyer commented Mar 4, 2019

there are other functions like getFrontendIPConfigID, getBackendPoolID, especially getFrontendIPConfigID func since az.ResourceGroup is read from azure.json config file, it's controlled by user config, could be upper case.

Other IDs are used only internally, hence it's ok of any cases. Only exposed providerID is required for conversion.

@feiskyer
Copy link
Member Author

feiskyer commented Mar 5, 2019

/test pull-kubernetes-e2e-aks-engine-azure

@feiskyer feiskyer added this to Needs Review in Provider Azure Mar 5, 2019
Copy link
Member

@andyzhangx andyzhangx 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 5, 2019
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@k8s-ci-robot k8s-ci-robot merged commit e330c01 into kubernetes:master Mar 5, 2019
Provider Azure automation moved this from Needs Review to Done Mar 5, 2019
mgdevstack pushed a commit to mgdevstack/kubernetes that referenced this pull request Mar 5, 2019
Convert resource group name in Azure provider ID to lower cases
@feiskyer feiskyer deleted the convert-rg-to-lower branch March 6, 2019 04:13
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. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Development

Successfully merging this pull request may close these issues.

Azure node providerID for VMSS instances has inconsistent case
4 participants