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 ?)