mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-05 21:14:56 +00:00
fix error during restore when spec.ports are not found
Signed-off-by: Shubheksha Jalan <jshubheksha@gmail.com>
This commit is contained in:
committed by
Steve Kriss
parent
856e632109
commit
b51b3c27ce
@@ -59,6 +59,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
|
||||
|
||||
Reference in New Issue
Block a user