You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's a very common pattern when deploying large manifests that we need to deploy some resources before others or filter resources. For example, I might want to deploy all CRDs and namespaces first in one Pulumi resource, then deploy all of their dependencies via a second.
With the upcoming release of yaml/v2.ConfigFile and yaml/v2.ConfigGroup, the following workaround won't work.
Current behavior
Here's an example of how I use this to filter the CRDs, to apply them first:
constcrds=newk8s.kustomize.Directory(`${name}-crds`,{directory: './kubeflow',// relative to Pulumi project roottransformations: [crdsOnly,skipAwait,patchForce],},{ ...opts,retainOnDelete: true},);
exportfunctioncrdsOnly(obj: any,opts: pulumi.CustomResourceOptions): void{if(typeofobj==='object'&&obj!==null){if(!objIsCrd(obj)){removeItem(obj);}}}functionobjIsCrd(obj: object): boolean{return'kind'inobj&&obj.kind==='CustomResourceDefinition';}// Workaround for Pulumi, this effectively removes it from the resources to applyfunctionremoveItem(obj: any): void{for(constkeyofObject.keys(obj)){if(key!=='apiVersion'&&key!=='kind'){// eslint-disable-next-line @typescript-eslint/no-dynamic-deletedeleteobj[key];}}obj.apiVersion='v1';obj.kind='List';obj.items=[];}
Affected area/feature
The text was updated successfully, but these errors were encountered:
Hello!
Issue details
Using Transformations and a workaround for the following feature request, it's possible to filter the resources. This is however, a bit clumbsy.
It's a very common pattern when deploying large manifests that we need to deploy some resources before others or filter resources. For example, I might want to deploy all CRDs and namespaces first in one Pulumi resource, then deploy all of their dependencies via a second.
With the upcoming release of
yaml/v2.ConfigFile
andyaml/v2.ConfigGroup
, the following workaround won't work.Current behavior
Here's an example of how I use this to filter the CRDs, to apply them first:
Affected area/feature
The text was updated successfully, but these errors were encountered: