-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CustomResource lifecycle causes issues with importing created resources #1056
Comments
This appears somewhat similar to #912 Specifically where it mentions:
|
@donovanmuller This is exactly the same issue i'm currently facing. After reading the documentation thoroughly, this seems to be what the I'm sure there is a way. |
My current thoughts (still need to experiment) are to wrap the |
To add to this:
perhaps the way kpt handles this when waiting for reconcile could be borrowed? |
Thanks for the detailed writeup and resource links. pulumi/pulumi#1691 is related, and pulumi/pulumi#1691 (comment) might be a workaround for you until we're done with that work. |
I think I found a pretty simple workaround for this sort of issue: take a look at the following gist if interested. https://gist.github.com/timmyers/4d2fed53a358d4c98557a5886ae2afbb |
Problem description
It is sometimes required to get/import/use resources created as the result of creating a
CustomResource
that is acted on by a controller/operator. Currently I'm facing challenges getting this to work reliably from scratch with the example above.In the example I would like to access the
Secret
(containing user credentials) created as part of creating a newElasticsearch
cluster (via the ECK operator), however I am facing the following issues:Secret
not yet being present (it will be created after theCustomResource
is applied) and therefore resorting to using--skip-preview
Elasticsearch
custom resourcestatus
is not taken into account and therefore does not wait for the that resource to become healthy before attempting to import theSecret
, which results in the import failingI have to resort to running the program twice. First time creates the
CustomResource
(which then is handled by the controller/operator and creates the other resources, theSecret
I need being one of them) and fails on the import. Second time succeeds on the import as it now exists.Errors & Logs
On the first run:
error: resource 'default/test-es-elastic-user' does not exist
The second run will import successfully because the
Secret
has been created in the meantime:Suggestions for a fix
Perhaps there is already a solution that would cater for my use case and a solution/workaround can be suggested but in the lack thereof, it would be great:
CustomResource
to become healthy so that any dependents could continue based on the fact that the custom resource was fully created. Given that custom resources have differing ways of determining health/status, perhaps a function could be provided to determine what that would look like by checking variousstatus
properties--skip-preview
The text was updated successfully, but these errors were encountered: