bland-processor-73185
10/06/2024, 6:30 PMgetResource
typed API which was very helpful.
From the docs it's not very clear how I'm supposed to do it. I switched some deployments from the v3 to the v4 chart and I end up with this sort of diff:
- const clusterCrd = operatorChart.getResource("apiextensions.k8s.io/v1/CustomResourceDefinition", "rabbitmqclusters.rabbitmq.com").apply(c => notNull(c));
+ const clusterCrd = operatorChart.resources.apply(resources => {
+ for (const r of resources) {
+ if (r.__pulumiType === "kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition" && r.__name.endsWith("rabbitmqclusters.rabbitmq.com")) {
+ return r;
+ }
+ }
+ throw new Error("Could not find rabbitmq operator CRD");
+ });
How do you handle this ? (btw this is typescript, but I guess it's the same in other languages ?)No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by