https://pulumi.com logo
#typescript
Title
# typescript
s

square-bear-79319

06/12/2019, 3:36 PM
Hello everyone. Am trying to create unit tests for a Pulumi project which installs a specific version of istio on an existing cluster. The version of the istio is provided as part of the Pulumi.dev.yaml. When running the Unit tests, mu understanding is this has to be passed as part of the
PULUMI_CONFIG="{ \"aws:region\": \"us-east-1\", \"istio_version\": \"1.1.7\" }"
, but it does not seem to work. When i output the config values. it only has the value of the name which is part of
PULUMI_NODEJS_PROJECT="wawa-runtime-istio";
. In general, PULUMI_CONFIG does not seem to take the values provided and is not working as intended. Any help on this is much appreciated.
Copy code
Config { name: 'wawa-runtime-istio' }


Error: repo istio-undefined not found
Error: repo istio-undefined not found
(node:22548) UnhandledPromiseRejectionWarning: Error: Error: Command failed: helm fetch istio-undefined/istio-init --untar --version undefined --destination C:\Users\guptak1\AppData\Local\Temp\1\tmp-22548iGyXL4S208pz
Error: repo istio-undefined not found
w

white-balloon-205

06/12/2019, 4:18 PM
Curious - what do you see if you call
pulumi.runtime.allConfig()
? And what do you see if you get
process.env[“PULUMI_CONFIG]
?
s

square-bear-79319

06/12/2019, 4:53 PM
Hi @white-balloon-205 For
Pulumi.runtime.allConfig()
the output is
Copy code
{
  'aws:region': 'us-east-1',
  'wawa-runtime-istio': { istio_version: '1.1.7' }
}
and for
process.env{"PULUMI_CONFIG"]
the output is
Copy code
{
  "aws:region": "us-east-1",
  "wawa-runtime-istio": {
    "istio_version": "1.1.7"
  }
}
The values seem to be there, but doe snot seem to be resolved here
let istio_version = configs.get("istio_version");
ok, think i figured this out, but wanted to confirm.
Copy code
process.env.PULUMI_NODEJS_PROJECT="wawa-runtime-istio";
process.env.PULUMI_CONFIG="{ \"aws:region\": \"us-east-1\", \"wawa-runtime-istio:istio_version\": \"1.1.7\" }";
Looks like the value in nodejs_project should be the same as the one given for each of the custom variables. This was somehow not obvious and hence the confusion. Please let know if that is not the case.
5 Views