Harness to auto attach storage?
See original GitHub issueFollowing up on https://github.com/canonical/operator/pull/734, I tried it out in some unit tests and had the following recurring code:
storage_id = self.harness.add_storage("name")[0]
self.harness.attach_storage(storage_id)
Would it be feasible/sensible to auto attach all storages in metadata (perhaps with count=1
by default)?
For example,
self.harness.auto_attach_storages()
self.harness.begin_with_initial_hooks()
Issue Analytics
- State:
- Created a year ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Harness Delegate FAQs - Harness.io Docs
Delegates connect to the Harness Manager and are tested for connectivity to resources and tasks. Harness Cloud Providers and Connectors ...
Read more >Amazon.com : DYKESON Pet Barrier Dog Car Net ...
DYKESON Pet Barrier Dog Car Net Barrier with Auto Safety Mesh Organizer Baby Stretchable Storage Bag Universal for Cars, SUVs -Easy Install,Safer to...
Read more >3M™ Protecta® Comfort Construction Positioning Harness ...
3M™ Protecta® P200 Safety Harness is designed to help provide industrial workers with ... simple attachment of personal self-retracting lifelines (pSRLs).
Read more >Where/How to Store Your Trailer Wiring Harness - YouTube
Where should you leave your trailer wiring? Does is hang underneath your bumper? Is it just looped around your hitch?
Read more >Auto attach VirtualDisk on Storage Pool after reboot ... - Console
Auto attach VirtualDisk on Storage Pool after reboot on Windows Server 2016. Reboot to confirm if StorageSpace VirtualDisk re-attaches correctly.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The trick with auto-attaching on begin_with_initial_hooks is the harness doesn’t know how many instances of each particular storage it should create/mount for cases where there can be multiple. If we did do that, we’d need to implement some logic mirroring how juju decides. And also we’d have to think carefully about how to deal with cases where we a charm dev has manually attached some storage prior to calling begin_with_initial_hooks. My inclination right now is to just leave it as is require devs to explicitly add storage for their tests.
.on[...]
call: https://github.com/canonical/operator/blob/eb33286800bf94b60b7354b350f2725ab5b81865/ops/framework.py#L453