Require a reef¶
Make a Nereid require another reef through a label of its image: the CLI refuses to apply it until that reef has a Nereid, and refuses to delete that reef's last Nereid while it is needed.
A Nereid requires reefs, never Nereids (spec 0003): any Nereid of the reef will do.
Before you start¶
- The
releasereef with its Nereidreference-release, from Build a Nereid's image. - An image whose label
core.getnereus.dev/requireslists the reefs it needs, comma-separated. Build the reference Nereid as a Nereid of adocsreef that requiresrelease:docker build --build-arg API_GROUP=core.getnereus.dev --build-arg REEF=docs --build-arg REQUIRES=release --tag localhost:5111/reference-docs-controller:0.1.0 controllers/reference, thendocker pushit.
Steps¶
1. Create the reef¶
nereus reef create adds the docs reef the new Nereid looks after.
nereus reef create docs
2. Apply the Nereid that requires a reef¶
nereus nereid apply reads requires from the image's labels and records it in the Nereid's spec.requires.
nereus nereid apply reference-docs \
--reef docs \
--image localhost:5111/reference-docs-controller:0.1.0
release has a Nereid, so the apply goes ahead. Without one, it is refused before anything runs, with reference-docs requires reefs with no Nereid: release. and the command that applies one. When the required reef's Nereid is there but not Ready, the apply warns and goes ahead.
Check it worked¶
nereus nereid list shows both Nereids Ready: reference-docs on docs, reference-release on release.
nereus nereid list
Clean up¶
reference-release is the last Nereid of release, which docs requires, so nereus nereid delete refuses it first:
nereus nereid delete reference-release
✗ reference-release is the last Nereid of reef release, which added Nereids require: reference-docs.
Remove them first, or go ahead with: nereus nereid delete reference-release --force
Delete reference-docs first, then the docs reef with nereus reef delete; reference-release stays:
nereus nereid delete reference-docs
nereus reef delete docs
Next¶
- Pass the conformance tests.
- When the Nereid stops: what a required reef's Nereid does to its commands.
Learn more¶
- Reef, Nereid and Mandate.
- Spec 0003: the labels read at install,
requiresamong them.