|
| 1 | +// Taken from: https://github.com/openshift/machine-config-operator/blob/11d5151a784c7d4be5255ea41acfbf5092eda592/pkg/daemon/constants/constants.go |
| 2 | +// TODO: Replace this file with the original MCO code when transitioning to server-side |
| 3 | +package mco |
| 4 | + |
| 5 | +const ( |
| 6 | + // XXX |
| 7 | + // |
| 8 | + // Add a constant here, if and only if: it's exported (of course) and it's reused across the entire project. |
| 9 | + // Otherwise, prefer an unexported const in a specific package. |
| 10 | + // |
| 11 | + // XXX |
| 12 | + |
| 13 | + // CurrentImageAnnotationKey is used to get the current OS image pullspec for a machine |
| 14 | + CurrentImageAnnotationKey = "machineconfiguration.openshift.io/currentImage" |
| 15 | + // DesiredImageAnnotationKey is used to specify the desired OS image pullspec for a machine |
| 16 | + DesiredImageAnnotationKey = "machineconfiguration.openshift.io/desiredImage" |
| 17 | + |
| 18 | + // CurrentMachineConfigAnnotationKey is used to fetch current MachineConfig for a machine |
| 19 | + CurrentMachineConfigAnnotationKey = "machineconfiguration.openshift.io/currentConfig" |
| 20 | + // DesiredMachineConfigAnnotationKey is used to specify the desired MachineConfig for a machine |
| 21 | + DesiredMachineConfigAnnotationKey = "machineconfiguration.openshift.io/desiredConfig" |
| 22 | + // MachineConfigDaemonStateAnnotationKey is used to fetch the state of the daemon on the machine. |
| 23 | + MachineConfigDaemonStateAnnotationKey = "machineconfiguration.openshift.io/state" |
| 24 | + // DesiredDrainerAnnotationKey is set by the MCD to indicate drain/uncordon requests |
| 25 | + DesiredDrainerAnnotationKey = "machineconfiguration.openshift.io/desiredDrain" |
| 26 | + // LastAppliedDrainerAnnotationKey is set by the controller to indicate the last request applied |
| 27 | + LastAppliedDrainerAnnotationKey = "machineconfiguration.openshift.io/lastAppliedDrain" |
| 28 | + // DrainerStateDrain is used for drainer annotation as a value to indicate needing a drain |
| 29 | + DrainerStateDrain = "drain" |
| 30 | + // DrainerStateUncordon is used for drainer annotation as a value to indicate needing an uncordon |
| 31 | + DrainerStateUncordon = "uncordon" |
| 32 | + // ClusterControlPlaneTopologyAnnotationKey is set by the node controller by reading value from |
| 33 | + // controllerConfig. MCD uses the annotation value to decide drain action on the node. |
| 34 | + ClusterControlPlaneTopologyAnnotationKey = "machineconfiguration.openshift.io/controlPlaneTopology" |
| 35 | + // OpenShiftOperatorManagedLabel is used to filter out kube objects that don't need to be synced by the MCO |
| 36 | + OpenShiftOperatorManagedLabel = "openshift.io/operator-managed" |
| 37 | + // ControllerConfigResourceVersionKey is used for the certificate writer to indicate the last controllerconfig object it synced upon |
| 38 | + ControllerConfigResourceVersionKey = "machineconfiguration.openshift.io/lastSyncedControllerConfigResourceVersion" |
| 39 | + // ControllerConfigSyncServerCA is used to determine if we have already synced the server CA for this version of the controller config |
| 40 | + ControllerConfigSyncServerCA = "machineconfiguration.openshift.io/lastObservedServerCAAnnotation" |
| 41 | + // GeneratedByVersionAnnotationKey is used to tag the controllerconfig to synchronize the MCO and MCC |
| 42 | + GeneratedByVersionAnnotationKey = "machineconfiguration.openshift.io/generated-by-version" |
| 43 | + |
| 44 | + // MachineConfigDaemonStateWorking is set by daemon when it is beginning to apply an update. |
| 45 | + MachineConfigDaemonStateWorking = "Working" |
| 46 | + // MachineConfigDaemonStateDone is set by daemon when it is done applying an update. |
| 47 | + MachineConfigDaemonStateDone = "Done" |
| 48 | + // MachineConfigDaemonStateDegraded is set by daemon when an error not caused by a bad MachineConfig |
| 49 | + // is thrown during an update. |
| 50 | + MachineConfigDaemonStateDegraded = "Degraded" |
| 51 | + // MachineConfigDaemonRebooting is used to indicate a reboot is either queued or is in progress. |
| 52 | + MachineConfigDaemonStateRebooting = "Rebooting" |
| 53 | + // MachineConfigDaemonStateUnreconcilable is set by the daemon when a MachineConfig cannot be applied. |
| 54 | + MachineConfigDaemonStateUnreconcilable = "Unreconcilable" |
| 55 | + // MachineConfigDaemonReasonAnnotationKey is set by the daemon when it needs to report a human readable reason for its state. E.g. when state flips to degraded/unreconcilable. |
| 56 | + MachineConfigDaemonReasonAnnotationKey = "machineconfiguration.openshift.io/reason" |
| 57 | + // MachineConfigDaemonPostConfigAction is set by the daemon when it needs to report a human readable post config action that takes place during update. |
| 58 | + MachineConfigDaemonPostConfigAction = "machineconfiguration.openshift.io/post-config-action" |
| 59 | + // MachineConfigDaemonFinalizeFailureAnnotationKey is set by the daemon when ostree fails to finalize |
| 60 | + MachineConfigDaemonFinalizeFailureAnnotationKey = "machineconfiguration.openshift.io/ostree-finalize-staged-failure" |
| 61 | + // InitialNodeAnnotationsFilePath defines the path at which it will find the node annotations it needs to set on the node once it comes up for the first time. |
| 62 | + // The Machine Config Server writes the node annotations to this path. |
| 63 | + InitialNodeAnnotationsFilePath = "/etc/machine-config-daemon/node-annotations.json" |
| 64 | + // InitialNodeAnnotationsBakPath defines the path of InitialNodeAnnotationsFilePath when the initial bootstrap is done. We leave it around for debugging and reconciling. |
| 65 | + InitialNodeAnnotationsBakPath = "/etc/machine-config-daemon/node-annotation.json.bak" |
| 66 | + |
| 67 | + // IgnitionSystemdPresetFile is where Ignition writes initial enabled/disabled systemd unit configs |
| 68 | + // This should be removed on boot after MCO takes over, so if any of these are deleted we can go back |
| 69 | + // to initial system settings |
| 70 | + IgnitionSystemdPresetFile = "/etc/systemd/system-preset/20-ignition.preset" |
| 71 | + |
| 72 | + // EtcPivotFile is used by the `pivot` command |
| 73 | + // For more information, see https://github.com/openshift/pivot/pull/25/commits/c77788a35d7ee4058d1410e89e6c7937bca89f6c#diff-04c6e90faac2675aa89e2176d2eec7d8R44 |
| 74 | + EtcPivotFile = "/etc/pivot/image-pullspec" |
| 75 | + |
| 76 | + // MachineConfigEncapsulatedPath contains all of the data from a MachineConfig object |
| 77 | + // except the Spec/Config object; this supports inverting+encapsulating a MachineConfig |
| 78 | + // object so that Ignition can process it on first boot, and then the MCD can act on |
| 79 | + // non-Ignition fields such as the osImageURL and kernelArguments. |
| 80 | + MachineConfigEncapsulatedPath = "/etc/ignition-machine-config-encapsulated.json" |
| 81 | + |
| 82 | + // MachineConfigEncapsulatedBakPath defines the path where the machineconfigdaemom-firstboot.service |
| 83 | + // will leave a copy of the encapsulated MachineConfig in MachineConfigEncapsulatedPath after |
| 84 | + // processing for debugging and auditing purposes. |
| 85 | + MachineConfigEncapsulatedBakPath = "/etc/ignition-machine-config-encapsulated.json.bak" |
| 86 | + |
| 87 | + // MachineConfigDaemonForceFile if present causes the MCD to skip checking the validity of the |
| 88 | + // "currentConfig" state. Create this file (empty contents is fine) if you wish the MCD |
| 89 | + // to proceed and attempt to "reconcile" to the new "desiredConfig" state regardless. |
| 90 | + MachineConfigDaemonForceFile = "/run/machine-config-daemon-force" |
| 91 | + |
| 92 | + // coreUser is "core" and currently the only permissible user name |
| 93 | + CoreUserName = "core" |
| 94 | + CoreGroupName = "core" |
| 95 | + |
| 96 | + // changes to registries.conf will cause a crio reload and require extra logic about whether to drain |
| 97 | + ContainerRegistryConfPath = "/etc/containers/registries.conf" |
| 98 | + |
| 99 | + // SSH Keys for user "core" will only be written at /home/core/.ssh |
| 100 | + CoreUserSSHPath = "/home/" + CoreUserName + "/.ssh" |
| 101 | + |
| 102 | + // SSH keys in RHCOS 8 will be written to /home/core/.ssh/authorized_keys |
| 103 | + RHCOS8SSHKeyPath = CoreUserSSHPath + "/authorized_keys" |
| 104 | + |
| 105 | + // SSH keys in RHCOS 9 / FCOS / SCOS will be written to /home/core/.ssh/authorized_keys.d/ignition |
| 106 | + RHCOS9SSHKeyPath = CoreUserSSHPath + "/authorized_keys.d/ignition" |
| 107 | + |
| 108 | + // CRIOServiceName is used to specify reloads and restarts of the CRI-O service |
| 109 | + CRIOServiceName = "crio" |
| 110 | +) |
0 commit comments