hard-dependencies: enable to set 'hard' links between artifacts
Enable admin or owner to set hard dependency between artifacts.
- Why we want to add this feature? The drive to make the change:
In cases in which one artifact depends on another.
let's say artifact A depends on artifact B. So far, we didn't have a good way to prevent artifact B deletion. Artifact B deletion might cause artifact A to lose critical info.
Usage example for it: SNAPSHOTS for Image artifact.
If we want to support snapshots, saving everytime all the image is very storage (and memory ) consuming.
- Solution: Hard dependency
Hard-dependency feature come to solve this problem: setting hard dependency from A to B, will prevent artifact B deletion.
So, any time there is a request to delete artifact x, glare checks if other artifacts depend on artifact x. Only if no artifact depends on it - artifact x will be deleted.
So, for the snapshots example, with hard-dependency, only the diff can be saved.
- how: <More technical details than the high level overview of `solution` if needed.>
DB prespective:
* Adding Table: add "glare_
The idea: for row such as (artifact_source= art1_id,
it means that artifact1
depends on artifact3, via artifact2 i.e. art2 depends on art3, and art2 depends on art1.
APIs prespective:
Add 4 APIs:
1. set_hard_
2. delete_
3. get_hard_
4. get_hard_
the children for art3 are art2 and art1. This suggest that we must not delete art3 artifact.
Note: cyclic hard_dependencies are not allowed, and will be enforced setting hard dependency (setting hard_dependency will
be result in BadRequest response)
- impacts:
Delete API: additional code will be added, to prevent deleting artifacts, which are hard dependency
targets.
- How to use this feature from client prespective: <Cli usage example/story>
$ openstack set_hard_
$ openstack delete_
$ openstack get_hard_
Blueprint information
- Status:
- Started
- Approver:
- None
- Priority:
- High
- Drafter:
- idan Narotzki
- Direction:
- Needs approval
- Assignee:
- idan Narotzki
- Definition:
- Review
- Series goal:
- None
- Implementation:
- Good progress
- Milestone target:
- None
- Started by
- Mike Fedosin
- Completed by