support array item with string as an affected resource ref by versioned resource
- Dominant language
- Go
- Stars
- 1.1k
- Forks
- 134
- PR merge metrics
- No merged PRs in 30d
Description
We have a role that looks like this:
```
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: kpack-webhook-certs-admin
namespace: kpack
rules:
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- secrets
resourceNames:
- webhook-certs
```
and we'd like the `webhook-certs` secret to be properly versioned.
We looked into PR-ing this change ourselves to `pkg/kapp/config/default.go` but are unsure how to do the correct, general level of matching for a relatively special case like this.
Within this section
```
templateRules:
...
- resourceMatchers:
- apiVersionKindMatcher: {apiVersion: v1, kind: Secret}
```
we started writing this:
```
- path: [rules, {allIndexes: true}, {allIndexes: true}, resourceNames, {allIndexes: true}]
resourceMatchers: [apiVersionKindMatcher: {apiVersion: v1, kind: Role}]
```
But we're worried that secrets and not-secrets might live together within the `resourceNames` section, for example.
Contributor guide
Assessment
This issue has not been assessed yet.