From 872e81862aba7eeb0d5fe7025b20844c473ec182 Mon Sep 17 00:00:00 2001 From: Ulysses Souza Date: Mon, 18 May 2020 14:56:32 +0200 Subject: [PATCH] Fix typo (and refactor the method name) Signed-off-by: Ulysses Souza --- azure/backend.go | 6 +++--- azure/backend_test.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/azure/backend.go b/azure/backend.go index 7b7204e89..8d9ccb781 100644 --- a/azure/backend.go +++ b/azure/backend.go @@ -177,7 +177,7 @@ func (cs *aciContainerService) Run(ctx context.Context, r containers.ContainerCo return createACIContainers(ctx, cs.ctx, groupDefinition) } -func getGrouNameContainername(containerID string) (groupName string, containerName string) { +func getGroupAndContainerName(containerID string) (groupName string, containerName string) { tokens := strings.Split(containerID, "_") groupName = tokens[0] if len(tokens) > 1 { @@ -190,7 +190,7 @@ func getGrouNameContainername(containerID string) (groupName string, containerNa } func (cs *aciContainerService) Exec(ctx context.Context, name string, command string, reader io.Reader, writer io.Writer) error { - groupName, containerAciName := getGrouNameContainername(name) + groupName, containerAciName := getGroupAndContainerName(name) containerExecResponse, err := execACIContainer(ctx, cs.ctx, command, groupName, containerAciName) if err != nil { return err @@ -206,7 +206,7 @@ func (cs *aciContainerService) Exec(ctx context.Context, name string, command st } func (cs *aciContainerService) Logs(ctx context.Context, containerName string, req containers.LogsRequest) error { - groupName, containerAciName := getGrouNameContainername(containerName) + groupName, containerAciName := getGroupAndContainerName(containerName) logs, err := getACIContainerLogs(ctx, cs.ctx, groupName, containerAciName) if err != nil { return err diff --git a/azure/backend_test.go b/azure/backend_test.go index 46d7557c7..e63f65ca6 100644 --- a/azure/backend_test.go +++ b/azure/backend_test.go @@ -10,15 +10,15 @@ import ( func TestGetContainerName(t *testing.T) { RegisterTestingT(t) - group, container := getGrouNameContainername("docker1234") + group, container := getGroupAndContainerName("docker1234") Expect(group).To(Equal("docker1234")) Expect(container).To(Equal(singleContainerName)) - group, container = getGrouNameContainername("compose_service1") + group, container = getGroupAndContainerName("compose_service1") Expect(group).To(Equal("compose")) Expect(container).To(Equal("service1")) - group, container = getGrouNameContainername("compose_stack_service1") + group, container = getGroupAndContainerName("compose_stack_service1") Expect(group).To(Equal("compose_stack")) Expect(container).To(Equal("service1")) }