Skip to content

Commit f36f13a

Browse files
Merge pull request #37095 from michaelryanpeter/OSDK-proxy-docs-adding-go-lib-import
OSDK fixup: Updating Golang proxy tutorial code example
2 parents 93f2816 + 1ee7aaa commit f36f13a

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

modules/osdk-run-proxy.adoc

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ endif::[]
1717
[id="osdk-run-proxy_{context}"]
1818
= Enabling proxy support
1919

20-
To support proxied clusters, your Operator must inspect the environment for the following standard proxy variables and pass the values to Operands:
20+
Operator authors can develop Operators that support network proxies. Cluster administrators configure proxy support for the environment variables that are handled by Operator Lifecycle Manager (OLM). To support proxied clusters, your Operator must inspect the environment for the following standard proxy variables and pass the values to Operands:
2121

2222
* `HTTP_PROXY`
2323
* `HTTPS_PROXY`
@@ -33,11 +33,21 @@ This tutorial uses `HTTP_PROXY` as an example environment variable.
3333

3434
.Procedure
3535
ifdef::golang[]
36-
. Add the `proxy.ReadProxyVarsFromEnv` helper function to the reconcile loop in the `controllers/memcached_controller.go` file and append the results to the Operand environments:
36+
. Edit the `controllers/memcached_controller.go` file to include the following:
37+
.. Import the `proxy` package from the link:https://github.com/operator-framework/operator-lib/tree/v0.3.0[`operator-lib`] library:
38+
+
39+
[source,golang]
40+
----
41+
import (
42+
...
43+
"github.com/operator-framework/operator-lib/proxy"
44+
)
45+
----
46+
47+
.. Add the `proxy.ReadProxyVarsFromEnv` helper function to the reconcile loop and append the results to the Operand environments:
3748
+
3849
[source,golang]
3950
----
40-
...
4151
for i, container := range dep.Spec.Template.Spec.Containers {
4252
dep.Spec.Template.Spec.Containers[i].Env = append(container.Env, proxy.ReadProxyVarsFromEnv()...)
4353
}

0 commit comments

Comments
 (0)