Bug 1843327: [vSphere] Improve provider spec validation#605
Conversation
elmiko
left a comment
There was a problem hiding this comment.
/lgtm
i just had a couple minor questions
| vmTemplate, err := s.GetSession().FindVM(*s, "", s.providerSpec.Template) | ||
| if err != nil { | ||
| return "", err | ||
| notFoundMsg := "template not found, specify valid value" |
There was a problem hiding this comment.
given that notFoundMsg doesn't change, i wonder if it's better to make it a const?
| notFoundMsg := "template not found, specify valid value" | |
| const notFoundMsg = "template not found, specify valid value" |
| if err != nil { | ||
| return nil, fmt.Errorf("unable to find network %q: %w", netSpec.NetworkName, err) | ||
| multipleFoundMsg := "multiple networks found, specify one in config" | ||
| notFoundMsg := "network not found, specify valid value" |
There was a problem hiding this comment.
similar question here for multipleFoundMsg and notFoundMsg
JoelSpeed
left a comment
There was a problem hiding this comment.
LGTM once Mike's suggestions are fixed up
16e6ee8 to
a865ef3
Compare
|
@JoelSpeed @elmiko all fixed /retest |
| datastore, err := s.GetSession().Finder.DatastoreOrDefault(s, datastorePath) | ||
| if err != nil { | ||
| multipleFoundMsg := "multiple datastores found, specify one in config" | ||
| const multipleFoundMsg = "multiple datastores found, specify one in config" |
There was a problem hiding this comment.
why is this using const and := unconsistently??
https://github.com/openshift/machine-api-operator/pull/605/files#diff-11b6610f82e5d47fdfb8dda44b90dd1eR469
https://github.com/openshift/machine-api-operator/pull/605/files#diff-11b6610f82e5d47fdfb8dda44b90dd1eR470
https://github.com/openshift/machine-api-operator/pull/605/files#diff-11b6610f82e5d47fdfb8dda44b90dd1eR594
https://github.com/openshift/machine-api-operator/pull/605/files#diff-11b6610f82e5d47fdfb8dda44b90dd1eR595
a865ef3 to
8e027a1
Compare
|
/retest |
| func (s *machineScope) GetUserData() ([]byte, error) { | ||
| if s.providerSpec == nil || s.providerSpec.UserDataSecret == nil { | ||
| return nil, nil | ||
| return nil, machinecontroller.InvalidMachineConfiguration("user data secret is missing in provider spec") |
There was a problem hiding this comment.
Although I think this is fine and it makes sense as we don't currently support any model where this could be empty fwiw I don't think we are doing the same in other providers.
In the near future with a model where MCO generate secrets for machines on demand this might need to change.
openshift/enhancements#368
openshift/enhancements#201
|
"Improve" seems too wide, Can we include "by returning invalid machine configuration error on missing VM template and missing user data secret" as in the desc? |
|
/retest |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: enxebre 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 |
|
@enxebre done |
|
@alexander-demichev: This pull request references Bugzilla bug 1843327, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
DetailsIn response to this:
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. |
|
/retest |
8e027a1 to
43e60b6
Compare
… user data secret
43e60b6 to
d1de7dd
Compare
|
/retest |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
25 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 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. |
|
@alexander-demichev: 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. 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. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
@alexander-demichev: All pull requests linked via external trackers have merged: openshift/machine-api-operator#605. Bugzilla bug 1843327 has been moved to the MODIFIED state. DetailsIn response to this:
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. |
Return invalid machine configuration error on missing VM template and missing user data secret