Skip to content

Commit

Permalink
Trim the suffix -bluefield from NodeName
Browse files Browse the repository at this point in the history
As the metalnet on bluefield manages network objects of
the host. Use the host's name by trimming the "-bluefield"
in the nodeName.

Signed-off-by: Guvenc Gulce <guevenc.guelce@sap.com>
  • Loading branch information
guvenc committed Mar 13, 2024
1 parent 2751787 commit b6b8bd2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ import (

const dpserviceIPv6SupportVersionStr = "v0.3.1"

const bluefieldSuffix = "-bluefield"

var (
scheme = runtime.NewScheme()
setupLog = ctrl.Log.WithName("setup")
Expand Down Expand Up @@ -314,6 +316,11 @@ func main() {
}
defaultRouterAddr.RWMutex.Unlock()

if strings.HasSuffix(nodeName, bluefieldSuffix) {
nodeName = strings.TrimSuffix(nodeName, bluefieldSuffix)
setupLog.Info("Running on bluefield, trimming -bluefield from Nodename")
}

if err = (&controllers.NetworkReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
Expand Down

0 comments on commit b6b8bd2

Please sign in to comment.