Skip to content

Add proxy support#254

Merged
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
jhadvig:proxy
Jul 12, 2019
Merged

Add proxy support#254
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
jhadvig:proxy

Conversation

@jhadvig
Copy link
Copy Markdown
Member

@jhadvig jhadvig commented Jul 10, 2019

Adding console support for cluster proxy. If the Proxy CRD is set, operator will read them and set proper environment variables inside the console container.
FollowUp should be setting the proxy on the console server http client as does in.

/assign @benjaminapetersen @zherman0

Story: https://jira.coreos.com/browse/CONSOLE-1440

@openshift-ci-robot openshift-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 10, 2019
@spadgett spadgett added this to the v4.2 milestone Jul 10, 2019
}

func DefaultDeployment(operatorConfig *operatorv1.Console, cm *corev1.ConfigMap, serviceCAConfigMap *corev1.ConfigMap, sec *corev1.Secret, rt *routev1.Route, canMountCustomLogo bool) *appsv1.Deployment {
func DefaultDeployment(operatorConfig *operatorv1.Console, cm *corev1.ConfigMap, serviceCAConfigMap *corev1.ConfigMap, sec *corev1.Secret, rt *routev1.Route, proxyConfig *configv1.Proxy, canMountCustomLogo bool) *appsv1.Deployment {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this function call has gotten long enough that we should pass in a struct. Maybe add that to tech debt?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah definitely would add it as techdebt 👍

if proxyConfig == nil {
return envVars
}
if len(proxyConfig.Status.HTTPSProxy) != 0 {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You do a check on proxyConfig if it is nil, but what about proxyConfig.Status? Is that guaranteed to be there?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't be needed since it's not a pointer

@spadgett
Copy link
Copy Markdown
Member

/retest

1 similar comment
@jhadvig
Copy link
Copy Markdown
Member Author

jhadvig commented Jul 11, 2019

/retest

Copy link
Copy Markdown
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jhadvig

/lgtm


proxyConfig, err := c.proxyCfgLister.Get("cluster")
if err != nil {
if !errors.IsNotFound(err) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 The proxy config might not be there always on upgrade, and we shouldn't error. Good catch.

I believe we can remove this in 4.3.

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 12, 2019
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jhadvig, spadgett, zherman0

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 12, 2019
@spadgett
Copy link
Copy Markdown
Member

@jhadvig We'll need to make sure the proxy is not used when connecting to internal services from console, but is used for the OAuth server. See openshift/console#1249

@jhadvig
Copy link
Copy Markdown
Member Author

jhadvig commented Jul 12, 2019

/retest

@openshift-merge-robot openshift-merge-robot merged commit ea85811 into openshift:master Jul 12, 2019
@jhadvig
Copy link
Copy Markdown
Member Author

jhadvig commented Jul 15, 2019

@spadgett so the proxy for oauth server is set in.
There is also a opened PR to pass the proxy envVars to Kibana.

resourceSyncer: resourceSyncer,
// proxy
proxyCfgLister: proxyCfgInformer.Lister(),
proxyCfgInformer: proxyCfgInformer.Informer(),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe proxyCfgInformer: proxyCfgInformer.Informer(), is needed here. You have the WithInformer() call with the proxyCfgInformer below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants