carvel-dev / carvel-dev/kapp

support array item with string as an affected resource ref by versioned resource

Open
#128 13 comments 0 reactions 0 assignees View on GitHub
carvel accepted enhancement
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.