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
[OCPCLOUD-882] Add defaulting and validation via Webhook for Azure #607
[OCPCLOUD-882] Add defaulting and validation via Webhook for Azure #607
Conversation
Skipping CI for Draft Pull Request. |
a466439
to
562403b
Compare
562403b
to
0dd61cd
Compare
0dd61cd
to
ee1f69e
Compare
/approve |
/retest |
3 similar comments
/retest |
/retest |
/retest |
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.
/lgtm
|
||
var errs []error | ||
providerSpec := new(azure.AzureMachineProviderSpec) | ||
if err := yaml.Unmarshal(m.Spec.ProviderSpec.Value.Raw, &providerSpec); err != nil { |
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.
Not a big deal, but it might be better to maintain a single location for unmarshaling spec in here: https://github.com/openshift/cluster-api-provider-azure/blob/9034812d3a88fae165bdc359d2c0a04c43f61c7a/pkg/cloud/azure/actuators/machine_scope.go#L218 so it could be removed later, when the providers will have it's own resources.
}{ | ||
{ | ||
testCase: "with no location it fails", | ||
providerSpec: &azure.AzureMachineProviderSpec{ |
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.
Most of test cases are using valid provider spec, but then altering a single field. Could we just patch full spec with changes we need to test, to improve readability?
{ | ||
testCase: "it defaults defaultable fields", | ||
providerSpec: &azure.AzureMachineProviderSpec{}, | ||
expectedProviderSpec: &azure.AzureMachineProviderSpec{ |
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.
Most of test cases are using valid provider spec, but then altering a single field. Could we just patch full spec with changes we need to test, to improve readability?
/hold Going to look into Danil's suggestions |
/lgtm |
/retest Please review the full test history for this PR and help us cut down flakes. |
16 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. |
/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. |
/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 |
/retest Please review the full test history for this PR and help us cut down flakes. |
/test e2e-aws-upgrade |
/retest Please review the full test history for this PR and help us cut down flakes. |
2 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. |
@JoelSpeed: The following test 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. 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. I understand the commands that are listed here. |
/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. |
Adds a defaulting and validating function for Azure provider specs and registers it with the existing webhooks introduced in #601