How to subordinate to specific charm?

Is there any way I can create a charm which has a hard requrement to be used with a specific charm?

I don’t want users to accidentally relate my subordinate to anything but the intended principal charm.

I don’t think you can do that, but you might be able to inspect the relation that’s created with ops and block the charm in the constructor if it’s not to an app that you’re expecting? That way you’re at least failing fast?

Hmm, this would be a good feature to be able to constrain this to avoid deployments that are doomed.

How would the code look like in ops for what you are saying?