Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/operator/configobserver/proxy/observe_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (f *observeProxyFlags) ObserveProxyConfig(genericListers configobserver.Lis
func proxyToMap(proxy *configv1.Proxy) map[string]string {
proxyMap := map[string]string{}

if noProxy := proxy.Spec.NoProxy; len(noProxy) > 0 {
if noProxy := proxy.Status.NoProxy; len(noProxy) > 0 {
proxyMap["NO_PROXY"] = noProxy
}

Expand Down
8 changes: 8 additions & 0 deletions pkg/operator/configobserver/proxy/observe_proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func TestObserveProxyConfig(t *testing.T) {
tests := []struct {
name string
proxySpec configv1.ProxySpec
proxyStatus configv1.ProxyStatus
previous map[string]string
expected map[string]interface{}
expectedError []error
Expand All @@ -43,6 +44,7 @@ func TestObserveProxyConfig(t *testing.T) {
{
name: "all unset",
proxySpec: configv1.ProxySpec{},
proxyStatus: configv1.ProxyStatus{},
expected: map[string]interface{}{},
expectedError: []error{},
},
Expand All @@ -53,6 +55,11 @@ func TestObserveProxyConfig(t *testing.T) {
HTTPSProxy: "https://someplace.it",
NoProxy: "127.0.0.1",
},
proxyStatus: configv1.ProxyStatus{
HTTPProxy: "http://someplace.it",
HTTPSProxy: "https://someplace.it",
NoProxy: "127.0.0.1",
},
expected: map[string]interface{}{
"openshift": map[string]interface{}{
"proxy": map[string]interface{}{
Expand All @@ -72,6 +79,7 @@ func TestObserveProxyConfig(t *testing.T) {
indexer.Add(&configv1.Proxy{
ObjectMeta: metav1.ObjectMeta{Name: "cluster"},
Spec: tt.proxySpec,
Status: tt.proxyStatus,
})
listers := testLister{
lister: configlistersv1.NewProxyLister(indexer),
Expand Down