kapp icon indicating copy to clipboard operation
kapp copied to clipboard

Include default template rules for packaging resources

Open mamachanko opened this issue 2 years ago • 1 comments

Describe the problem/challenge you have

My PackageInstall is referring to a Secret which contains its values. kapp-controller is kind enough to reconcile the resource again, when the Secret changes. However, the PackageInstall remains the same, and so kapp does not wait for the new round of reconciliation, b/c its the same resource version.

I want kapp to wait for the reconciliation of my PackageInstall when I update its values.

With kapp's versioned resources it's possible to achieve the desired outcome:

---
apiVersion: kapp.k14s.io/v1alpha1
kind: Config
templateRules:
  - resourceMatchers:
      - apiVersionKindMatcher: { apiVersion: v1, kind: Secret }
    affectedResources:
      objectReferences:
        - path: [ spec, values, { allIndexes: true }, secretRef ]
          resourceMatchers:
            - apiVersionKindMatcher: { apiVersion: packaging.carvel.dev/v1alpha1, kind: PackageInstall }

---
apiVersion: packaging.carvel.dev/v1alpha1
kind: PackageInstall
metadata:
  name: tap
  namespace: tap-install
spec:
  packageRef:
    refName: tap.tanzu.vmware.com
    versionSelection:
      constraints: #@ data.values.tap.version
      prereleases: {}
  serviceAccountName: my-sa
  values:
    - secretRef:
        name: tap-install-values

---
apiVersion: v1
kind: Secret
metadata:
  name: tap-install-values
  namespace: tap-install
  annotations:
    kapp.k14s.io/versioned: ""
stringData:
  values.yaml: #@ yaml.encode(tap_values())

Describe the solution you'd like

It would be great if kapp's default deploy config would be aware of PackageInstall's references to Secrets. Ideally, this is the case for all packaging resources which have references to core resources which can be versioned, e.g PackageRepository.spec.fetch.inline.pathsFrom.

Anything else you would like to add:

Yes, I would like to add another thing: ❤️ kapp


Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible" 👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

mamachanko avatar Sep 04 '22 06:09 mamachanko

@praveenrewar please triage

renuy avatar Sep 05 '22 06:09 renuy