-
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 all 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,33 @@ 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="url(self).getScheme() == \"https\"",message="url scheme must be https" | ||||||||
// +kubebuilder:validation:XValidation:rule="url(self).getEscapedPath().matches(\"\/(api\/)?v\d+\/{0,1}\")",message="url path must match /v[0,9]+ or /api/v[0,9]+" | ||||||||
// +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 service. These endpoints are used by components | ||||||||
// within the cluster when trying to reach the IBM Cloud Services that have been | ||||||||
// overriden. The CCCMO reads in the IBMCloudPlatformSpec and validates each | ||||||||
// endpoint is resolvable. Once validated, the cloud config and IBMCloudPlatformStatus | ||||||||
// are updated to reflect the same custom endpoints. | ||||||||
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
|
||||||||
// +listType=map | ||||||||
// +listMapKey=name | ||||||||
// +kubebuilder:validation:MaxItems:=25 | ||||||||
// +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 { | ||||||||
|
@@ -1647,10 +1663,14 @@ type IBMCloudPlatformStatus struct { | |||||||
DNSInstanceCRN string `json:"dnsInstanceCRN,omitempty"` | ||||||||
|
||||||||
// 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. | ||||||||
// service endpoints of an IBM service. These endpoints are used by components | ||||||||
// within the cluster when trying to reach the IBM Cloud Services that have been | ||||||||
// overriden. The CCCMO reads in the IBMCloudPlatformSpec and validates each | ||||||||
// endpoint is resolvable. Once validated, the cloud config and IBMCloudPlatformStatus | ||||||||
// are updated to reflect the same custom endpoints. | ||||||||
// +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.
We need to make sure that each of these validations is tested, and in particular, also tested with ratcheting, which is new to the test suite.
You can see some examples of adding ratcheting tests in #2142
You'll have to come up with a patch operation (likely a remove on the path to the maxLength, CEL validations etc) that allows you to persist something not allowed by the new validation, and then show through tests that this does not block writes.
Since this field is new in spec, you'll need to write those ratcheting tests only for the status. That's currently not going to ratchet because of the bug linked to those other tests, I'll let you know when they will pass