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

fix azure disk list corruption issue #77187

Merged
merged 1 commit into from
Apr 29, 2019

Conversation

andyzhangx
Copy link
Member

What type of PR is this?
/kind bug

What this PR does / why we need it:
This PR fixed azure disk list corruption issue:
In Azure disk attach/detach function, it uses slice(disks) to store the disk list:


And after disks changed, the original vm.StorageProfile.DataDisks would also be changed, so original azure data disk list is corrupted after attach/detach disk

example code as below:

func main() {
    var disks *[]string 
    disks = &[]string{"disk1", "disk2", "disk3", "disk4"}
    copy := *disks

    //detach a disk
    copy = append(copy[:1], copy[2:]...)

    
    fmt.Println("disks = ", *disks)
    fmt.Println("copy = ", copy)
}


# ./test
disks =  [disk1 disk3 disk4 disk4]
copy =  [disk1 disk3 disk4]

Which issue(s) this PR fixes:

Fixes #77186

Special notes for your reviewer:

release-note:

fix azure disk list corruption issue

/kind bug
/assign @feiskyer @khenidak
/priority important-soon
/sig azure

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

@k8s-ci-robot k8s-ci-robot added 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. kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/azure cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 28, 2019
@k8s-ci-robot k8s-ci-robot added area/cloudprovider sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 28, 2019
@justaugustus
Copy link
Member

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andyzhangx, justaugustus

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

@andyzhangx
Copy link
Member Author

/hold
hold a day for review

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 28, 2019
@feiskyer feiskyer added this to In progress in Provider Azure via automation Apr 28, 2019
@feiskyer
Copy link
Member

To avoid such issues again, @andyzhangx could you add a unit test for this?

@andyzhangx
Copy link
Member Author

To avoid such issues again, @andyzhangx could you add a unit test for this?

I don't think it could be covered in unit test.

@andyzhangx
Copy link
Member Author

@feiskyer any concern about this PR? I would like to cherry pick to older release ASAP.

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

@andyzhangx
Copy link
Member Author

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 29, 2019
@k8s-ci-robot k8s-ci-robot merged commit 16193d8 into kubernetes:master Apr 29, 2019
Provider Azure automation moved this from In progress to Done Apr 29, 2019
k8s-ci-robot added a commit that referenced this pull request Apr 30, 2019
…7187-upstream-release-1.12

Automated cherry pick of #77187: fix disk list corruption issue
k8s-ci-robot added a commit that referenced this pull request Apr 30, 2019
…7187-upstream-release-1.13

Automated cherry pick of #77187: fix disk list corruption issue
k8s-ci-robot added a commit that referenced this pull request Apr 30, 2019
…7187-upstream-release-1.14

Automated cherry pick of #77187: fix disk list corruption issue
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. area/cloudprovider 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/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. 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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
Development

Successfully merging this pull request may close these issues.

azure data disk list is corrupted after attach/detach disk
5 participants