-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configure DWO to not process proxy settings for workspaces Che manages #1741
Conversation
Signed-off-by: Angel Misevski <[email protected]>
…tected If we allow the DevWorkspace Operator to handle proxy settings for workspaces, it will add proxy environment variables to workspace containers with the values it detects on the cluster (or through its own DevWorkspaceOperatorConfig) Since these environment variables are defined in the deployment yaml, their values override values for proxy environment variables defined by the automount 'proxy-config' configmap. To avoid this, we configure DWO to not set any proxy settings for workspaces we manage. Signed-off-by: Angel Misevski <[email protected]>
To hopefully ensure all tools respect proxy settings for a workspace, add both upper- and lower-case versions of the proxy environment variables to workspaces. For example, curl will only use the lower-case http_proxy, and will ignore HTTP_PROXY. Signed-off-by: Angel Misevski <[email protected]>
Signed-off-by: Angel Misevski <[email protected]>
cc5075c
to
5baf24a
Compare
PR is now ready for review |
@@ -104,6 +105,13 @@ func updateWorkspaceConfig(cheCluster *chev2.CheCluster, operatorConfig *control | |||
|
|||
updateWorkspaceImagePullPolicy(devEnvironments.ImagePullPolicy, operatorConfig.Workspace) | |||
|
|||
if ctx.Proxy.HttpProxy != "" || ctx.Proxy.HttpsProxy != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Could you add some comments explaining why we have to clean up proxy config, please?
- There is something that I don't understand. If proxy is set, then we have to clean up to DWO proxy config. If proxy is not set, then we do nothing. What is the point of DWO proxy config then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, I agree some comments here would be helpful.
As for why DWO supports configuring the proxy, the answer is twofold: first, it exists as an option because we implemented it (way back in v0.12); second, it's a feature that's still used by other consumers of DevWorkspaces, such as Web Terminal.
Che introduced its own implementation of managing proxy settings for DevWorkspaces, but the two implementations collide -- Che supports the proxy by creating a che-proxy-settings
configmap which is mounted as env vars, and so needs to disable built-in DWO proxy configuration/detection.
Basically, what we're doing here is telling DWO "we'll handle setting up proxy environment variables, you shouldn't do it for this workspace".
Co-authored-by: Anatolii Bazko <[email protected]> Signed-off-by: Angel Misevski <[email protected]>
a74fc10
to
ba1370b
Compare
Codecov Report
@@ Coverage Diff @@
## main #1741 +/- ##
==========================================
- Coverage 59.58% 59.50% -0.08%
==========================================
Files 71 71
Lines 8571 8592 +21
==========================================
+ Hits 5107 5113 +6
- Misses 3115 3129 +14
- Partials 349 350 +1
|
@amisevsk: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for explanation.
Please merge.
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: amisevsk, tolusha The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Build 3.10 :: operator_3.x/304: Console, Changes, Git Data |
Build 3.10 :: sync-to-downstream_3.x/4994: Console, Changes, Git Data |
Build 3.10 :: operator-bundle_3.x/2193: Console, Changes, Git Data |
Build 3.10 :: sync-to-downstream_3.x/5029: Console, Changes, Git Data |
Build 3.10 :: operator-bundle_3.x/2194: Console, Changes, Git Data |
Build 3.10 :: sync-to-downstream_3.x/5030: Console, Changes, Git Data |
Build 3.10 :: operator-bundle_3.x/2195: Console, Changes, Git Data |
Build 3.10 :: sync-to-downstream_3.x/5033: Console, Changes, Git Data |
Build 3.11 :: operator_3.x/306: Console, Changes, Git Data |
Build 3.11 :: operator-bundle_3.x/2196: Console, Changes, Git Data |
Build 3.11 :: sync-to-downstream_3.x/5053: Console, Changes, Git Data |
Build 3.11 :: get-sources-rhpkg-container-build_3.x/4889: devspaces-operator : 3.x :: Failed in : BREW:BUILD/STATUS:UNKNOWN |
Build 3.11 :: operator-bundle_3.x/2197: Console, Changes, Git Data |
Build 3.11 :: sync-to-downstream_3.x/5054: Console, Changes, Git Data |
Build 3.11 :: get-sources-rhpkg-container-build_3.x/4891: devspaces-operator-bundle : 3.x :: Failed in : BREW:BUILD/STATUS:UNKNOWN |
Build 3.11 :: operator-bundle_3.x/2198: Console, Changes, Git Data |
Build 3.11 :: sync-to-downstream_3.x/5057: Console, Changes, Git Data |
Build 3.11 :: get-sources-rhpkg-container-build_3.x/4894: devspaces-operator-bundle : 3.x :: Failed in : BREW:BUILD/STATUS:UNKNOWN |
Build 3.11 :: operator-bundle_3.x/2199: Console, Changes, Git Data |
Build 3.11 :: sync-to-downstream_3.x/5059: Console, Changes, Git Data |
Build 3.11 :: get-sources-rhpkg-container-build_3.x/4896: devspaces-operator-bundle : 3.x :: Failed in : BREW:BUILD/STATUS:UNKNOWN |
What does this PR do?
If Che detects proxy settings on a cluster (either through configuration or the OpenShift cluster-wide proxy), configure the DevWorkspace Operator to not use any proxy settings internally for workspaces.
This is necessary to allow the
proxy-settings
configmap provisioned by Che to actually be used in workspaces; otherwise, DWO will set the proxy environment variables in the workspace deployment directly, overriding env vars set from the configmap.In addition, this PR updates the proxy env configmap to include lowercase versions of environment variables (i.e.
http_proxy
,https_proxy
,no_proxy
) to try to ensure compatibility with all tools (e.g.curl
only useshttp_proxy
, notHTTP_PROXY
)This PR is marked WIP as it depends on changes from devfile/devworkspace-operator#1147; once DWO v0.23 is released, the first commit in this PR needs to be updated to use 0.23 instead of a main-branch commit.Screenshot/screencast of this PR
N/A
What issues does this PR fix or reference?
Closes eclipse-che/che#22370
How to test this PR?
Changes from this PR are pushed to
quay.io/amisevsk/che-operator:proxy-config
To test,
chectl server:deploy -p openshift --olm-channel next
eclipse-che.<ver>.next
) to usequay.io/amisevsk/che-operator:proxy-config
for the Che Operator imageOnce workspace is running, verify
PR Checklist
As the author of this Pull Request I made sure that:
What issues does this PR fix or reference
andHow to test this PR
completedReviewers
Reviewers, please comment how you tested the PR when approving it.