https://garden.io logo
#💻|dev
Title
# 💻|dev
p

purple-oyster-28927

04/27/2023, 1:59 PM
I need help with making pulumi related provider / module fields mutually exclusive. Could someone point me on how to achieve it?
For example: - if
backendURL
is set to a value a that doesn't contain https://api.pulumi.com or https://app.pulumi.com and
orgName
is set either in providerConfig or moduleConfig, I would like to fail garden during the validate phase and display an error message - if
backendURL
is set to a value a that doesn't contain https://api.pulumi.com or https://app.pulumi.com and
cacheStatus; true
is set in moduleConfig, I would like to fail garden during the validate phase and display an error message
https://github.com/garden-io/garden/pull/4107 is the PR with related changes. CC: @ancient-diamond-80011 (since I saw you were updating pulumi related docs in Bonsai branch)
a

ancient-diamond-80011

04/27/2023, 2:23 PM
joi
has some capability for
.xor()
validation and we use it in some places in the codebase, but your usecase sounds a bit more complex than that
and
oxor()
for optional exclusive or
p

purple-oyster-28927

04/27/2023, 3:37 PM
Thank you! Paired with @big-spring-14945 and fixed the functionality. PR has been updated.