-
Notifications
You must be signed in to change notification settings - Fork 104
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
Added BasicVerifier for Tasks #1324
Conversation
Added unit test for BasicVerifier Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
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.
I think we can move the validation code living currently in task.go
into the new TasksVerifier
. But this is also an improvement, so you can 🚢
for _, tt := range pf.Operator.Tasks { | ||
tt := tt | ||
|
||
if _, err := task.Build(&tt); 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.
I like this verifier! I put the validation code in the task.go
originally because we haven't had a good place for it back then. Wdyt about little refactoring: move that code and corresponding tests here?
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.
Refactoring might be possible. I tried it a little bit yesterday, but couldn't find a good structure, so I'm leaving it as is for now.
) | ||
|
||
// ReferenceVerifier verifies tasks producing errors for tasks referenced in plans that do not exist and warnings for tasks which are not used in a plan | ||
type BasicVerifier struct{} |
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.
More like TasksVerifier
based on what it does?
type BasicVerifier struct{} | |
type TasksVerifier struct{} |
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.
That would kinda stutter on import, with task.TasksVerifier
?
Maybe StructureVerifier
?
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.
I've renamed it now to BuildVerifier
, because that's what it does at the moment: Verifies that the task can be build
Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
* Added BuildVerifier for Tasks * Added unit test for BuildVerifier Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
* Added BuildVerifier for Tasks * Added unit test for BuildVerifier Signed-off-by: Andreas Neumann <aneumann@mesosphere.com> Signed-off-by: Thomas Runyon <runyontr@gmail.com>
What this PR does / why we need it:
We should use the same code for task verify that we also use in the controller to validate.
Fixes #1320
Signed-off-by: Andreas Neumann aneumann@mesosphere.com