aws_platform_service_location: add a controller that sync user specified service endpoints to status#119
Conversation
2e74821 to
d957d96
Compare
| if pstatus := currentInfra.Status.PlatformStatus; pstatus != nil { | ||
| platformName = pstatus.Type | ||
| } | ||
| if platformName == "" { |
There was a problem hiding this comment.
kube canonical is len() == 0
| return nil // nothing to do here | ||
| } | ||
|
|
||
| services := currentInfra.Spec.PlatformSpec.AWS.ServiceEndpoints |
There was a problem hiding this comment.
d957d96#diff-51a3ce64d08707b029401c01f6a81ac0R61
already deepcopies.
There was a problem hiding this comment.
d957d96#diff-51a3ce64d08707b029401c01f6a81ac0R61
already deepcopies.
Given the assignment to status later and the update usage, I'd prefer not to shallow copy this. I think it's just .DeepCopy, right?
There was a problem hiding this comment.
ServiceEndpoints is a slice, so no DeepCopy.
i could DeepCopy the entire currentInfra again..
currentInfra.DeepCopy().Spec.PlatformSpec.AWS.ServiceEndpoints ?? @deads2k
Can you provide a little background on why you think deepcopy here would be necessary?
There was a problem hiding this comment.
ServiceEndpointsis a slice, so no DeepCopy.i could DeepCopy the entire currentInfra again..
currentInfra.DeepCopy().Spec.PlatformSpec.AWS.ServiceEndpoints?? @deads2kCan you provide a little background on why you think deepcopy here would be necessary?
mutating the input means that if you later use it or diff it somewhere, it won't be what you expect it to be. Makes it hard for me to reason about it's state during this review.
|
needs owners file |
d957d96 to
28df379
Compare
openshift-ci-robot
left a comment
There was a problem hiding this comment.
@abhinavdahiya: 1 invalid OWNERS file
Details
In response to this:
The controller only works for AWS platform
The service endpoints are validated before syncing to the the status,
- no duplicates should be specified for a service
- the URL must be hostname or a valid URI without any request paths
If the service endpoints are not allowed or valid, the status service endpoints are not modified.depends on openshift/api#599
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.
28df379 to
c64de12
Compare
openshift-ci-robot
left a comment
There was a problem hiding this comment.
@abhinavdahiya: 1 invalid OWNERS file
Details
In response to this:
The controller only works for AWS platform
The service endpoints are validated before syncing to the the status,
- no duplicates should be specified for a service
- the URL must be hostname or a valid URI without any request paths
If the service endpoints are not allowed or valid, the status service endpoints are not modified.depends on openshift/api#599
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.
c64de12 to
470d7bd
Compare
|
/retest |
|
|
||
| func validateServiceURL(uri string) error { | ||
| endpoint := uri | ||
| if !schemeRE.MatchString(endpoint) { |
There was a problem hiding this comment.
This should really be a parseable URL or it shouldn't. The sometimes API seems "nicer" but it ultimately makes for complication. Let's do a straight url.Parse and then have a list of schemes we allow. I don't think empty should be allowed and I would require https until we have a reason not to.
470d7bd to
e16d20e
Compare
|
/lgtm |
…ied service endpoints to status The controller only works for AWS platform THe service endpoints are validated before syncing to the the status, - no duplicates should be specified for a service - the URL must be hostname or a valid URI without any request paths If the service endpoints are not allowed or valid, the status service endpoints are not modified.
e16d20e to
e3626af
Compare
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abhinavdahiya, deads2k, fabianofranz The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
2 similar comments
|
/retest |
|
/retest |
The controller only works for AWS platform
The service endpoints are validated before syncing to the the status,
If the service endpoints are not allowed or valid, the status service endpoints are not modified.
depends on openshift/api#599