fix error during restore when spec.ports are not found
Signed-off-by: Shubheksha Jalan <jshubheksha@gmail.com>pull/869/head
parent
368787c184
commit
907a9fbdd8
|
@ -57,6 +57,11 @@ func (a *serviceAction) Execute(obj runtime.Unstructured, restore *api.Restore)
|
|||
delete(spec, "clusterIP")
|
||||
}
|
||||
|
||||
// Since spec.ports is an optional key, we can ignore 'not found' errors. Also assuming it was a string already.
|
||||
if val, _ := collections.GetString(spec, "spec.ports"); val != "None" {
|
||||
delete(spec, "spec.ports")
|
||||
}
|
||||
|
||||
preservedPorts, err := getPreservedPorts(obj)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
|
|
Loading…
Reference in New Issue