MCPcopy Create free account
hub / github.com/devfile/devworkspace-operator / removeEmptyStrings

Function removeEmptyStrings

pkg/config/proxy/openshift.go:99–115  ·  view source on GitHub ↗

removeEmptyStrings is a utility function for removing empty fields from a proxy configuration. This is required to allow overriding

(proxyConfig *controller.Proxy)

Source from the content-addressed store, hash-verified

97// removeEmptyStrings is a utility function for removing empty fields from a proxy configuration. This is required
98// to allow overriding
99func removeEmptyStrings(proxyConfig *controller.Proxy) *controller.Proxy {
100 if proxyConfig == nil {
101 return nil
102 }
103
104 updated := &controller.Proxy{}
105 if proxyConfig.HttpProxy != nil && *proxyConfig.HttpProxy != "" {
106 updated.HttpProxy = proxyConfig.HttpProxy
107 }
108 if proxyConfig.HttpsProxy != nil && *proxyConfig.HttpsProxy != "" {
109 updated.HttpsProxy = proxyConfig.HttpsProxy
110 }
111 if proxyConfig.NoProxy != nil && *proxyConfig.NoProxy != "" {
112 updated.NoProxy = proxyConfig.NoProxy
113 }
114 return updated
115}

Callers 1

MergeProxyConfigsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected