Skip to content

Commit

Permalink
MGMT-16001: Sanitize reclaim daemonset name
Browse files Browse the repository at this point in the history
https://issues.redhat.com/browse/MGMT-16001
Recently there have been errors running the reclaim
agent when unbinding due to the daemonset's
container's name containing dots. This replaces
all dot characters `.` with underscore characters `_`.
  • Loading branch information
CrystalChun committed Oct 22, 2023
1 parent 8c966c0 commit 703e367
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/controller/controllers/agent_reclaimer.go
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"os"
"path/filepath"
"strings"

"github.com/kelseyhightower/envconfig"
authzv1 "github.com/openshift/api/authorization/v1"
Expand Down Expand Up @@ -235,7 +236,7 @@ func (r *agentReclaimer) createNextStepRunnerDaemonSet(ctx context.Context, c cl
})
}

name := fmt.Sprintf("%s-reclaim", nodeName)
name := fmt.Sprintf("%s-reclaim", strings.ReplaceAll(nodeName, ".", "_"))
var privileged bool = true
containers := []corev1.Container{{
Name: name,
Expand Down

0 comments on commit 703e367

Please sign in to comment.