Say I have kustomize directory like this:
|_base
|_ deployment.yaml
|_ kustomisation.yaml
|_patches
|_dev
|_ patch.yaml
|_prod
|_ patch.yaml
In base/deployment.yaml there exists a CRD object i.e
apiVersion: some.provider.crd
kind: CustomResource
metadata:
name: customresource
spec:
preserveDataOnDelete: false
In my dev patch I would like to first patch CustomResource.spec.preserveDataOnDelete
to true and then once that's been patched, delete the object.
apiVersion: some.provider.crd
kind: CustomResource
metadata:
name: customresource
spec:
preserveDataOnDelete: false
---
$patch: delete
apiVersion: some.provider.crd
kind: CustomResource
metadata:
name: customresource
I know I can't rely on kustomize to apply both steps serially and atomically since it's just a yaml generator. I'm curious if there any other tools at my disposal I could use to do both steps in one swoop, mostly so I can do everything in one PR instead of splitting it up.