mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-03 11:45:20 +00:00
regex matchstring error parsing
Signed-off-by: Anshul Ahuja <anshulahuja@microsoft.com>
This commit is contained in:
@@ -85,7 +85,10 @@ func (r *ResourceModifierRule) Apply(obj *unstructured.Unstructured, groupResour
|
||||
return nil
|
||||
}
|
||||
if r.Conditions.ResourceNameRegex != "" {
|
||||
match, _ := regexp.MatchString(r.Conditions.ResourceNameRegex, obj.GetName())
|
||||
match, err := regexp.MatchString(r.Conditions.ResourceNameRegex, obj.GetName())
|
||||
if err != nil {
|
||||
return errors.Errorf("error in matching regex %s", err.Error())
|
||||
}
|
||||
if !match {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user