Bug 2002200 - Operator-lib proxy block the "ReadProxyVarsFromEnv" for go type operator
Summary: Operator-lib proxy block the "ReadProxyVarsFromEnv" for go type operator
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Operator SDK
Version: 4.9
Hardware: Unspecified
OS: Unspecified
high
urgent
Target Milestone: ---
: 4.9.0
Assignee: amacdona@redhat.com
QA Contact: Fan Jia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-09-08 08:45 UTC by Fan Jia
Modified: 2021-10-18 17:51 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-10-18 17:51:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2021:3759 0 None None None 2021-10-18 17:51:45 UTC

Description Fan Jia 2021-09-08 08:45:36 UTC
Description of problem:
Pass down proxy env to operands failed for go type operator as the description : https://github.com/operator-framework/enhancements/blob/master/enhancements/proxy-passdown.md. Import the proxy package to the controller.go. But the proxy is not released ,can't be used for controller.go

Version-Release number of selected component (if applicable):
operator-sdk version: "v1.10.1-ocp", commit: "972fd59bb3a4cdb2e5102fc37fc3afa32f6c066f", kubernetes version: "v1.21", go version: "go1.16.5", GOOS: "linux", GOARCH: "amd64"

How reproducible:
always


Steps to Reproduce:
1.generate a go operator as https://docs.openshift.com/container-platform/4.8/operators/operator_sdk/golang/osdk-golang-tutorial.html
import the proxy package to the controller.go. But the proxy is not released ,can't be used for controller.go

$cat controllers/memcached_controller.go

package controllers

import (

proxy "github.com/operator-framework/operator-lib/proxy"

)

proxyVars := proxy.ReadProxyVarsFromEnv()
for _, container := range dep.Spec.Template.Spec.Containers
{ container.Env = append(container.Env, proxyVars) } 

2.$ go get github.com/operator-framework/operator-lib/proxy


Actual results:
$ go get github.com/operator-framework/operator-lib/proxy
go get: module github.com/operator-framework/operator-lib@upgrade found (v0.6.0), but does not contain package github.com/operator-framework/operator-lib/proxy


Expected results:
proxy package can be imported and function ReadProxyVarsFromEnv can get the env.http_proxy and append it to all the containers.


Additional info:

Comment 1 Jesus M. Rodriguez 2021-09-08 17:31:34 UTC
Please use 0.7.0 of operator-lib. We just released it with the proxy stuff in it. 

https://github.com/operator-framework/operator-lib/releases/tag/v0.7.0

Comment 2 Fan Jia 2021-09-09 03:00:30 UTC
The proxy package can be import in version 0.7.0

Comment 5 errata-xmlrpc 2021-10-18 17:51:28 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.9.0 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:3759


Note You need to log in before you can comment on or make changes to this bug.