This message was deleted.
# dotnet
s
This message was deleted.
t
Try
Apply
?
Copy code
{ "controller", staticIp.Apply(ip => new Dictionary<string, object>
  {
   ...
     { "loadBalancerIP", ip },
...
c
Tried that, but doesn't work unfortunately. What I also don't understand: if I change any of those values (let's say hardcode the ip instead of using the output or changing NodeCount to a different integer), calling "pulumi preview --diff" does not indicate any change. I am sure I am missing sth. here.
m
I did this with a transform on the Helm chart, mainly to avoid having to wrap the whole values section an an apply.
ImmutableDictionary<string, object> SetLbIp(ImmutableDictionary<string, object> obj,
CustomResourceOptions opts) { if ((string) obj["kind"] == "Service" && ((string) ((ImmutableDictionary<string, object>) obj["metadata"])["name"]).EndsWith( "ingress-nginx-controller", StringComparison.InvariantCultureIgnoreCase)) { var spec = (ImmutableDictionary<string, object>) obj["spec"]; var metadata = (ImmutableDictionary<string, object>) obj["metadata"]; if (spec != null && (string) spec["type"] == "LoadBalancer") { obj = obj.SetItem("spec", spec.SetItem("loadBalancerIP", args.LoadBalancerIp.Apply(x => x))); } } }
c
Thanks @miniature-leather-70472, that sounds reasonable. Just to be sure, the args.LoadBalancerIp in your snippet is an output, probably Output<string>? With the hint from @tall-librarian-49374 I finally understood that I can wrap the whole values section in an apply (as you mentoined as well). WIll try your suggestion as well and see what appeals more to me. Thanks for your help, I really appreciate that.
m
yep. args.LoadBalancerIp is an Output<string> that is created earlier in the process. You can certainly wrap the values in an apply and that should work too. There is a bug open somewhere about the fact that the helm chart should work with Outputs directly
t
Ah, thank you both for the feedback!