pkg/operator: status.go docs
@@ -214,15 +214,15 @@ func (optr *Operator) initializeClusterOperator() (*configv1.ClusterOperator, er
{Group: "machineconfiguration.openshift.io", Resource: "machineconfigpools", Name: "worker"},
{Group: "machineconfiguration.openshift.io", Resource: "controllerconfigs", Name: "cluster"},
}
- // During an installation we report the RELEASE_VERSION as soon as the component is created
- // whether for normal runs and upgrades this code isn't hit and we get the right version every
+ // During an installation we report the RELEASE_VERSION as soon as the component is created.
+ // For both normal runs and upgrades, this code isn't hit and we get the right version every
// time. This also only contains the operator RELEASE_VERSION when we're here.
co.Status.Versions = optr.vStore.GetAll()
return optr.configClient.ConfigV1().ClusterOperators().UpdateStatus(co)
}
// setOperatorStatusExtension sets the raw extension field of the clusteroperator. Today, we set
-// the MCPs statuses and an optional status error which we may get during a sync.
+// the MCPs statuses and an optional error status which we may get during a sync.
func (optr *Operator) setOperatorStatusExtension(status *configv1.ClusterOperatorStatus, statusErr error) {
statuses, err := optr.allMachineConfigPoolStatus()
if err != nil {
@@ -258,7 +258,7 @@ func (optr *Operator) allMachineConfigPoolStatus() (map[string]string, error) {
return ret, nil
}
-// isMachineConfigPoolConfigurationValid returns nil error when the configuration of a `pool` is created by the controller at version `version`.
+// isMachineConfigPoolConfigurationValid returns nil, or error when the configuration of a `pool` is created by the controller at version `version`.
func isMachineConfigPoolConfigurationValid(pool *mcfgv1.MachineConfigPool, version string, machineConfigGetter func(string) (*mcfgv1.MachineConfig, error)) error {
// both .status.configuration.name and .status.configuration.source must be set.
if pool.Spec.Configuration.Name == "" {
@@ -280,18 +280,18 @@ func isMachineConfigPoolConfigurationValid(pool *mcfgv1.MachineConfigPool, versi
return err
}
- // We check that all the machineconfigs (generated, and those that were used to create generated,
- // not the user provided ones that do not have a version) were generated by correct version of the controller.
+ // We check that all of the machineconfigs (generated configs, as well as those that were used to create generated configs,
+ // but not the user provided configs that don't have a version) were generated by the correct version of the controller.
v, ok := mc.Annotations[ctrlcommon.GeneratedByControllerVersionAnnotationKey]
- // The generated machineconfig from fragments for the pool MUST have a version and the annotation.
- // The bootstrapped MCs fragments do have this annotation but we don't fail (???) if they don't have
+ // The generated machineconfig from fragments for the pool MUST have a version and an annotation.
+ // The bootstrapped MCs fragments have this annotation, however, we don't fail (???) if they don't have
// the annotation for some reason.
if !ok && pool.Status.Configuration.Name == mcName {
return fmt.Errorf("%s must be created by controller version %s", mcName, version)
}
- // user provided MC fragments do not have the annotation, so we just skip version check there
- // The check below is just for: 1) the generated MC for the pool, 2) the bootstrapped fragments
- // that do have this annotation with a version.
+ // user provided MC fragments do not have the annotation, so we just skip the version check there.
+ // The check below is for: 1) the generated MC for the pool, and 2) the bootstrapped fragments
+ // that do have this annotation set with a version.
if ok && v != version {
return fmt.Errorf("controller version mismatch for %s expected %s has %s", mcName, version, v)
}
