sparse-intern-71089
02/16/2021, 11:01 AMtall-librarian-49374
02/16/2021, 11:10 AMApply
?
{ "controller", staticIp.Apply(ip => new Dictionary<string, object>
{
...
{ "loadBalancerIP", ip },
...
curved-doctor-83600
02/16/2021, 1:05 PMminiature-leather-70472
02/16/2021, 1:27 PMImmutableDictionary<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)));
}
}
}curved-doctor-83600
02/16/2021, 1:48 PMminiature-leather-70472
02/16/2021, 2:41 PMtall-librarian-49374
02/16/2021, 3:57 PM