update after review

Signed-off-by: lou <alex1988@outlook.com>
This commit is contained in:
lou
2023-11-01 21:53:30 +08:00
parent f66016d416
commit e30937550e
2 changed files with 3 additions and 2 deletions
@@ -105,7 +105,7 @@ func (r *ResourceModifierRule) apply(obj *unstructured.Unstructured, groupResour
}
}
g, err := glob.Compile(r.Conditions.GroupResource)
g, err := glob.Compile(r.Conditions.GroupResource, '.')
if err != nil {
log.Errorf("Bad glob pattern of groupResource in condition, groupResource: %s, err: %s", r.Conditions.GroupResource, err)
return err
@@ -183,4 +183,5 @@ resourceModifierRules:
- You can specify multiple rules in the `matches` list. The patch will be applied only if all the matches are satisfied.
### Wildcard Support for GroupResource
The user can specify a wildcard for groupResource in the conditions' struct. This will allow the user to apply the patches for all the resources of a particular group or all resources in all groups. For example, `*.apps` will apply to all the resources in the `apps` group, `*` will apply to all the resources in all groups.
The user can specify a wildcard for groupResource in the conditions' struct. This will allow the user to apply the patches for all the resources of a particular group or all resources in all groups. For example, `*.apps` will apply to all the resources in the `apps` group, `*` will apply to all the resources in core group, `*.*` will apply to all the resources in all groups.
- If both `*.groupName` and `namespaces` are specified, the patches will be applied to all the namespaced resources in this group in the specified namespaces and all the cluster resources in this group.