I am attempting to adopt an existing Service and m...
# kubernetes
d
I am attempting to adopt an existing Service and modify it. I do this by creating a new Service instance with the same ID and state as the existing resource. I then modify the state, and pulumi applies the changes. The problem I have is when I invoke
pulumi destroy
Pulumi ends up deleting the existing resource instead of just reverting my changes. How do I fix this? I don't want to delete the resource, nor do I want to leave it as-is... I want to reverse the property changes.
m
Try using the ServicePatch resource instead. All the K8s resources have a patch variant that does not take full ownership of the resource, but just applies changes as a field manager
d
Good point! I forgot about that... Trying it now.