Skip to content

Commit

Permalink
Adding a . as a valid character for Modules' name.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ybettan committed Jan 8, 2025
1 parent 7c5569e commit a45b8fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/nmc/labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit a45b8fc

Please sign in to comment.