I have a stack in dotnet that is using components....
# general
I have a stack in dotnet that is using components. The component depends on a resource which I then put that dependson in the components options. When I run up and it gives me a preview of the resources which the storage class is always at the bottom which makes since, since it depends on something up the graph. Unfortunately when I apply it the resource it created way at the beginning and fails since the demandant resource hasn't been created yet. Is there an issue with a component resource depending on another resource? It almost seems it is ignoring it. Preview
Copy code
Type                                                        Name                                      Plan       
     pulumi:pulumi:Stack                                         k8s-courageous-cluster-asc-dev-k8s-c02               
 +   ├─ rancher2:index:NodePool                                  workerNodePool1:asc-dev-k8s-c02-w1        create     
 +   ├─ rancher2:index:NodePool                                  workerNodePool3:asc-dev-k8s-c02-w3        create     
 +   ├─ rancher2:index:NodePool                                  masterNodePool:asc-dev-k8s-c02-m          create     
 +   ├─ rancher2:index:NodePool                                  workerNodePool2:asc-dev-k8s-c02-w2        create     
 +   ├─ rancher2:index:ClusterSync                               rancherClusterSync                        create     
 +   ├─ ascendlearning:rancher:SystemAddOnProject                systemAddOnsProject                       create     
 +   ├─ rancher2:index:Project                                   systemAddOnsProject:systemAddOnsProject   create     
 +   ├─ rancher2:index:Namespace                                 systemAddOnsProject:systemAddOnNamespace  create     
 +   ├─ kubernetes:core:ServiceAccount                           descheduler:ServiceAccount                create     
 +   ├─ kubernetes:<http://rbac.authorization.k8s.io:ClusterRole|rbac.authorization.k8s.io:ClusterRole>         descheduler:ClusterRole                   create     
 +   ├─ kubernetes:<http://rbac.authorization.k8s.io:ClusterRoleBinding|rbac.authorization.k8s.io:ClusterRoleBinding>  descheduler:ClusterRoleBinding            create     
 +   ├─ kubernetes:core:ConfigMap                                descheduler:ConfigMap                     create     
 +   ├─ kubernetes:batch:CronJob                                 descheduler:CronJob                       create     
 +   └─ kubernetes:<http://storage.k8s.io:StorageClass|storage.k8s.io:StorageClass>                   storageClass:vsphereStorageClass          create
Copy code
Type                                       Name                                    Status                  Info
     pulumi:pulumi:Stack                        k8s-courageous-cluster-asc-dev-k8s-c02  **failed**              1 error
 +   ├─ rancher2:index:NodePool                 workerNodePool2:asc-dev-k8s-c02-w2      created                 
 +   ├─ rancher2:index:NodePool                 workerNodePool1:asc-dev-k8s-c02-w1      created                 
 +   ├─ rancher2:index:NodePool                 masterNodePool:asc-dev-k8s-c02-m        created                 
 +   ├─ rancher2:index:NodePool                 workerNodePool3:asc-dev-k8s-c02-w3      created                 
 +   └─ kubernetes:<http://storage.k8s.io:StorageClass|storage.k8s.io:StorageClass>  storageClass:vsphereStorageClass        **creating failed**     1 error
You can see the storage class is created before it shows it would in the preview.
Yep, it looks like you already found the related issue: https://github.com/pulumi/pulumi-kubernetes/issues/861 I’ll respond there with a workaround you can use until we’ve fixed the root cause.
Hmm this isn't a chart though.
but does seem related
Yeah, the problem is with
classes in pulumi, which is what Chart uses
Ah makes sense
The workaround is to depend on the subresource from the
So how can I return the list of resources from the component so that another resource can depend on it? It does not let me return Outputs that are not " String, Boolean, Int32, Double, Nullable<...>, ImmutableArray<...> and ImmutableDictionary<string, ...> or a class explicitly marked with the [OutputTypeAttribute]" from ComponentResource classes.
I tried to return a ImmutableArray<Resource> as an Output but that also gave me the error.
@tall-librarian-49374 might know. I’m not familiar with the .NET SDK
[Output] public ImmutableArray<Resource> Resources {get;set;}
should work
Hmm, well, it might indeed fail for
. Which error are you getting?
Do you have any ETA for mentioned issue? Looks like it is something really difficult, lasts from October…
When I tried Resource I got the same error saying I could not pass it.
Copy code
public Output<ImmutableArray<Resource>> Resources { get; set; }
this.Resources = Output.Create(new ImmutableArray<Resource> {(Resource)systemAddOnsProject, (Resource)systemAddOnNamespace});

 contains invalid type Pulumi.Resource. Allowed types are:
        String, Boolean, Int32, Double,
        Nullable<...>, ImmutableArray<...> and ImmutableDictionary<string, ...> or
        a class explicitly marked with the [OutputTypeAttribute].
@tall-librarian-49374 Should I log an issue for this where the output cannot return a Resource or a ImmutableArray of Resource?
However, have you tried making it a non-output? Just a property that you assign without marking as
That worked.
Maybe I shouldn't be using [Outputs] for most of my components outputs anyways since they don't need to be retrieved outside the stack.