diff --git a/pkg/networkservice/common/createpod/option.go b/pkg/networkservice/common/createpod/option.go index b830b05..754eb87 100644 --- a/pkg/networkservice/common/createpod/option.go +++ b/pkg/networkservice/common/createpod/option.go @@ -37,7 +37,7 @@ func WithLabelsKey(labelsKey string) Option { } // WithNameGenerator sets function to be used for pod name generation. -// Default behavior is to append "-nodeName=" to the template name. +// Default behavior is to append "--on-node--" to the template name. func WithNameGenerator(nameGenerator func(templateName, nodeName string) string) Option { return func(t *createPodServer) { t.nameGenerator = nameGenerator diff --git a/pkg/networkservice/common/createpod/server.go b/pkg/networkservice/common/createpod/server.go index 4991de5..506e355 100644 --- a/pkg/networkservice/common/createpod/server.go +++ b/pkg/networkservice/common/createpod/server.go @@ -52,7 +52,7 @@ func NewServer(client kubernetes.Interface, podTemplate *corev1.Pod, options ... namespace: "default", labelsKey: "NSM_LABELS", nameGenerator: func(templateName, nodeName string) string { - return templateName + "-nodeName=" + nodeName + return templateName + "--on-node--" + nodeName }, } diff --git a/pkg/networkservice/common/createpod/server_test.go b/pkg/networkservice/common/createpod/server_test.go index 16725c5..d08fcd8 100644 --- a/pkg/networkservice/common/createpod/server_test.go +++ b/pkg/networkservice/common/createpod/server_test.go @@ -68,7 +68,7 @@ func TestCreatePod_RepeatedRequest(t *testing.T) { Connection: &networkservice.Connection{}, }) require.Error(t, err) - require.Equal(t, "pods \""+podTemplate.ObjectMeta.Name+"-nodeName="+nodeName1+"\" already exists", err.Error()) + require.Equal(t, "pods \""+podTemplate.ObjectMeta.Name+"--on-node--"+nodeName1+"\" already exists", err.Error()) podList, err := clientSet.CoreV1().Pods(testNamespace).List(ctx, metav1.ListOptions{}) require.NoError(t, err)