Skip to content
This repository was archived by the owner on Dec 21, 2023. It is now read-only.
This repository was archived by the owner on Dec 21, 2023. It is now read-only.

Implementation of a waiting functionality to trigger a task after x minutes #3681

@johannes-b

Description

@johannes-b

Context: A remediation sequence triggers an action that should resolve a problem. However, the effect of the action may not be visible immediately. Consequently, it is required to wait for a few minutes before triggering the next task of a rem. sequence.

Option 1:

- name: "production" 
  sequences: 
  - name: remediation
      tasks:
      - name: get-action 
      - name: action
      - name: wait
        properties:
        - time: "10m"
      - name: evaluation

Option 2:

- name: "production" 
  sequences: 
  - name: remediation
      tasks:
      - name: get-action 
      - name: action
      - name: evaluation
        triggeredAfter: "10m"
        - properties:

Based on the above examples, the sequence waits 10 minutes before triggering the evaluation.

❔ Implementing a separate service for just calling the wait function is maybe over-engineered. Can we integrate the functionality into an existing service (shipyard-controller) OR should we model it as an extra property that is controlled by the shipyard controller?

Decision: We go with option 2 for implementing the waiting functionality.

Task:

  • Implement the chosen approach in the current shipyard-controller
  • Provide unit tests for this new functionality
  • Implement an integration test that verifies this use-case

Definition of Done:

  • Spec is up-dated
  • Unit test and integration test cover the new functionality
  • The shipyard controller waits for x minutes before triggering the tasks

🛡️ This story will also be used to do major refactorings of the ShipyardController

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions