-
Notifications
You must be signed in to change notification settings - Fork 1.5k
baremetal: Validate os images exist #3363
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
baremetal: Validate os images exist #3363
Conversation
|
/assign @stbenjam |
|
/test e2e-metal-ipi |
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.
this process is fine, but validations in the other parts of the codebase solve this using modifiers like
installer/pkg/asset/installconfig/aws/validation_test.go
Lines 133 to 142 in c09a610
| installConfig: func() *types.InstallConfig { | |
| c := validInstallConfig() | |
| c.Publish = types.InternalPublishingStrategy | |
| c.Platform.AWS.Subnets = []string{ | |
| "valid-private-subnet-a", | |
| "valid-private-subnet-b", | |
| "valid-private-subnet-c", | |
| } | |
| return c | |
| }(), |
I'm fine with all of these, but since these builders are not generated, we will end up adding functions for each new field, and most of the times the modifications to the valid examples happens in batches (multiple fields together)
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.
Potentially the builder could be generated but I wanted to keep it simple, since function for a new field is added only once and very quickly, and after that can be reused by many developers when writing tests.
About batch modifications, not sure If I understood correctly: fluent builders allows modifying multiple fields together through the usage of method chaining (see for example https://github.com/andfasano/installer/blob/ab40687d1715529356df8c22d2b8b0abd3504db0/pkg/types/baremetal/validation/platform_test.go#L54)
|
/test e2e-metal-ipi |
1 similar comment
|
/test e2e-metal-ipi |
ab40687 to
92a07c2
Compare
|
/test e2e-metal-ipi |
1 similar comment
|
/test e2e-metal-ipi |
…ied to BootstrapOSImage and ClusterOSImage fields added new validation rule to wrap existing url sanity checks on BootstrapOSImage and ClusterOSImage fields
92a07c2 to
ccaf134
Compare
|
/test e2e-metal-ipi |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: stbenjam 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 Please review the full test history for this PR and help us cut down flakes. |
5 similar comments
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
@andfasano: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions 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. I understand the commands that are listed here. |
This PR defines a new validation rule
urlexistapplied to theBootstrapOSImageandClusterOSImagefields ofbaremetal.Platformstructure, to ensure that the specified URL exists (without downloading the content).The PR also contains the smallest refactoring step to allows a coherent validation approach for the mentioned fields.
Finally, the PR contains a proposal to improve the readability (and reduce the duplication and the chance of errors) of the related test code using the fluent builder pattern.