From 5a2e77c6f700445e7beefd3313e1d1da5dd82309 Mon Sep 17 00:00:00 2001 From: "jesse.millan" Date: Wed, 25 May 2022 12:10:45 -0700 Subject: [PATCH] Match nodes by complete hostame rather than prefix to avoid false positives. --- pkg/oci/client/compute.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/oci/client/compute.go b/pkg/oci/client/compute.go index 11ed84228b..471b165d45 100644 --- a/pkg/oci/client/compute.go +++ b/pkg/oci/client/compute.go @@ -16,8 +16,6 @@ package client import ( "context" - "strings" - "github.com/oracle/oci-go-sdk/v50/core" "github.com/pkg/errors" ) @@ -203,7 +201,7 @@ func (c *client) GetInstanceByNodeName(ctx context.Context, compartmentID, vcnID if (vnic.PublicIp != nil && *vnic.PublicIp == nodeName) || (vnic.PrivateIp != nil && *vnic.PrivateIp == nodeName) || - (vnic.HostnameLabel != nil && (*vnic.HostnameLabel != "" && strings.HasPrefix(nodeName, *vnic.HostnameLabel))) { + (vnic.HostnameLabel != nil && (*vnic.HostnameLabel != "" && nodeName == *vnic.HostnameLabel)) { instance, err := c.GetInstance(ctx, *attachment.InstanceId) if err != nil { return nil, err