From 336b75a3603e139204f0b480e0003ed82f2dbc3f Mon Sep 17 00:00:00 2001 From: Theo Brigitte Date: Sun, 15 Dec 2024 23:03:17 +0100 Subject: [PATCH] Squashed commit of the following: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 2f50a348f635bf407fbf3a58a95ade24a57a601a Author: Theo Brigitte Date: Sun Dec 15 23:02:05 2024 +0100 predicates: do not process delete events and not ready pods commit 039b403254a0ddc2f5d9f6f6828ca9878f0207c6 Author: Theo Brigitte Date: Sun Dec 15 22:45:28 2024 +0100 fix reconciled object: Secret commit a9a60927dcb78c61fbfc0643ee6f1f20a3ce2fb8 Merge: a666060 a91e537 Author: Théo Brigitte Date: Sun Dec 15 19:09:34 2024 +0100 Merge branch 'alertmanager-config' into alertmanager-controller commit a91e5372c86aa76af4d3a198db574da8b66276db Author: Theo Brigitte Date: Sun Dec 15 19:07:52 2024 +0100 rename alertmanager to alerting in values.yaml commit 5b639a1a7bad2a62d13a75d0d7c414ffaaade9a1 Author: Theo Brigitte Date: Sun Dec 15 19:07:15 2024 +0100 Revert "Merge remote-tracking branch 'origin/alertmanager-config-helm' into alertmanager-config" This reverts commit b3f9a8e5bb89cea7b2da3caf9e7331455dc340f3, reversing changes made to cc9987ddf76085add749e9f6d11a716af7c34a41. commit a6660609098f6337a839833f53d9102442a3672a Author: Theo Brigitte Date: Sun Dec 15 18:56:34 2024 +0100 restore flags commit a80d94d75ac10a6a79fd8cc643729913d9126cad Merge: 6fbcf61 01ce0f3 Author: Theo Brigitte Date: Sun Dec 15 18:56:21 2024 +0100 Merge branch 'alertmanager-config' into alertmanager-controller commit 01ce0f3fe64414b3d54312af3987b53871712881 Author: Theo Brigitte Date: Sun Dec 15 18:55:56 2024 +0100 remove uneeded flags commit 8cda08b2a16c5d0a846f821b30c530351aa174bc Author: Theo Brigitte Date: Sun Dec 15 18:50:58 2024 +0100 get base template name commit 6fbcf61be9eb1f576522a4bac92266b8e3c3de30 Author: Theo Brigitte Date: Sun Dec 15 18:33:10 2024 +0100 update alertmanager job commit ee02be2db3f23cae7cb83822e98d7e17c0bd59ca Merge: 7d75b09 b0eb4dc Author: Theo Brigitte Date: Sun Dec 15 18:31:16 2024 +0100 Merge branch 'alertmanager-config' into alertmanager-controller commit b0eb4dc0fa0fddea55eb89f8089d026f36bdbf63 Author: Theo Brigitte Date: Sun Dec 15 18:30:47 2024 +0100 pass secret to Configure, add comment commit fbda645333bfc2c102f21c698c077effc927de67 Author: Theo Brigitte Date: Sun Dec 15 18:16:48 2024 +0100 revert grafana organization controller changes commit 7d75b09107a11f1ec41de260834014778220a24e Merge: 740d3b9 18935b1 Author: Theo Brigitte Date: Sun Dec 15 18:13:07 2024 +0100 Merge branch 'alertmanager-config' into alertmanager-controller commit 18935b1e80cc0b8650a4ed95c16ec349e6f21a30 Author: Theo Brigitte Date: Sun Dec 15 18:12:47 2024 +0100 update alertmanager > alerting in deployment.yaml commit b3f9a8e5bb89cea7b2da3caf9e7331455dc340f3 Merge: cc9987d 9591a92 Author: Theo Brigitte Date: Sun Dec 15 18:11:51 2024 +0100 Merge remote-tracking branch 'origin/alertmanager-config-helm' into alertmanager-config commit cc9987ddf76085add749e9f6d11a716af7c34a41 Author: Theo Brigitte Date: Sun Dec 15 18:10:40 2024 +0100 revert grafana organization controller changes commit 740d3b9229d24c5bda545ee8a9120cc5353f8fe1 Author: Theo Brigitte Date: Sun Dec 15 18:02:00 2024 +0100 Add Alertmanager controller commit e58c6827fb9445a5d7f3abcb7e91a7d460e75f22 Author: Theo Brigitte Date: Sun Dec 15 17:43:56 2024 +0100 remove alertmanager job from grafana organization controller commit c7153159732621069033c5738917759a22af56bb Merge: 377edef b215065 Author: Theo Brigitte Date: Fri Dec 13 13:04:41 2024 +0100 Merge remote-tracking branch 'origin/main' into alertmanager-config commit 9591a925c7090eb6b1e787e520732a56b022e001 Author: Theo Brigitte Date: Fri Dec 13 12:52:01 2024 +0100 rename alertmanager to alerting in values.yaml commit 492a1d77eb8d49f59565985cf6fd56405114e0db Merge: 4cfbb20 b215065 Author: Theo Brigitte Date: Fri Dec 13 12:47:59 2024 +0100 Merge remote-tracking branch 'origin/main' into alertmanager-config-helm commit 377edef187644813ffc89b41222c7a145e21125d Merge: a366895 068fc03 Author: Theo Brigitte Date: Tue Dec 10 20:08:07 2024 +0100 Merge remote-tracking branch 'origin/main' into alertmanager-config commit a366895c3ea4feca727340dfeb7084ce15cf5d3a Author: Theo Brigitte Date: Tue Dec 10 20:05:31 2024 +0100 Handle non 201 errors commit 388a6395abab822d2b3ac058de00f17cd45f97f2 Author: Theo Brigitte Date: Tue Dec 10 20:05:22 2024 +0100 Fix invalid request body commit c522b8155ea2a25076f80a1d453751641015f2ed Author: Theo Brigitte Date: Tue Dec 10 19:20:30 2024 +0100 fix debug log commit 3c450c7b2a8b01f9d61a389c3b8a76f907d8a9df Author: Theo Brigitte Date: Tue Dec 10 19:15:27 2024 +0100 debug log commit 4cfbb208e62f9f4d93641f696b701176c160a745 Author: Theo Brigitte Date: Tue Dec 10 18:54:19 2024 +0100 Add alertmanagerURL commit 8a79cf5e7fa9330c93ae094ffa6ae0308d1bbd87 Author: Theo Brigitte Date: Tue Dec 10 18:53:31 2024 +0100 Add values and alertmanagerURL commit 5d320b91ac3a53460568b5fd704d159df2b98ce3 Author: Theo Brigitte Date: Tue Dec 10 17:29:39 2024 +0100 quote the tmp_string commit 8cbdbfb2882cfb2351c778b49a40f7938b85a665 Author: Taylor Bot Date: Tue Dec 10 23:47:03 2024 +0900 Release v0.10.0 (#191) Co-authored-by: Quentin Bisson commit 801cadd56abdae9a9d90084947eb27c092af1cb3 Author: Theo Brigitte Date: Tue Dec 10 15:43:28 2024 +0100 helm 3.10.3 I hate you deeply This fixes the infamous: error calling tpl: cannot retrieve Template.Basepath from values inside tpl function It does use .Values in templates to access values and pass $ root context to tpl commit 2ea110157857680fd66f38733120daf7948748ce Author: Theo Brigitte Date: Tue Dec 10 13:13:25 2024 +0100 try to make helm happy: error calling tpl: cannot retrieve Template.Basepath from values inside tpl function commit 49b5a1ac55088eee7d81ebd5a51bd36ce12d43a5 Author: Theo Brigitte Date: Tue Dec 10 11:26:39 2024 +0100 normalize values names commit 27b62fa49e75d29d05390ee4f90614ce1db89fd5 Author: Theo Brigitte Date: Tue Dec 10 11:09:46 2024 +0100 re-use existing values commit 9eea3f8be51853787478c2ca1154c9aaed777258 Author: Theo Brigitte Date: Tue Dec 10 10:25:47 2024 +0100 use .helm-template instead of .tpl commit 171b62af9b24b5636c39bf7793800e7a434448d5 Author: Theo Brigitte Date: Tue Dec 10 09:41:51 2024 +0100 Add Alertmanager config and templates in Helm chart - Add secret resource, embedding raw and templated alertmanager files - Expose alertmanager templates values as helm chart values - Remove all Mimir related conditions - Split template into url and notification templates - Drop template directive, dynamically set by the operator - Escape template in template - Re-use slack actions commit cebac348f924e1e643f87f0139a5a9432930f5bd Author: Theo Brigitte Date: Tue Dec 10 17:04:34 2024 +0100 Set the client commit dd4872a083166abab14c31da26471216539edb9d Merge: 4e89889 e5e90e1 Author: Theo Brigitte Date: Tue Dec 10 16:46:58 2024 +0100 Merge remote-tracking branch 'origin/main' into alertmanager-config commit 4e89889b901d2b098d39defe05cf2f73bc26ed7a Author: Theo Brigitte Date: Tue Dec 10 16:40:14 2024 +0100 Wire Alertmanager into GrafanaOrganization controller commit dfec94d4001a87b5b32f940982ee98675d4bb726 Author: Theo Brigitte Date: Tue Dec 10 16:25:01 2024 +0100 Add alertmanager helm helpers commit 2023dc7b27c4e31cb38c9c13ac828a6f054a19bf Author: Theo Brigitte Date: Tue Dec 10 12:56:53 2024 +0100 fix linting errors commit b32a6de5f8c08bb5cf6b2741d4ac07a4d7afd122 Author: Theo Brigitte Date: Tue Dec 10 12:27:32 2024 +0100 go mod tidy commit b1606599181be5522dffab591e71a8a4073c425b Author: Theo Brigitte Date: Tue Dec 10 11:54:55 2024 +0100 Remove test commit d8a3026eeada004e296690668cc578f22a61c3db Author: Theo Brigitte Date: Tue Dec 10 11:36:22 2024 +0100 Fix test commit 3e6e2f98a35b7c666d46f2d93f21146edc6a0c77 Author: Theo Brigitte Date: Tue Dec 10 09:48:47 2024 +0100 Fix maps > slices.Collect commit 3776e728df139eea50831c4793cb2881bc97c6bd Author: Theo Brigitte Date: Tue Dec 10 09:34:25 2024 +0100 Retrive all templates by suffix commit 707b23ac1374b180054828253c8053c234ccc704 Author: Theo Brigitte Date: Tue Dec 10 09:25:58 2024 +0100 setup logger before loading env vars commit 5e41fc5ca5e572f740bd81b93a22ce2c5f4ba775 Author: Theo Brigitte Date: Mon Dec 9 16:06:21 2024 +0100 Add alertmanager.Configure commit 5b47de707417d7df4e01daa5ca311adc99b2a022 Merge: a6b2ccc 8df42b3 Author: Theo Brigitte Date: Mon Dec 9 15:36:40 2024 +0100 Merge remote-tracking branch 'origin/main' into alertmanager-config commit a6b2ccce812feef4edda1844fc33c0ffd9ddb5b6 Author: Theo Brigitte Date: Mon Dec 9 15:35:49 2024 +0100 Add some stuff commit 8beb36cb0306123987dd4d04f824bcf84590b6f9 Merge: bc2aef8 a7f6ca4 Author: Theo Brigitte Date: Mon Dec 9 14:40:41 2024 +0100 Merge remote-tracking branch 'origin/main' into alertmanager-config commit bc2aef816f3e32ea6f3125faea89d619cf70ea26 Author: Theo Brigitte Date: Thu Dec 5 21:37:12 2024 +0100 go mod tidy commit b58a751105bd6798cbeba3488b47049120e7acc5 Author: Theo Brigitte Date: Thu Dec 5 21:28:51 2024 +0100 I said green commit f281c754f5adff609c6202a10a5ffa39526ca73b Author: Theo Brigitte Date: Thu Dec 5 21:18:29 2024 +0100 make the build green commit b57550727447e5fac61ce47c3ccdd4e5afe4bc5b Author: Theo Brigitte Date: Thu Dec 5 20:40:24 2024 +0100 make the alertmanagerURL simpler commit 98d6695064dc5299f81de126b10206376b086918 Author: Theo Brigitte Date: Thu Dec 5 19:34:59 2024 +0100 Add alertmanager config handling --- .../predicates/alertmanager_secret_predicate.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/internal/controller/predicates/alertmanager_secret_predicate.go b/internal/controller/predicates/alertmanager_secret_predicate.go index 210133f1..11c6e1ee 100644 --- a/internal/controller/predicates/alertmanager_secret_predicate.go +++ b/internal/controller/predicates/alertmanager_secret_predicate.go @@ -18,6 +18,10 @@ func NewAlertmanagerSecretPredicate(secretName, namespace string) predicate.Pred return false } + if !secret.DeletionTimestamp.IsZero() { + return false + } + labels := secret.GetLabels() ok = secret.GetName() == secretName && @@ -51,12 +55,17 @@ func NewAlertmanagerPodPredicate() predicate.Predicate { return false } + if !pod.DeletionTimestamp.IsZero() { + return false + } + labels := pod.GetLabels() ok = pod.GetNamespace() == mimirNamespace && labels != nil && labels["app.kubernetes.io/component"] == mimirAlertmanagerComponent && - labels["app.kubernetes.io/instance"] == mimirInstance + labels["app.kubernetes.io/instance"] == mimirInstance && + isPodReady(pod) return ok }