@@ -18,8 +18,8 @@ import (
1818)
1919
2020func TestAppsThenContainersCompletion (t * testing.T ) {
21- appNames := []string {"test-1" , "acorn-1" , "acorn-2" , "hub " , "test-2" }
22- containerNames := []string {"test-1.container-1" , "acorn-1.container-1" , "acorn-2.container-1" , "hub .container" , "hub .other-container" , "test-2.container-1" }
21+ appNames := []string {"test-1" , "acorn-1" , "acorn-2" , "manager " , "test-2" }
22+ containerNames := []string {"test-1.container-1" , "acorn-1.container-1" , "acorn-2.container-1" , "manager .container" , "manager .other-container" , "test-2.container-1" }
2323 apps := make ([]apiv1.App , 0 , len (appNames ))
2424 for _ , name := range appNames {
2525 apps = append (apps , apiv1.App {ObjectMeta : metav1.ObjectMeta {Name : name }})
@@ -68,9 +68,9 @@ func TestAppsThenContainersCompletion(t *testing.T) {
6868 wantDirective : cobra .ShellCompDirectiveNoFileComp ,
6969 },
7070 {
71- name : "Complete hub , only hub returned" ,
72- toComplete : "hub " ,
73- wantNames : []string {"hub " },
71+ name : "Complete manager , only manager returned" ,
72+ toComplete : "manager " ,
73+ wantNames : []string {"manager " },
7474 wantDirective : cobra .ShellCompDirectiveNoFileComp ,
7575 },
7676 {
@@ -80,27 +80,27 @@ func TestAppsThenContainersCompletion(t *testing.T) {
8080 wantDirective : cobra .ShellCompDirectiveNoFileComp ,
8181 },
8282 {
83- name : "Complete starting with hub ." ,
84- toComplete : "hub ." ,
85- wantNames : []string {"hub .container" , "hub .other-container" },
83+ name : "Complete starting with manager ." ,
84+ toComplete : "manager ." ,
85+ wantNames : []string {"manager .container" , "manager .other-container" },
8686 wantDirective : cobra .ShellCompDirectiveNoFileComp ,
8787 },
8888 {
89- name : "Complete starting with hub .c" ,
90- toComplete : "hub .c" ,
91- wantNames : []string {"hub .container" },
89+ name : "Complete starting with manager .c" ,
90+ toComplete : "manager .c" ,
91+ wantNames : []string {"manager .container" },
9292 wantDirective : cobra .ShellCompDirectiveNoFileComp ,
9393 },
9494 {
95- name : "Complete hub .container, only hub .container returned" ,
96- toComplete : "hub .container" ,
97- wantNames : []string {"hub .container" },
95+ name : "Complete manager .container, only manager .container returned" ,
96+ toComplete : "manager .container" ,
97+ wantNames : []string {"manager .container" },
9898 wantDirective : cobra .ShellCompDirectiveNoFileComp ,
9999 },
100100 {
101- name : "Complete hub .c, but hub .container already in args" ,
102- args : []string {"hub .container" },
103- toComplete : "hub .c" ,
101+ name : "Complete manager .c, but manager .container already in args" ,
102+ args : []string {"manager .container" },
103+ toComplete : "manager .c" ,
104104 wantNames : []string {},
105105 wantDirective : cobra .ShellCompDirectiveNoFileComp ,
106106 },
@@ -129,7 +129,7 @@ func TestAppsThenContainersCompletion(t *testing.T) {
129129}
130130
131131func TestAppsCompletion (t * testing.T ) {
132- names := []string {"test-1" , "acorn-1" , "acorn-2" , "hub " , "test-2" }
132+ names := []string {"test-1" , "acorn-1" , "acorn-2" , "manager " , "test-2" }
133133 apps := make ([]apiv1.App , 0 , len (names ))
134134 for _ , name := range names {
135135 apps = append (apps , apiv1.App {ObjectMeta : metav1.ObjectMeta {Name : name }})
@@ -173,9 +173,9 @@ func TestAppsCompletion(t *testing.T) {
173173 wantDirective : cobra .ShellCompDirectiveNoFileComp ,
174174 },
175175 {
176- name : "Complete hub , only hub returned" ,
177- toComplete : "hub " ,
178- wantNames : []string {"hub " },
176+ name : "Complete manager , only manager returned" ,
177+ toComplete : "manager " ,
178+ wantNames : []string {"manager " },
179179 wantDirective : cobra .ShellCompDirectiveNoFileComp ,
180180 },
181181 {
@@ -203,7 +203,7 @@ func TestAppsCompletion(t *testing.T) {
203203}
204204
205205func TestContainersCompletion (t * testing.T ) {
206- names := []string {"test-1.container-1" , "acorn-1.container-1" , "acorn-2.container-1" , "hub .container" , "hub .other-container" , "test-2.container-1" }
206+ names := []string {"test-1.container-1" , "acorn-1.container-1" , "acorn-2.container-1" , "manager .container" , "manager .other-container" , "test-2.container-1" }
207207 containers := make ([]apiv1.ContainerReplica , 0 , len (names ))
208208 for _ , name := range names {
209209 containers = append (containers , apiv1.ContainerReplica {ObjectMeta : metav1.ObjectMeta {Name : name }, Spec : apiv1.ContainerReplicaSpec {AppName : strings .Split (name , "." )[0 ]}})
@@ -246,21 +246,21 @@ func TestContainersCompletion(t *testing.T) {
246246 wantDirective : cobra .ShellCompDirectiveNoFileComp ,
247247 },
248248 {
249- name : "Complete starting with hub ." ,
250- toComplete : "hub ." ,
251- wantNames : []string {"hub .container" , "hub .other-container" },
249+ name : "Complete starting with manager ." ,
250+ toComplete : "manager ." ,
251+ wantNames : []string {"manager .container" , "manager .other-container" },
252252 wantDirective : cobra .ShellCompDirectiveNoFileComp ,
253253 },
254254 {
255- name : "Complete starting with hub .c" ,
256- toComplete : "hub .c" ,
257- wantNames : []string {"hub .container" },
255+ name : "Complete starting with manager .c" ,
256+ toComplete : "manager .c" ,
257+ wantNames : []string {"manager .container" },
258258 wantDirective : cobra .ShellCompDirectiveNoFileComp ,
259259 },
260260 {
261- name : "Complete hub .container, only hub .container returned" ,
262- toComplete : "hub .container" ,
263- wantNames : []string {"hub .container" },
261+ name : "Complete manager .container, only manager .container returned" ,
262+ toComplete : "manager .container" ,
263+ wantNames : []string {"manager .container" },
264264 wantDirective : cobra .ShellCompDirectiveNoFileComp ,
265265 },
266266 {
@@ -423,7 +423,7 @@ func TestAcornContainerCompletion(t *testing.T) {
423423 "test-2" : {
424424 "container-1" : {},
425425 },
426- "hub " : {
426+ "manager " : {
427427 "web" : {},
428428 "db" : {},
429429 "controller" : {},
@@ -488,7 +488,7 @@ func TestOnlyAppsWithAcornContainer(t *testing.T) {
488488 "test-2" : {
489489 "container-1" : {},
490490 },
491- "hub " : {
491+ "manager " : {
492492 "web" : {},
493493 "db" : {},
494494 "controller" : {},
@@ -528,12 +528,12 @@ func TestOnlyAppsWithAcornContainer(t *testing.T) {
528528 }{
529529 {
530530 name : "Nothing to complete and no container, return apps" ,
531- wantNames : []string {"hub " , "test-1" , "test-2" },
531+ wantNames : []string {"manager " , "test-1" , "test-2" },
532532 wantDirective : cobra .ShellCompDirectiveNoFileComp ,
533533 },
534534 {
535535 name : "Nothing to complete and no container, return apps except those in args" ,
536- args : []string {"hub " , "test-2" },
536+ args : []string {"manager " , "test-2" },
537537 wantNames : []string {"test-1" },
538538 wantDirective : cobra .ShellCompDirectiveNoFileComp ,
539539 },
@@ -545,15 +545,15 @@ func TestOnlyAppsWithAcornContainer(t *testing.T) {
545545 },
546546 {
547547 name : "Something with '.' to complete and no container should be the k8s container completion" ,
548- toComplete : "hub ." ,
549- wantNames : []string {"hub .controller" , "hub .db" , "hub .web" },
548+ toComplete : "manager ." ,
549+ wantNames : []string {"manager .controller" , "manager .db" , "manager .web" },
550550 wantDirective : cobra .ShellCompDirectiveNoFileComp ,
551551 },
552552 {
553553 name : "Something with '.' to complete and no container should be the k8s container completion except those in args" ,
554- toComplete : "hub ." ,
555- args : []string {"hub .db" },
556- wantNames : []string {"hub .controller" , "hub .web" },
554+ toComplete : "manager ." ,
555+ args : []string {"manager .db" },
556+ wantNames : []string {"manager .controller" , "manager .web" },
557557 wantDirective : cobra .ShellCompDirectiveNoFileComp ,
558558 },
559559 {
0 commit comments