From 02e4067cd33b876ca3ec5e15766ba7002cdefb41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corentin=20N=C3=A9au?= Date: Fri, 8 Nov 2024 10:42:59 +0100 Subject: [PATCH] Skip install loop for invalid patches (#3040) This should prevent the Fleet agent from repeatedly trying to install a release with an invalid patch when trying to undo drift on a service's ports, which can only be rolled back in force mode so far, ie by uninstalling and reinstalling the release. In turn, this may prevent the original, valid release revision from disappearing, which caused discrepancies in version numbers between Helm history and the bundle deployment status, leading to sets of resources being emptied and eventually to bundles appearing as ready for drifting bundle deployments. --- internal/cmd/agent/deployer/deployer.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/cmd/agent/deployer/deployer.go b/internal/cmd/agent/deployer/deployer.go index f1044acd83..8cb3bfc919 100644 --- a/internal/cmd/agent/deployer/deployer.go +++ b/internal/cmd/agent/deployer/deployer.go @@ -264,6 +264,7 @@ func deployErrToStatus(err error, status fleet.BundleDeploymentStatus) (bool, fl "(YAML parse error)|" + // YAML is broken in source files "(Forbidden: updates to [0-9A-Za-z]+ spec for fields other than [0-9A-Za-z ']+ are forbidden)|" + // trying to update fields that cannot be updated "(Forbidden: spec is immutable after creation)|" + // trying to modify immutable spec + "(cannot patch.*is invalid)|" + // trying to apply an invalid patch (eg. undoing a port edit on a Service) "(chart requires kubeVersion: [0-9A-Za-z\\.\\-<>=]+ which is incompatible with Kubernetes)", // trying to deploy to incompatible Kubernetes ) if re.MatchString(msg) {