mirror of https://github.com/kubernetes/kops.git
Fix segfault in apply_channel
If a parallel master concurrently applied an update, update may be nil, and we might raise a segafault.
This commit is contained in:
parent
d569b04ca5
commit
5e08a7de0c
|
@ -175,10 +175,13 @@ func (c *ApplyChannelCmd) Run(args []string) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error updating %q: %v", needUpdate.Name, err)
|
return fmt.Errorf("error updating %q: %v", needUpdate.Name, err)
|
||||||
}
|
}
|
||||||
if update.NewVersion.Version != nil {
|
// Could have been a concurrent request
|
||||||
fmt.Printf("Updated %q to %d\n", update.Name, *update.NewVersion)
|
if update != nil {
|
||||||
} else {
|
if update.NewVersion.Version != nil {
|
||||||
fmt.Printf("Updated %q\n", update.Name)
|
fmt.Printf("Updated %q to %d\n", update.Name, *update.NewVersion)
|
||||||
|
} else {
|
||||||
|
fmt.Printf("Updated %q\n", update.Name)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue