I want to add the text [*,test,*] just before the last character of a line starting with resourceFilters: in the input file (that string can be preceded by any number of spaces).
An example of this line is the following
resourceFilters: '[Event,*,*][*,kube-system,*][*,kube-public,*][*,kube-node-lease,*][Node,*,*][APIService,*,*][TokenReview,*,*][SubjectAccessReview,*,*][Binding,*,*][ReplicaSet,*,*]'
which would be changed into this:
resourceFilters: '[Event,*,*][*,kube-system,*][*,kube-public,*][*,kube-node-lease,*][Node,*,*][APIService,*,*][TokenReview,*,*][SubjectAccessReview,*,*][Binding,*,*][ReplicaSet,*,*][*,test,*]'