Skip to content

pkg/ansible,*: Adding ability to specify re-queue period per GVK via watches file. #641

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

Conversation

shawn-hurley
Copy link
Member

Description of the change:
Adding ability to specify GVK specific re-queue times via the watches file

Motivation for the change:

  • Not every GVK should be handled the same
  • wanted to add some test cases.

@shawn-hurley shawn-hurley changed the title pkg/ansible,*: Adding ability to specify re-queue period per GVK via watches file. [WIP] pkg/ansible,*: Adding ability to specify re-queue period per GVK via watches file. Oct 18, 2018
@shawn-hurley shawn-hurley added the language/ansible Issue is related to an Ansible operator project label Oct 19, 2018
@shawn-hurley shawn-hurley force-pushed the feature/controller-specific-requeue-duration branch from cd74819 to bc9108f Compare October 19, 2018 17:00
@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 19, 2018
@shawn-hurley shawn-hurley force-pushed the feature/controller-specific-requeue-duration branch from bc9108f to acffc9c Compare October 19, 2018 17:25
@shawn-hurley shawn-hurley requested a review from mhrivnak October 19, 2018 17:41
@shawn-hurley shawn-hurley changed the title [WIP] pkg/ansible,*: Adding ability to specify re-queue period per GVK via watches file. pkg/ansible,*: Adding ability to specify re-queue period per GVK via watches file. Oct 19, 2018
if w.ReconcilePeriod != "" {
d, err := time.ParseDuration(w.ReconcilePeriod)
if err != nil {
logrus.Warningf("unable to parse duration: %v - %v, setting to default", w.ReconcilePeriod, err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If someone tries to set this but screws it up, I think it's better to fail to make sure they know and fix it.

@@ -66,7 +67,7 @@ func main() {
}

// start the operator
go operator.Run(done, mgr, "/opt/ansible/watches.yaml")
go operator.Run(done, mgr, "/opt/ansible/watches.yaml", 5*time.Second)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be one minute, to match what up local does? I also thought we'd generally settled on a minute as roughly the right default period.

@shawn-hurley shawn-hurley force-pushed the feature/controller-specific-requeue-duration branch from acffc9c to 98bbf38 Compare October 23, 2018 17:22
@shawn-hurley shawn-hurley merged commit c261803 into operator-framework:master Oct 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language/ansible Issue is related to an Ansible operator project size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants