opened
draychev
username_0
This PR proposes we use `k8scontext.KubernetesResources{}` in lieu of a list of args for each top level Controller function.  Instead of passing around `ingressList`, `serviceList` etc - let's pass around a pointer to a struct that has these.

The motivation for this is - needing to pass around the new `AzureIngressManagedTarget` and `AzureIngressProhibitedTarget`.  It seems appropriate to pave the road for the next person who'd need to pass around a new struct - they would only have to add it to `KubernetesResources`

```go
type KubernetesResources struct {
	IngressList       []*v1beta1.Ingress
	ServiceList       []*v1.Service
	ManagedTargets    []*mtv1.AzureIngressManagedTarget
	ProhibitedTargets []*ptv1.AzureIngressProhibitedTarget
	EnvVariables      environment.EnvVariables
}
```

At a high level - the Ingress Controller fetches a set of data from Kubernetes and some workers then construct App Gwy config based on these.  It seems we could simplify things a bit if we exposed everything we have obtained from k8s in this struct.
[RFC] Use k8scontext.KubernetesResources to pass common arguments around
issue
created
akshaysngupta
username_1
I think this is good. Keeping all the dependencies together.
Go ahead with it.

Just a minor comment about the placement of this struct. Two options:
1) Can it be in appgw and not in k8context as it contains environment?
or
2) Can you move env out of this struct ?
comment
created
draychev
username_0
@username_1  Moved the new struct into the `appgw` namespace.

I really like the environment variables in this new struct.  I thought about it and went back to see what it would take to put it as a top-level argument to the methods that need it.
And I realized how easy it is to just have it in this struct.  I do think semantically it does not quite belong to the set of `KubernetesResources` but on the other hand - it is a static thing that is global to all functions/methods that generate config.
Perhaps `KubernetesResources` needs a better name?
comment
created
draychev
username_0
@username_1 How does `ConfigBuilderContext ` sound?
PTAL!
comment