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

azure data disk list is corrupted after attach/detach disk #77186

Closed
andyzhangx opened this issue Apr 28, 2019 · 0 comments · Fixed by #77187
Closed

azure data disk list is corrupted after attach/detach disk #77186

andyzhangx opened this issue Apr 28, 2019 · 0 comments · Fixed by #77187
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@andyzhangx
Copy link
Member

What happened:
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]

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

  • Kubernetes version (use kubectl version):
  • Cloud provider or hardware configuration:
  • OS (e.g: cat /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Network plugin and version (if this is a network-related bug):
  • Others:

/sig azure
/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants