github.com/juju/juju@v0.0.0-20240327075706-a90865de2538/worker/instancemutater/doc.go (about) 1 // Copyright 2023 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 // Package instancemutater defines workers that compares the list of lxd profiles 5 // applied to a machine with the list of expected profiles based on the 6 // application versions which should be running on the machine. In particular, it 7 // creates two workers from the same code with different configurations; the 8 // ContainerWorker, and the EnvironWorker. 9 // 10 // The ContainerWorker runs on a machine and watches for containers to be 11 // created on it. 12 // 13 // // ┌───────────────────────────────┐ 14 // // │ MACHINE │ 15 // // │ │ 16 // // │ │ 17 // // │ ┌──────────────────────┐ │ 18 // // │ │ │ │ 19 // // │ │ CONTAINER │ │ 20 // ┌────┼───► │ │ 21 // │ │ │ │ │ 22 // │ │ │ ┌────────────────┐ │ │ 23 // │ │ │ │ UNIT │ │ │ 24 // │ │ │ │ │ │ │ 25 // │ │ │ │ │ │ │ 26 // │ │ │ │ ┌────────────┐ │ │ │ 27 // │ │ │ │ │ CHARM │ │ │ │ 28 // │ │ │ │ │ │ │ │ │ 29 // │ │ │ │ └─────┬──────┘ │ │ │ 30 // │ │ │ │ │ │ │ │ 31 // │ │ │ └───────┼────────┘ │ │ 32 // │ │ │ │ │ │ 33 // │ │ └──────────┼───────────┘ │ 34 // │ │ │ │ 35 // │ └──────────────┼────────────────┘ 36 // │ │ 37 // └───────────────────┘ 38 // 39 // LXD PROFILE 40 // 41 // The EnvironWorker watches for machines in the model to be created. 42 // 43 // // ┌───────────────────────────────┐ 44 // // │ MACHINE │ 45 // // │ │ 46 // ┌────► │ 47 // │ │ ┌──────────────────────┐ │ 48 // │ │ │ │ │ 49 // │ │ │ CONTAINER │ │ 50 // │ │ │ │ │ 51 // │ │ │ │ │ 52 // │ │ │ ┌────────────────┐ │ │ 53 // │ │ │ │ UNIT │ │ │ 54 // │ │ │ │ │ │ │ 55 // │ │ │ │ │ │ │ 56 // │ │ │ │ ┌────────────┐ │ │ │ 57 // │ │ │ │ │ CHARM │ │ │ │ 58 // │ │ │ │ │ │ │ │ │ 59 // │ │ │ │ └─────┬──────┘ │ │ │ 60 // │ │ │ │ │ │ │ │ 61 // │ │ │ └───────┼────────┘ │ │ 62 // │ │ │ │ │ │ 63 // │ │ └──────────┼───────────┘ │ 64 // │ │ │ │ 65 // │ └──────────────┼────────────────┘ 66 // │ │ 67 // └───────────────────┘ 68 // LXD PROFILE 69 // 70 // To understand this better with a similar mechanism, take a look at the 71 // provisioner worker as well. 72 package instancemutater