Thread
#general
    d

    damp-honey-93158

    3 months ago
    I'm running integration tests and one of them references another stack. The pulumi auth is via a PAT token, and my user account has access to three orgs - the tests run fine on my machine, but in CI (on azure devops) my stackreference isn't finding the target stack and dies with pulumi😛ulumi:StackReference ref-to-registry error: unknown stack "effectiveflow/TestStandardRuntime_Up_FullSDLC/singletons". In CI I logged pulumi whoami - that's correct (it's my account name). I'm stumped as to why the CI system can't see the stack. The only thing I can think of right now is the automation api code that I'm using to create the stack is using a different org to set the stack compared to the hard-coded org I'm expecting. Is there a way to force which org the LocalWorkspace uses when calling CreateStackAsync? code:
    using var singletonStack =
        await LocalWorkspace.CreateStackAsync(new InlineProgramArgs(pulumiProjectName, singletonsStackName,
            singletonProgram));
    I'm wondering if I should set the pulumiProjectName to "org/project" instead of just "project" for example. thank you!
    So I just found the InlineProgramArgs class, which derives from LocalWorkspaceOptions - but there are no org specific values in there, nor do they appear before or after the UpAysnc() runs - I checked that via breakpoints 🙂
    I'm now trying to use the pulumi org set-default command in the CI pipeline, lets see what happens.
    and yep - that appears to do the trick! Thanks me!