-
Notifications
You must be signed in to change notification settings - Fork 132
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
Add reference for Configuration to kafka cluster #877
Add reference for Configuration to kafka cluster #877
Conversation
e620a35
to
5db43cd
Compare
/test-examples="examples/kafka/cluster.yaml" |
config/kafka/config.go
Outdated
} | ||
r.References["configuration_info.revision"] = config.Reference{ | ||
Type: "Configuration", | ||
Extractor: "GetConfigurationRevision()", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extractor: "GetConfigurationRevision()", | |
Extractor: `github.com/upbound/upjet/pkg/resource.ExtractParamPath("latest_revision",true)`, |
We have a function for such situations, could you please try the configuration above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! I thought I remembered seeing something like that, and looked for it, but couldn't find it. This is much better.
Since it takes a long time to create and delete this resource, can you add a 2-hour timeout like here to extend the running time of uptest? |
I updated the example to include the 2 hour timeout (oof) and also fixed a schema error. I don't know why the For some reason when I try to run the e2e test locally I get this error:
Any idea why that might be? |
Can you use the example here for the |
ok, that's fixed. Now the problem is that the
even though the
|
Oh, I bet the problem is that |
Then we can consider canceling the reference definition for the revision parameter and passing the value as |
That will make the test pass. I already tried that locally and it worked. It does make the reference substantially less useful, but I suppose it's still better than nothing? How deeply baked into the code for resolving references is the requirement that the resolved value must be a string? What I'd really like to be able to do is use a Resolver that returns an object, which I can customize. Something like (pseudocode)
This seems useful in general as a flexible (ideally user-definable) way to define arbitrary dependencies between managed resources. Are you aware of any design discussions around possibly supporting this, or on why it would be prohibitively difficult? |
/test-examples="examples/kafka/cluster.yaml" |
For checking uptest logs: crossplane-contrib/provider-upjet-gcp#391 (comment) |
As far as I can tell the test failed because one or more of the subnets didn't become ready.
Maybe for some reason your aws account is only allowed to use the I ran the test twice locally on my laptop. The first time, after it had requested creation of the cluster, one of the aws api calls failed with a network error, probably because I was switching between wifi and ethernet, which caused the provider to I reran the test a second time and left my computer plugged in to ethernet the whole time. The test passed without intervention, and those are the results I posted above. |
Yes, it is, if this run also fails due to this, you can use |
/test-examples="examples/kafka/cluster.yaml" |
I moved the whole example to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for your work in this PR @mbbush, LGTM.
Description of your changes
Partially Fixes #489
It seems that creating a kafka cluster sometimes fails, with an error related to the configuration, as described in #489. One workaround we've implemented is to always define both the
Configuration.kafka
and theCluster.kafka
in the same composition, and patch from theConfiguration
to the composite, then from the composite to theCluster
withfromFieldPath: Required
. This is cumbersome, but it works.This seems like potentially a better solution, allowing the use of a selector to get essentially the same behavior, but the cost is that it requires you to specify the same selector twice. What I really wanted to do was to be able to extract both the ARN and the revision from the same object, but it seems like the output of the
ExtractValueFn
must always be a string, andmake generate
panics if I have more than one selector with the same name, so I couldn't see a way to do it.I have:
make reviewable test
to ensure this PR is ready for review.How has this code been tested