pulp-operator
pulp-operator copied to clipboard
Missing CRD schema causes Terraform to recreate resources
Version This issue isn't directly related to any specific version of the Operator, but we're on v1.0.0-beta.4.
Describe the bug
We created our Pulp resource for the Operator using the Terraform kubernetes_manifest resource. When we made an update to spec.pulp_settings in the resource, Terraform wanted to delete and recreate the Pulp resource. It sounds like the kubernetes provider (specifically, the kubernetes_manifest resource) will do this when x-kubernetes-preserve-unknown-fields is set to true (as it is in pulps.repo-manager.pulpproject.org) and a schema is not provided.
To Reproduce Steps to reproduce the behavior:
- Deploy a Pulp instance via the Operator by creating a
kubernetes_manifestresource using the Terraform provider. - Update
spec.pulp_settings. - Do a
terraform applyand watch it try to delete and recreate the resource.
Expected behavior The resource should update in place.
Additional context
Obviously I worked around this by just updating the Pulp spec with kubectl, but this is kind of a bummer. Was using x-kubernetes-preserve-unknown-fields a conscious choice? I'm also not sure if updating in-place vs. deleting and recreating matters... I suspect it would depend on the storage class (and whether the PVs get auto-cleaned or not). I'm a little afraid to try it and find out.