Skip to content

Commit 672b08d

Browse files
authored
Merge pull request #84 from maleck13/issue-2838-view-mobile-clients
add icon as annotation
2 parents 9a3cb1d + 6960381 commit 672b08d

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

pkg/cmd/clients.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -157,19 +157,20 @@ When used standalone, a namespace must be specified by providing the --namespace
157157
APIVersion: "mobile.k8s.io/v1alpha1",
158158
},
159159
ObjectMeta: metav1.ObjectMeta{
160-
Labels: map[string]string{},
160+
Labels: map[string]string{},
161+
Annotations: map[string]string{},
161162
},
162163
Spec: v1alpha1.MobileClientSpec{Name: name, ApiKey: appKey, ClientType: clientType, AppIdentifier: appIdentifier},
163164
}
164165
switch app.Spec.ClientType {
165166
case "android":
166-
app.Labels["icon"] = "fa-android"
167+
app.Annotations["icon"] = "fa fa-android"
167168
break
168169
case "iOS":
169-
app.Labels["icon"] = "fa-apple"
170+
app.Annotations["icon"] = "fa fa-apple"
170171
break
171172
case "cordova":
172-
app.Labels["icon"] = "icon-cordova"
173+
app.Annotations["icon"] = "font-icon icon-cordova"
173174
break
174175
}
175176
app.Name = name + "-" + strings.ToLower(app.Spec.ClientType)

pkg/cmd/clients_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -334,11 +334,11 @@ func TestMobileClientsCmd_TestCreateClient(t *testing.T) {
334334
if c.Spec.ApiKey == "" {
335335
t.Fatal("expected an apiKey to be generated but it was empty")
336336
}
337-
icon, ok := c.Labels["icon"]
337+
icon, ok := c.Annotations["icon"]
338338
if !ok {
339339
t.Fatal("expected an icon to be set but there was none")
340340
}
341-
if icon != "icon-cordova" {
341+
if icon != "font-icon icon-cordova" {
342342
t.Fatal("expected the icon to be icon-cordova but got ", icon)
343343
}
344344
},
@@ -371,11 +371,11 @@ func TestMobileClientsCmd_TestCreateClient(t *testing.T) {
371371
if c.Spec.ApiKey == "" {
372372
t.Fatal("expected an apiKey to be generated but it was empty")
373373
}
374-
icon, ok := c.Labels["icon"]
374+
icon, ok := c.Annotations["icon"]
375375
if !ok {
376376
t.Fatal("expected an icon to be set but there was none")
377377
}
378-
if icon != "fa-android" {
378+
if icon != "fa fa-android" {
379379
t.Fatal("expected the icon to be fa-android but got ", icon)
380380
}
381381
},
@@ -408,11 +408,11 @@ func TestMobileClientsCmd_TestCreateClient(t *testing.T) {
408408
if c.Spec.ApiKey == "" {
409409
t.Fatal("expected an apiKey to be generated but it was empty")
410410
}
411-
icon, ok := c.Labels["icon"]
411+
icon, ok := c.Annotations["icon"]
412412
if !ok {
413413
t.Fatal("expected an icon to be set but there was none")
414414
}
415-
if icon != "fa-apple" {
415+
if icon != "fa fa-apple" {
416416
t.Fatal("expected the icon to be fa-apple but got ", icon)
417417
}
418418
},

0 commit comments

Comments
 (0)