https://pulumi.com logo
#dotnet
Title
# dotnet
f

fast-dinner-32080

03/31/2020, 7:03 PM
I am having an issue with the DependsOn property on resources. I have a helm release that needs to occur before another resource can run. I have that resource depend on the helm release but it still always runs first which errors. Here is the code snippet. I am trying to understand if I am just doing it incorrectly or if this is a bug. So after the helm release the bootstrap resource should run now that rancher has been installed.
Copy code
var rancherHelmRelease = new Pulumi.Kubernetes.Helm.V3.Chart("rancher",
    new ChartArgs
    {
        Repo = "rancher-latest",
        Chart = "rancher",
        Version = config.Require("rancherVersion"),
        Namespace = cattleSystemNamespace.Metadata.Apply(x => x.Name),
        Values =
        {
            {"ingress.tls.source", "external"},
            {"tls", "external"},
            {"hostname", config.Require("rancherHost")},
            {"debug", config.RequireBoolean("rancherEnableDebug")},
            {"replicas", 3}
        }
    },
    new ComponentResourceOptions
    {
        Provider = kubernetesProvider,
        DependsOn =
        {
            rkeCluster,
            cattleSystemNamespace
        }
    });

var rancherBootstrapProvider = new Pulumi.Rancher2.Provider("rancherBootstrapProvider",
    new Pulumi.Rancher2.ProviderArgs
    {
        ApiUrl = $"https://{config.Require("rancherHost")}",
        Bootstrap = true
    });

// Initially setup server the first time creating admin account
var rancherBootstrap = new Pulumi.Rancher2.Bootstrap("rancherBootstrap",
    new BootstrapArgs
    {
        Password = commonEnvSecret.Data.Apply(x => (string)x["rancher_server_admin_password"]),
        Telemetry = false
    },
    new CustomResourceOptions
    {
        Provider = rancherBootstrapProvider,
        DependsOn =
        {
            rancherHelmRelease
        }
    });
t

tall-librarian-49374

03/31/2020, 7:45 PM
f

fast-dinner-32080

03/31/2020, 7:46 PM
Ah yea that could be it
t

tall-librarian-49374

03/31/2020, 7:47 PM
Could you add a comment there that you got the same with .NET?
f

fast-dinner-32080

03/31/2020, 7:48 PM
Sure thing!