-
Notifications
You must be signed in to change notification settings - Fork 524
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
Add changes to infrastructure object to contain service endpoints and feature flag added #2078
base: master
Are you sure you want to change the base?
Changes from 9 commits
9d7a91e
d0e9605
d171ffb
a681e2b
3ee0be4
0b4fee3
4525152
698a39c
7449b3b
e5e3220
0a95665
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -1615,17 +1615,31 @@ type IBMCloudServiceEndpoint struct { | |||||
|
||||||
// url is fully qualified URI with scheme https, that overrides the default generated | ||||||
// endpoint for a client. | ||||||
// This must be provided and cannot be empty. | ||||||
// This must be provided and cannot be empty. The path must follow the pattern | ||||||
// /v[0,9]+ or /api/v[0,9]+ | ||||||
// | ||||||
// +required | ||||||
// +kubebuilder:validation:Type=string | ||||||
// +kubebuilder:validation:XValidation:rule="isURL(self)",message="url must be a valid absolute URL" | ||||||
// +kubebuilder:validation:XValidation:rule=`self.matches('https:\/\/.*(?:\/(api\/)?v\d+\/{0,1})$')`,message="Invalid URL pattern for IBM service overrides" | ||||||
// +kubebuilder:validation:MaxLength=300 | ||||||
URL string `json:"url"` | ||||||
} | ||||||
|
||||||
// IBMCloudPlatformSpec holds the desired state of the IBMCloud infrastructure provider. | ||||||
// This only includes fields that can be modified in the cluster. | ||||||
type IBMCloudPlatformSpec struct{} | ||||||
type IBMCloudPlatformSpec struct { | ||||||
// serviceEndpoints is a list of custom endpoints which will override the default | ||||||
// service endpoints of an IBM Cloud service. These endpoints are consumed by | ||||||
// components within the cluster to reach the respective IBM Cloud Services. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should add some description here of what happens when you add values. They get verified and then copied to status by some controller right? And then consumed by? |
||||||
// Once admitted, the CCCMO will furthger validate the endpoint exists by pinging it | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed below in rewrite |
||||||
// before processing using the provided endpoints to updates the platform status | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line isn't reading well to me, want to just double check the wording here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rewritten to hopefully address the confusing portions |
||||||
// as well as the cloud config. | ||||||
// +listType=map | ||||||
// +listMapKey=name | ||||||
// +optional | ||||||
ServiceEndpoints []IBMCloudServiceEndpoint `json:"serviceEndpoints,omitempty"` | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All lists must have a maximum number of items marker, what is the rough number of items you'd expect to be in this list in the worst case scenario? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We chose to limit the list to 25 - this covers all current uses cases and gives good room for any future additions There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You've added the limit to status only, add to spec as well please |
||||||
} | ||||||
|
||||||
// IBMCloudPlatformStatus holds the current status of the IBMCloud infrastructure provider. | ||||||
type IBMCloudPlatformStatus struct { | ||||||
|
@@ -1649,8 +1663,13 @@ type IBMCloudPlatformStatus struct { | |||||
// serviceEndpoints is a list of custom endpoints which will override the default | ||||||
// service endpoints of an IBM Cloud service. These endpoints are consumed by | ||||||
// components within the cluster to reach the respective IBM Cloud Services. | ||||||
// Once admitted, the CCCMO will furthger validate the endpoint exists by pinging it | ||||||
// before processing using the provided endpoints to updates the platform status | ||||||
// as well as the cloud config. | ||||||
// platform status as well as the cloud config. | ||||||
// +listType=map | ||||||
// +listMapKey=name | ||||||
// +kubebuilder:validation:MaxItems:=25 | ||||||
// +optional | ||||||
ServiceEndpoints []IBMCloudServiceEndpoint `json:"serviceEndpoints,omitempty"` | ||||||
} | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -726,4 +726,12 @@ var ( | |
enhancementPR("https://github.com/openshift/enhancements/pull/1492"). | ||
enableIn(configv1.DevPreviewNoUpgrade). | ||
mustRegister() | ||
|
||
FeatureGateDyanmicServiceEndpointIBMCloud = newFeatureGate("DyanmicServiceEndpointIBMCloud"). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You'll want to include an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added, but just to confirm our goal would be to remove these post-dev as we wouldn't want to keep this feature within dev/tech preview long term. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct, once this is dev complete and testing in techpreview shows it's stable, you add the |
||
reportProblemsToJiraComponent("Cloud Compute / IBM Provider"). | ||
contactPerson("jared-hayes-dev"). | ||
productScope(ocpSpecific). | ||
enhancementPR("https://github.com/openshift/enhancements/pull/1712"). | ||
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). | ||
mustRegister() | ||
) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
Any reason to use matches, over the URL helpers that I had suggested? In theory this could allow the path to be incorrect
E.g.
https://a.b.c/my/malicious/path?pretend_that_i_am=/api/v1
passes your regex right now, but is not your intention.The URL helpers I mentioned previously will accurately return you the escaped path, which you can then match against, and would avoid this kind of issue
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.
My bad, somehow I misunderstood your comment when I first read it, and missed the portion in which you suggested the exact URL functions. I have updated the field to correctly use them over trying to pattern match the entire field.