This message was deleted.
# general
s
This message was deleted.
g
We don’t currently support importing a
ComponentResource
. It looks like those API docs are incorrect, so sorry for the confusion.
I’ll get that fixed
a
Yes, I noticed that you couldn't import a ComponentResource. I figured it perhaps used to be a CustomResourceOptions but searching in the code, it appeared that it had always been a subclass of ComponentResource AFAICS. That's for raising the issue.
Since I was looking in the code for the v2 Chart, I came across
transformations
: https://github.com/pulumi/pulumi-kubernetes/blob/baa5a9f757c8874f5d62c3f5c0ed82931738b5ea/sdk/nodejs/helm/v2/helm.ts#L41-L64 I used this to set
opts.import
to the id of my resources. However, Pulumi still refused to import them, thinking they resources had changed quite dramatically with changes to `metadata`and
spec
.
Copy code
import     [diff: +spec~metadata]; 1 warning
Any idea what I might be missing? The
metadata
might need some tweaking in
transformations
, but the
spec
is not entirely new 🙂
g
You should be able to tell what needs to change based on the detailed diff. We’re looking at ways to make this import process easier, but for now, it’s a matter of manually reconciling the diff. I don’t know if it’s possible in your case, but recreating the resources with Pulumi would be a lot easier than trying to reconcile a full helm chart.
a
The detailed diff shows that I'm adding everything under
spec
which is the whole resource! That's definitely not the case. Plus these are the same Helm charts that are already deployed to production, so something's awry. These Helm charts i questions are our own and some are quite simple with a single resource. Anyhow, I've decided to spend no more time trying to import and am going to go with the somewhat risker delete-and-create solution. With computing, often the answer is a "reboot" 🙂
Seems that part of the problem is that these resources were originally created with Helm v2 meaning that they do not have the
last-applied-configuration
annotation. I've given up on importing my Helm charts directly (as I would much rather use TypeScript than Go templates to configure my resources!). However, I've had some success importing resources using a "dry run" provider. https://github.com/pulumi/pulumi-kubernetes/issues/924#issuecomment-566747162