Skip to content
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

Merged
merged 4 commits into from
Feb 12, 2020
Merged

Added BasicVerifier for Tasks #1324

merged 4 commits into from
Feb 12, 2020

Conversation

ANeumann82
Copy link
Member

@ANeumann82 ANeumann82 commented Jan 31, 2020

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

Added unit test for BasicVerifier

Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
Copy link
Contributor

@zen-dog zen-dog left a 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 {
Copy link
Contributor

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?

Copy link
Member Author

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{}
Copy link
Contributor

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?

Suggested change
type BasicVerifier struct{}
type TasksVerifier struct{}

Copy link
Member Author

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?

Copy link
Member Author

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

@ANeumann82 ANeumann82 merged commit def4bf4 into master Feb 12, 2020
@ANeumann82 ANeumann82 deleted the an/basic-verify-for-tasks branch February 12, 2020 08:59
ANeumann82 added a commit that referenced this pull request Feb 13, 2020
* Added BuildVerifier for Tasks
* Added unit test for BuildVerifier

Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
runyontr pushed a commit that referenced this pull request Mar 11, 2020
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Package verify does not recognize missing resources in delete task
2 participants