proxy

package
v0.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

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

func IsOverridden(envVar []corev1.EnvVar) (overrides bool)

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

type Querier interface {
	QueryProxyConfig() (proxy []corev1.EnvVar, err error)
}

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

func (w *Syncer) QueryProxyConfig() (proxy []corev1.EnvVar, err error)

QueryProxyConfig queries the global cluster level proxy object and then returns the proxy env variable(s) to the user.

func (*Syncer) SyncProxy

func (w *Syncer) SyncProxy(object interface{}) error

SyncProxy is invoked when a cluster scoped proxy object is added or modified.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL