Documentation ¶
Index ¶
- func IsAPIAvailable(discovery apidiscovery.DiscoveryInterface) (supported bool, err error)
- func IsOverridden(envVar []corev1.EnvVar) (overrides bool)
- func NewSyncer(logger *logrus.Logger, client configv1client.Interface, ...) (proxyInformer configv1.ProxyInformer, syncer *Syncer, querier Querier, ...)
- func ToEnvVar(proxy *apiconfigv1.Proxy) []corev1.EnvVar
- type Querier
- type Syncer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsAPIAvailable ¶
func IsAPIAvailable(discovery apidiscovery.DiscoveryInterface) (supported bool, err error)
IsAPIAvailable return true if OpenShift config API is present on the cluster. Otherwise, supported is set to false.
func IsOverridden ¶
IsOverridden returns true if the given container overrides proxy env variable(s). We apply the following rule:
If a container already defines any of the proxy env variable then it overrides all of these.
func NewSyncer ¶
func NewSyncer(logger *logrus.Logger, client configv1client.Interface, discovery discovery.DiscoveryInterface) (proxyInformer configv1.ProxyInformer, syncer *Syncer, querier Querier, err error)
NewSyncer returns informer and sync functions to enable watch of Proxy type.
func ToEnvVar ¶
func ToEnvVar(proxy *apiconfigv1.Proxy) []corev1.EnvVar
ToEnvVar accepts a config Proxy object and returns an array of all three proxy variables with values.
Please note that the function uses the status of the Proxy object to rea the proxy env variables. It's because OpenShift validates the proxy variables in spec and writes them back to status. As a consumer we should be reading off of proxy.status.
Types ¶
type Querier ¶
Querier is an interface that wraps the QueryProxyConfig method.
QueryProxyConfig returns the global cluster level proxy env variable(s).
func NoopQuerier ¶
func NoopQuerier() Querier
NoopQuerier returns an instance of noopQuerier. It's used for upstream where we don't have any cluster proxy configuration.
type Syncer ¶
type Syncer struct {
// contains filtered or unexported fields
}
Syncer deals with watching proxy type(s) on the cluster and let the caller query for cluster scoped proxy objects.
func (*Syncer) HandleProxyDelete ¶
func (w *Syncer) HandleProxyDelete(object interface{})
HandleProxyDelete is invoked when a cluster scoped proxy object is deleted.
func (*Syncer) QueryProxyConfig ¶
QueryProxyConfig queries the global cluster level proxy object and then returns the proxy env variable(s) to the user.