From a45b8fc38777c18ba9524ba825c8f485b635089f Mon Sep 17 00:00:00 2001 From: Yoni Bettan Date: Wed, 8 Jan 2025 16:22:54 +0200 Subject: [PATCH] Adding a `.` as a valid character for `Module`s' name. When a `Module` is deleted, the `NMC` controller is removing the labels for this `Module` in the `NMC` object. As long as those labels for a specific module exists, the module's finalizer will not be removed upon module deletion and the module will keep hanging forever if deleted. When a module is created with a `.` in its name, the created label for `NMC` doesn't match the expected regexp for this label and, therefore, not removed upon module's deletion. Adding the `.` will allow the label to match the regexp, be removed upon deletion and deleting the module gracefully. Signed-off-by: Yoni Bettan --- internal/nmc/labels.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/nmc/labels.go b/internal/nmc/labels.go index a8121721f..9fcbfd9c4 100644 --- a/internal/nmc/labels.go +++ b/internal/nmc/labels.go @@ -6,8 +6,8 @@ import ( ) var ( - reConfiguredLabel = regexp.MustCompile(`^beta\.kmm\.node\.kubernetes\.io/([a-zA-Z0-9-]+)\.([a-zA-Z0-9-]+)\.module-configured$`) - reInUseLabel = regexp.MustCompile(`^beta\.kmm\.node\.kubernetes\.io/([a-zA-Z0-9-]+)\.([a-zA-Z0-9-]+)\.module-in-use$`) + reConfiguredLabel = regexp.MustCompile(`^beta\.kmm\.node\.kubernetes\.io/([a-zA-Z0-9-]+)\.([a-zA-Z0-9-\.]+)\.module-configured$`) + reInUseLabel = regexp.MustCompile(`^beta\.kmm\.node\.kubernetes\.io/([a-zA-Z0-9-]+)\.([a-zA-Z0-9-\.]+)\.module-in-use$`) ) func IsModuleConfiguredLabel(s string) (bool, string, string) {