Skip to content

Add ProxyStatus to config/v1/types_proxy#335

Merged
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
patrickdillon:add-proxy-status
Jun 6, 2019
Merged

Add ProxyStatus to config/v1/types_proxy#335
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
patrickdillon:add-proxy-status

Conversation

@patrickdillon
Copy link
Copy Markdown
Contributor

@patrickdillon patrickdillon commented Jun 3, 2019

xref: https://jira.coreos.com/browse/CORS-1074

Adding a ProxyStatus object which contained a NoProxy field would represent the user-specified NO_PROXY settings from the installer install-config plus any platform-specific values that need to be added in addition to the user-specified values.

CC @abhinavdahiya

@openshift-ci-robot openshift-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 3, 2019
@abhinavdahiya
Copy link
Copy Markdown
Contributor

/lgtm

@patrickdillon https://github.com/openshift/api/blob/master/Makefile would might need to run some generation scripts.

make generate-with-container ??

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 3, 2019
Comment thread config/v1/types_proxy.go
Comment thread config/v1/types_proxy.go Outdated
Comment thread config/v1/types_proxy.go
// ProxyStatus shows current known state of the cluster proxy
type ProxyStatus struct {
// noProxy is the list of domains for which the proxy should not be used.
NoProxy string `json:"noProxy,omitempty"`
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 a list of domains be []string?

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.

Also, does the presence of whatever.example.com in this field mean that some.subdomain.whatever.example.com should not be proxied either? Or are subdomains supposed to be listed explicitly?

Copy link
Copy Markdown
Contributor Author

@patrickdillon patrickdillon Jun 4, 2019

Choose a reason for hiding this comment

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

Shouldn't a list of domains be []string?

I set this to be the same type as ProxySpec.NoProxy. I believe a comma-separated string is the convention after looking over some 3.11 & AWS docs.

Also, does the presence of whatever.example.com in this field mean that some.subdomain.whatever.example.com should not be proxied either?

Yes, I believe that is the case. Looking at this 3.11 doc:

example.com would match example.com, example.com:80, and www.example.com.

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.

Those 3.11 docs are complicated. What's the policy for things like that? Do we want docs here? If so, should they be full/authoritative or sparse? If empty or sparse, should we link to some authoritative external doc?

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 think extensive docs are probably not best situated here.. but I do think we should expand the current field comments to include information like this is comma separated list, it can include DNS domains, networks, IPs etc...?

Copy link
Copy Markdown
Contributor

@adambkaplan adambkaplan Jun 4, 2019

Choose a reason for hiding this comment

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

Why only NoProxy? Shouldn't status be set for HTTPProxy and HTTPSProxy as well, as several components have their own proxy configuration (builds, image registry, etc.)

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.

@adambkaplan

several components have their own proxy configuration (builds, image registry, etc.)

this package has cluster level configuration and I'm not sure how ^^ is related to the change. All operators are going to have to setup proxy for their operands based on this object.

Why only NoProxy? Shouldn't status be set for HTTPProxy and HTTPSProxy as well

NoProxy is the spec section is user-provided, while NoProxy in the status section is observed value from the spec of this object + network object + other default values that might include platform specific values too.

Therefore, NoProxy makes sense as part of status. There's no such need for other spec fields therefore specifically skipped from status.

And afaik there isn't a requirement for all fields to be part of the status l, right?

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.

@abhinavdahiya imo it makes for a harder API to navigate. I've always interpreted spec = intent, status = what the cluster has implemented/understood.

By way of example, if the openshift controller manager needs to watch the global Proxy config to update the default build proxy, I would expect it to read off status, not spec and status depending on which field you're referring to.

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.

@abhinavdahiya imo it makes for a harder API to navigate. I've always interpreted spec = intent, status = what the cluster has implemented/understood.

If we follow this anology, openshift controller should use the HTTP(S)_PROXY from the spec because the controller is fulfilling the intent of the user. and use the NO_PROXY from the status because to fulfil the intent in the spec, it needs to consume the value setup/provided by another component that setup the NO_PROXY from the spec.

But putting all fields in status too is something not too imp to me, and I am okay if we want to go that route.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have added http- & httpsProxy to the status in order to match the spec.

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Jun 4, 2019
@patrickdillon
Copy link
Copy Markdown
Contributor Author

make generate-with-container ??

@abhinavdahiya yes that seemed to do the trick. can you refresh the lgtm?

@abhinavdahiya
Copy link
Copy Markdown
Contributor

/lgtm

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

/lgtm cancel

See #335 (comment)

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Jun 4, 2019
@patrickdillon patrickdillon changed the title Add ProxyStatus to config/v1/types_project. Add ProxyStatus to config/v1/types_proxy Jun 4, 2019
Copy link
Copy Markdown
Contributor

@adambkaplan adambkaplan left a comment

Choose a reason for hiding this comment

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

/lgtm

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

/assign @soltysh

Copy link
Copy Markdown
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

/approve

@openshift-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinavdahiya, adambkaplan, patrickdillon, soltysh

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 Jun 6, 2019
@openshift-merge-robot openshift-merge-robot merged commit 5a5e76d into openshift:master Jun 6, 2019
@adambkaplan
Copy link
Copy Markdown
Contributor

@patrickdillon are you working on the client-go API bump? Operators will need new listers and informers to watch the global proxy object.

@patrickdillon
Copy link
Copy Markdown
Contributor Author

@adambkaplan planning on looking into it today. will reach out if I need help.

@bparees
Copy link
Copy Markdown
Contributor

bparees commented Jul 13, 2019

@patrickdillon @danehans do we still need this? Seems like we're moving forward w/ just spec values and an admission controller?

@patrickdillon
Copy link
Copy Markdown
Contributor Author

@bparees Is that the case? If so I will update the installer to put the complete no_proxy values in the spec.

CC @abhinavdahiya

@bparees
Copy link
Copy Markdown
Contributor

bparees commented Jul 13, 2019

@patrickdillon confirm it w/ @danehans but that's my current understanding of the plan.

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/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants