diff --git a/pkg/networkservice/common/createpod/server.go b/pkg/networkservice/common/createpod/server.go index a1ad0b8..e2f6182 100644 --- a/pkg/networkservice/common/createpod/server.go +++ b/pkg/networkservice/common/createpod/server.go @@ -41,7 +41,7 @@ import ( const ( nodeNameKey = "nodeName" - createdBy = "spawnedBy" + createdBy = "createdBy" ) type createPodServer struct { @@ -50,7 +50,6 @@ type createPodServer struct { deserializer runtime.Decoder podTemplate string myNamespace string - myNode string myName string } @@ -69,8 +68,7 @@ func NewServer(ctx context.Context, client kubernetes.Interface, podTemplate str client: client, myNamespace: "default", deserializer: deserializer, - myNode: os.Getenv("NODE_NAME"), - myName: os.Getenv("POD_NAME"), + myName: os.Getenv("HOSTNAME"), } for _, opt := range options { diff --git a/pkg/networkservice/common/createpod/server_test.go b/pkg/networkservice/common/createpod/server_test.go index c8caebf..8186a7a 100644 --- a/pkg/networkservice/common/createpod/server_test.go +++ b/pkg/networkservice/common/createpod/server_test.go @@ -68,7 +68,7 @@ objectmeta: clientSet := fake.NewSimpleClientset() - err := os.Setenv("POD_NAME", "supplier-1") + err := os.Setenv("HOSTNAME", "supplier-1") require.NoError(t, err) server := next.NewNetworkServiceServer( @@ -146,7 +146,7 @@ objectmeta: clientSet := fake.NewSimpleClientset() - err := os.Setenv("POD_NAME", "supplier-1") + err := os.Setenv("HOSTNAME", "supplier-1") require.NoError(t, err) server := next.NewNetworkServiceServer( @@ -223,7 +223,7 @@ objectmeta: clientSet := fake.NewSimpleClientset() - err := os.Setenv("POD_NAME", "supplier-1") + err := os.Setenv("HOSTNAME", "supplier-1") require.NoError(t, err) server := next.NewNetworkServiceServer( @@ -270,7 +270,7 @@ objectmeta: clientSet := fake.NewSimpleClientset() - err := os.Setenv("POD_NAME", "supplier-1") + err := os.Setenv("HOSTNAME", "supplier-1") require.NoError(t, err) server := next.NewNetworkServiceServer(