You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: Standardized logging with consistent keys and WithValues usage (#968)
* chore: convert fmt.Sprintf logging to structured logging WithValues
* resolved tallaxes comments
* resolved tallaxes comments
* fix: single-use WithValues() changed to direct key value pairs, pricing.go added region WithValues
* fix: WARN messages edited to be V(0) logs with more descriptive messages
* fix: WARN messages have V(-1) level
* fix: WithValues logging removed
* fix: revolsing tallaxes comments
* chore: camelcase for key values for logs
* chore: resourceName key edited to be more specific, Kubernetes resources capitalized, k8s expanded out
* docs: logging guidelines
* docs: more descriptive between V(-1) and Error + formatting
* fix: drop V(-1) for fallback and change to kebab case for instanceType and capacityType
* fix: drop all V(-1) to Info
---------
Co-authored-by: Alex Leites <[email protected]>
// Note: we don't consider this a hard failure for drift if the KubernetesVersion is invalid/not ready to use, so we ignore returning the error here.
105
108
// We simply ensure the stored version is valid and ready to use, if we are to calculate potential Drift based on it.
106
109
// TODO (charliedmcb): I'm wondering if we actually want to have these soft-error cases switch to return an error if no-drift condition was found across all of IsDrifted.
107
-
logger.Info(fmt.Sprintf("WARN: Kubernetes version readiness invalid when checking drift: %s", err))
110
+
logger.Info("kubernetes version not ready, skipping drift check", "error", err)
logger.V(1).Info(fmt.Sprintf("drift triggered for %s, with expected k8s version %s, and actual k8s version %s", K8sVersionDrift, k8sVersion, nodeK8sVersion))
121
+
logger.V(1).Info("drift triggered due to k8s version mismatch",
// Note: we don't consider this a hard failure for drift if the Images are not ready to use, so we ignore returning the error here.
171
177
// The stored Images must be ready to use if we are to calculate potential Drift based on them.
172
178
// TODO (charliedmcb): I'm wondering if we actually want to have these soft-error cases switch to return an error if no-drift condition was found across all of IsDrifted.
173
-
logger.Info(fmt.Sprintf("WARN: NodeImage readiness invalid when checking drift: %s", err))
179
+
logger.Info("node image not ready, skipping drift check", "error", err)
logger.V(1).Info(fmt.Sprintf("drift triggered for %s, as actual image id %s was not found in the set of currently available node images", ImageDrift, vmImageID))
194
+
logger.V(1).Info("drift triggered as actual image id was not found in the set of currently available node images",
nodeClass.StatusConditions().SetFalse(v1beta1.ConditionTypeImagesReady, "KubernetesUpgrade", "Performing kubernetes upgrade, need to get latest images")
98
98
} elseifnewK8sVersion.LT(currentK8sVersion) {
99
-
logger.Info(fmt.Sprintf("WARN: detected potential kubernetes downgrade: from %s (current), to %s (discovered)", currentK8sVersion.String(), newK8sVersion.String()))
0 commit comments